Download presentation

Presentation is loading. Please wait.

Published byChristine Bugg Modified over 4 years ago

1
BACS485 – E/R to Relational Notation1 BACS 485 Translating E/R to Relational Notation

2
BACS485 – E/R to Relational Notation2 Relational Notation Relational Notation is a shorthand way to represent E/R diagrams. It is a half-way step between an abstract tool (i.e., E/R diagrams) and an implementation specific tool (i.e., SQL Create Table commands). The format is as follows: Table-name(key-attribute, attribute-1,… attribute-N)

3
BACS485 – E/R to Relational Notation3 Relational Notation The basic rules of translating E/R diagrams to Relational Notation are given below: l Each entity becomes a table l Each attribute on the table becomes an attribute on the table l Primary keys are underlined l Foreign keys are underlined with a dashed line l In 1:1, the foreign key can be on either side of the relation (context dependent) l In 1:N, the foreign key goes on the N side l In M:N, the relation becomes a table and the key for the new table is the concatenated primary keys of the original tables l In sub-type/super-type, the primary key of the sub-type(s) is the same as the super-type (thus, no foreign key)

4
BACS485 – E/R to Relational Notation4 1:1 E/R to Relational Notation l Translates to 2 tables: Table1 (A,B,C,D) OR Table1 (A,B,C) Table2 (D,E,F) Table2 (D,E,F,A) pick one depending upon context, dashed underlined letter is foreign key

5
BACS485 – E/R to Relational Notation5 1:1 Relational Notation to E/R l Translate from 2 tables: Table1 (X,Y,Z) OR Table1 (X,Y,Z,L) Table2 (L,M,N,X) Table2 (L,M,N) pick one depending upon context, dashed underlined letter is foreign key

6
BACS485 – E/R to Relational Notation6 1:N E/R to Relational Notation l Translates to 2 tables: Table1 (A,B,C) Table2 (D,E,F,A) dashed underlined letter is foreign key

7
BACS485 – E/R to Relational Notation7 1:N Relational Notation to E/R l Translate from 2 tables: Table1 (X,Y,Z,L) Table2 (L,M,N) dashed underlined letter is foreign key

8
BACS485 – E/R to Relational Notation8 Simple M:N E/R to Relational Notation l Translates to 3 tables: Table1 (A,B,C) Table2 (D,E,F) Table3 (A,D) Notice that there is no foreign key

9
BACS485 – E/R to Relational Notation9 Simple M:N Relational Notation to E/R l Translate from 3 tables: Table1 (X,Y,Z) Table2 (L,M,N) Table3 (X,L)

10
BACS485 – E/R to Relational Notation10 More Complex M:N E/R to Relational Notation l Translates to 3 tables: Table1 (A,B,C) Table2 (D,E,F) Table3 (A,D,X) Notice that relationship attribute is attached to new table

11
BACS485 – E/R to Relational Notation11 More Complex M:N Relational Notation to E/R l Translate from 3 tables: Table1 (X,Y,Z) Table2 (L,M,N) Table3 (X,L,P)

12
BACS485 – E/R to Relational Notation12 More Complex M:N E/R to Relational Notation l Translates to 3 tables: Table1 (A,B,C) Table2 (D,E,F) Table3 (A,D,X) Notice that relationship attribute is attached to new table

13
BACS485 – E/R to Relational Notation13 More Complex M:N E/R to Relational Notation l Translates to 4 tables: Table1 (A,B,C) Table2 (D,E,F) Table3 (H,I,J) Table4 (A,D,H,K)

14
BACS485 – E/R to Relational Notation14 Sub-Type / Super-Type E/R to Relational Notation l Translates to 3 tables: Table1 (A,B,C) Table2 (A,D,E,F) Table3 (A,H,I,J) Notice that Table2 and Table3 do not have a key in the E/R.

Similar presentations

OK

Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.

Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.

© 2018 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google