Uploaded by mnnetmi

Database Design: Mapping & Logical Design Steps

advertisement
Mapping & Logical Database Design

3 steps in DB designing:
1. Conceptual designing (Commonly the ER diagram)
2. Logical designing (Relational schema, columns and their data types)
3. Physical designing (DB using MySQL)

Steps in logical database designing:
1. Removing data models that are incompatible with logical design:
a. Removing all *:* binary relationships by creating a third table with 1:*
relationships
b. Removing all *:* recursive (unary) relationships by transforming into 1:*
binary relationship
c. Removing complex relationships (ternary, quaternary and other relationships
other than recursive and binary) by creating binary relationships
d. Removing multi-valued attributes by creating separate table
2.
Derive relations for local logical data model
i. Strong entity types: relations that include simple attributes of the entity
Ex: staff(staffNo, fName, lName, position, sex, DOB)
Primary Key staffNo
ii. Weak entity types: Ex: Preference(prefType, maxRent)
Primary Key None (at present)
iii. 1:* Binary relationship types: putting copy of the PK of the * table in 1
table
iv. 1:1 binary relationship types: should copy PK of one’s table into the other
using participation rules,
a) Mandatory relationships in both sides : combine both tables into
one
b) Mandatory participation on one side: the table that has
mandatory participation will be Parent and the other will be child
c) Optional participation in both sides: designating parent and child
with common sense
d) Optional participation in one side:
a. Ex: Preference(prefType, maxRent)
Primary Key None (at present)
v. 1:1 recursive relationships: follow any suitable 1:1 rule in (iv)
vi. Superclass/ subclass relationship types:
a) Mandatory - And : single relation
b) Optional - And: 2 relations
c) Mandatory – Or: many relations
d) Optional – Or: many relations
vii. *:* binary relationship types: this is optional. If you haven’t removed *:* in
previous step (step 1), you have to do this. In here a separate table is
created.
viii. Complex relationship types: this is also optional. Creating a separate table
is the solution.
ix. Multi-valued attributes: creating a separate table.
3. Validation and normalization
4. Creating global logical data model by combining local logical data models.
Download