Download presentation
Presentation is loading. Please wait.
1
E-R DIAGRAMS TO RELATIONAL SCHEMA
2
Three Rules For each entity create a table; include the attributes of the entity as fields of the table; be sure to designate a primary key. For each (1:M) relation take the PK from the one-side table and embed it in the many-side table and designate it as a foreign key. For each (M:N) relation create a new table. The PK’s of the two table involved in the relation should be made fields of this table and their combination may be the PK of the new table. In addition each of those PK’s are FK’s pointing at the corresponding tables from which they came. Appropriate other attributes may be included in this table.
3
(1:M) Relation E1 A1a A1b E2 A2a A2b t1 C1a PK C1b t2 C2a PK C2b
C1a FK C1a C1b 1 Phillies 2 Eagles C2a C2b C1a 1 Mike 2 Chooch 3 Doc
4
(N:M) Relation E1 A1a A1b E2 A2a A2b t1_t2 C1a PK FK C2a PK FK t2
C2b t1 C1a PK C1b C1a C2a 1 2 3 C2a C2b 1 CSC240-21 2 HIS201-01 3 MTH120-12 C1a C1b 1 John 2 Mary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.