Skip to main content

Conversion of ER diagrams into database tables

Step 1: Conversion of strong entities
a)  For each strong entity create a separate table with same name as the entity. Include all simple attributes as the table column and break composite attributes into simple attributes and include them too. Note- Ignore multivalued attributes at this stage.
b) Select appropriate primary key for the table.

Step 2: Conversion of weak entities
a)  Conversion for weak entities is also same as strong entity, for each weak entity create a separate table with same name as the entity include all the simple attributes as table column and break composite attributes into simple attributes and include them.
b) Take primary key of strong entity and include that attribute as column in the new table created for weak entity which will act as a foreign key.
c) Declare the combination of foreign key and discriminator column as the primary key of the new table.

Step 3: Conversion of one to one relationship
a) When there is one to one relationship include the attributes of relationship in the modified table.
b) Which table to modify? is the next question. Now to answer this question you need to find which entity is having total participation in the relationship and modify that table.
c) If none of the entity is strong entity then you can modify the table of your choice(any one of them).

Step 4: Conversion of one to many relationship
a) For each one to many relationship modify "many" side to include primary key of "one" side. If relationship attributes are present then transfer them to many side.

Step 5: Conversion of many to many relationship
a) For each many to many relationship create a separate table and include primary key of M side and N side as foreign key in the new table.
b) Also include the relationship attributes as column in the newly created table.
c) Newly created table will have two foreign keys combine those foreign keys to form a primary key for that newly created table. If necessary include other attributes to form the primary key.

Step 6: Conversion of multi valued attributes
a) For each multi valued attributes create a separate table and include primary key of its parent table as foreign key.
b) Declare the combination of foreign key and multivalued attribute as primary key.

Step 7: Conversion of n-ary relationship
a) For each n-ary relationship create a separate table and include primary keys of all the entities as foreign keys.
b) Also include attributes of relationship as a column in the new table.
c) Declare the combination of foreign keys as primary key.



Comments

Popular posts from this blog

Facebook Login In PHP

As we all know Time is Money. When there's a long form on your site for registration you could sometimes lose your visitors. To make this registration step a success, adding a small social login button to your site may cut down lot of burden on visitors side and will help you in getting more attention on your data rather than wasting time on the lengthy registration process. By doing so visitor will be glad to see that you care for their precious time.   What do you think will there be anyone in this small world who is not having a Facebook account? According to recent stats 1 in every 13 person in this world is using facebook.

USB Boot Procedure

Simple step-by-step solution to create a bootable usb in cmd: 1)   Take a pen drive of more than 4gb . 2)   Now the most important step is to open cmd from start->search program and files->type cmd . 3)   Now in the new window, type diskpart and hit enter. 4)   Type the command list disk . Now, note the disk which have size identical to that of your pen drive. eg. disk 1. 5)   Type the command select disk 1 . 6)   Then type clean and hit enter. 7)   Just type create partition primary and press enter. 8)  Then run the command list partition . 9)  Type select partition 1 and hit enter. 10) Format it using the command format fs=ntfs . 11) Type the commands active , assign and exit in sequence. Now just copy all the files from Boot-able disc of  windows 7 to the pen drive and your pen drive is ready to be used as a boot-able device.