Download presentation
Presentation is loading. Please wait.
Published byMaximilian Walsh Modified over 9 years ago
1
Database Design – Lecture 9 Normalization Continued
2
2 Lecture Objectives Review of 1NF, 2NF, 3NF Normalization: Boyce-Codd Normal Form Long Descriptions
3
3 Normalization Steps 1NF All key attributes are defined No repeating groups All attributes are functionally dependent on the primary key 2NF Table is in 1NF No partial dependencies
4
4 Normalization Steps 3NF Table is in 2NF No transitive dependencies
5
5 Boyce-Codd Normal Form (BCNF) If a non key attribute is the determinate of a key attribute, then the table is not in BCNF. A determinant is any attribute whose value directly affects and determines other values within a row. A 3NF table with one candidate key is already in BCNF If a key attribute is the determinate of a key attribute, then the table is not in BCNF.
6
6 3NF Table Not in BCNF ABcdABcd 1NF Table is not in BCNF because attribute c (a non-key attribute) can identify attribute B (which is part of the primary key) To put table into BCNF, make c a primary key and make B an attribute. You revert to 2NF ABcdABcd 2NF ?
7
7 3NF Table Not in BCNF AcBdAcBd 1NF Partial dependency exists on attribute C of the composite primary key AcBdAcBd 2NF
8
8 3NF Table Not in BCNF Write each key component on separate line, then write dependent attributes after each key. AcBdAcBd 2NF 1NF: TABLE1 (A(PK), c(PK), B, d) 2NF: TABLE2 (c(PK), B) TABLE1 (A(PK), c(PK, FK), d) 1NF
9
9 BCNF Example
10
10 Long Descriptoins As a general rule, a description type field in a table is variable in length For example: UNIT NUM SIZE (SQ FEET) NUM BEDROOMS NUM BATHROOMS VIEW DESCRIPTION 12086011West view 12194021Direct south view over busy street 122100022Corner unit facing south west overlooking major intersection 12360011View of lake
11
11 Long Descriptions To avoid defining a field of such variable length in a table, create a new table to hold just the description PK of new table will be FK in original table and it will be a 1:1 relationship CONDO (UNIT_NUM (PK), SQ_FT, NUM_BEDRS, NUM_BATHS, DESC_ID (FK)) CONDO_DESC (DESC_ID (PK), VIEW DESCRIPTION)
12
12 Normalization Steps 1NF All key attributes are defined No repeating groups All attributes are functionally dependent on the primary key 2NF Table is in 1NF No partial dependencies
13
13 Normalization Steps 3NF Table is in 2NF No transitive dependencies BCNF Table is in 3NF No key attributes dependent on a non-key attribute
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.