Home > Machine fix > Correcting optionalities at MS Visio

Correcting optionalities at MS Visio

The past month, I was studying the basics of databases, and among the things I had to learn along the way are Entity Relations (ER). Databases are composed of tables (called entities) that are to be connected based on their dependencies towards each other. Our instructor introduced us Microsoft Visio as a good tool to make Entity Relationship Diagrams.

In an ERD, each table has its own columns (called attributes) with at least one of them set as primary key to identify uniquely to that table. Depending on the relationship between entities, a table can inherit the primary key of another table as foreign key, and thus become a child to the table (parent) it is referencing to. Out-bound parent links can be set as mandatory or optional, and the child link cardinalities can be set such that parent-to-child relationships are:

Mandatory

Optional

1 TO 0 or more

0 or 1 TO 0 or more
1 TO 1 or more

0 or 1 TO 1 or more
1 TO 0 or 1

0 or 1 TO 0 or 1
1 TO 1

0 or 1 TO 1
1 to Range [at least N, at most M]

0 or 1 to Range [at least N, at most M]

In visual representation, the entity closest to the crow’s feet is the child.

When we were doing our case study on a hospital database, I had trouble trying to create a mandatory link from the parent entity (which should be displayed as two straight lines, instead of just a line and a ring). (Shown below)

ms_visio_00

In this scenario, ROOM is the parent entity and MEDICAL_SERVICE is the child entity and we need to fix their relation (highlighted below).

ms_visio_01

Under Miscellaneous > Child has parent, what we are supposed to do is to uncheck Optional.

ms_visio_02

The problem (the problem!) is that it’s grayed out (disabled). So …

Here’s the workaround:
Under Definition, disconnect associated relations. Make sure the key you choose is the one being inherited (in this case, Room_No)

ms_visio_03

Go back to Miscellaneous > Relationship type, make sure it’s set to Non-identifying. Under Child has parent, you can now (finally) uncheck Optional.

ms_visio_04

and voila!

ms_visio_05

There’s the mandatory relation right there.

Advertisements
  1. April 12, 2013 at 5:24 pm

    Wspaniała portal nie widziałem o takim podejściu do zagadnienia. Pokażę tą stronę wszystkim. Na pewno będę tu wracał. Życzę powodzenia w dalszym kierowaniu serwisu.

  2. Vidya
    March 22, 2014 at 2:11 am

    Thnak you very much. I have been struggling with this and finally stumbled across this link. Now I know how to fix it :-)). Thanks a lot again.

  1. March 29, 2013 at 12:33 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: