Download presentation
Presentation is loading. Please wait.
1
Mapping of N:M Relationships PERSON-ID TITLE PERSON-NAME DATE-OF-BIRTH PERSON-ID PROJECT-ID HOURS-SPENT PROJECT-ID END-DATE START-DATE E-R Diagram PERSON WORK_ON PROJECT PERSON-ID TITLE PERSON-NAME DATE-OF-BIRTH PERSON-ID PROJECT-ID HOURS-SPENT PROJECT-ID END-DATE START-DATE N M Network Data Model PERSON PERSON-ID WORK_ON PROJECT-ID PROJECT
2
Mapping of 1:N Relationships PERSON-ID NAME DEPT-ID TIME-STARTED DEPT-ID BUDGET E-R Diagram PERSON WORKS_IN DEPT PERSON-ID NAME PERSON-ID DEPT-ID TIME-STARTED DEPT-ID BUDGET N 1 Network Data Model PERSON DEPT-ID DEPARTMENT (1,1) (0,N)
3
ER-to-Relational Mapping 1. For each regular or weak entity type create a relation. 2. For each 1:1 relationship type identify relations that correspond to participating entity types. Choose one of the relations and include as its foreign key the primary key of the other relation. 3. For each 1:N relationship type identify the relation that represents the participating entity type at the many side. Include as foreign key the primary key of the other entity type.
4
ER-to-Relational Mapping (cont.) 4. For each M:N relationship type create a new relation to represent it. 6. For each n-ary relationship type create a new relation.
5
Meeting Required Integrity Constraints v All primary keys defined as NOT NULL v Foreign keys: [ 1:M relationships Y primary key of the “one” side becomes foreign key of the “many” side Y foreign key constraints depend on participation [ mandatory (total): NOT NULL ON DELETE RESTRICT ON UPDATE CASCADE [ optional (partial): NULL ALLOWED ON DELETE SET NULL ON UPDATE CASCADE [ week entity Y primary key of the parent table is included in the weak entity’s composite key Y foreign key constraints [ NOT NULL ON DELETE CASCADE ON UPDATE CASCADE
6
v Foreign keys (cont.): [ M:N relationships: Y a composite (bridge) entity is introduced containing at least primary keys of both parent entities Y this composite key is subject to the NOT NULL restriction [ 1:1 relationships: Y integration of both entities (?) Meeting Required Integrity Constraints (cont.)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.