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.
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.
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).
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.
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.
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.
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
Post a Comment