Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 3630 Database Design and Implementation

Similar presentations


Presentation on theme: "CS 3630 Database Design and Implementation"— Presentation transcript:

1 CS 3630 Database Design and Implementation

2 Unnormalized Form (UNF)
student courses Mike Rowe CS3630 CS3340 CS3230 Multi-Value attribute Common in reports 2NF and 3NF could be in one note.

3 First Normal Form (1NF) No multi-value attributes
Done when mapping E-R model to relational schema DBDL

4 Second Normal Form (2NF)
A relation R is in 1NF, and every non-primary-key attribute is fully functionally dependent on the primary key Then R is in 2NF No Partial FDs on the PK.

5 Example Relation R (A, B, C, D, E, F) PK: A, B AK: None FK: None
Functional Dependencies: A, B  All A  C B  E, F

6 Table Instance A B C D E F 1 x 10 100 cs se 1 y 10 200 cs ee
Functional Dependencies: A, B  All A  C B  E, F

7 In 2NF? Relation R (A, B, C, D, E, F) PK: A, B AK: None FK: None
Functional Dependencies: A, B  All A  C B  E, F

8 How Many Tables Relation R (A, B, C, D, E, F) PK: A, B AK: None
FK: None Functional Dependencies: A, B  All A  C B  E, F

9 Decomposing Tables into 2NF
Which attributes go to new tables? Which attributes stay in the original table? What is the PK? Which tables have the FK? How many records each table should have?

10 Decompose table R into 2NF
R (A, B, C, D, E, F) Functional Dependencies: A, B  All A  C B  E, F R1 (A, C) PK: A AK: None FK: ? FDs: A  C R2 (B, E, F) PK: B B  E, F R (A, B, D) PK: A, B A, B  D

11 Decompose table R into 2NF
R (A, B, C, D, E, F) Functional Dependencies: A, B  All A  C B  E, F R1 (A, C) PK: A AK: None FK: None FDs: A  C R2 (B, E, F) PK: B B  E, F R (A, B, D) PK: A, B FK: A references R1 B references R2 A, B  D

12 Table Instance R A B C D E F 1 x 10 100 cs se 1 y 10 200 cs ee
A B D x y x y R1 A C R2 B E F x cs se y cs ee

13 Schedule Assignment 6-1 Due Thursday, March 1 At 5 PM Quiz 2 Wednesday, March 7 Covers A4 and A51, A61

14 Assignment 5-2 Due Monday, March 5 At 5 PM


Download ppt "CS 3630 Database Design and Implementation"

Similar presentations


Ads by Google