Presentation is loading. Please wait.

Presentation is loading. Please wait.

BACS 485 Normalization. Data Anomalies WORKER (WORKER-ID, NAME, SKILL-TYPE, SUPV-ID, BLD-ID) WORKER-IDNAMESKILL-TYPESUPV-IDBLD-ID 1235M. FaradayElectric1311312.

Similar presentations


Presentation on theme: "BACS 485 Normalization. Data Anomalies WORKER (WORKER-ID, NAME, SKILL-TYPE, SUPV-ID, BLD-ID) WORKER-IDNAMESKILL-TYPESUPV-IDBLD-ID 1235M. FaradayElectric1311312."— Presentation transcript:

1 BACS 485 Normalization

2 Data Anomalies WORKER (WORKER-ID, NAME, SKILL-TYPE, SUPV-ID, BLD-ID) WORKER-IDNAMESKILL-TYPESUPV-IDBLD-ID 1235M. FaradayElectric M. FaradayElectric C. NemoPlumbing C. NemoPlumbing C. NemoPlumbing C. NemoPlumbing C. CoulombElectric--435

3 Normalization Process

4 0NF ORDERS(ORDER-NUM, ORDER-DATE, {PART-NUM, PART-DESC, QTY-ORD, PRICE}) ORDER- NUM ORDER- DATE PART-NUMPART-DESCQTY- ORD PRICE AX12Washer BT04 AX12 Dryer Washer CB03Sink CX11Mixer AZ52 BA74 Skates Basketball

5 1NF ORDERS(ORDER-NUM, ORDER-DATE, PART-NUM, PART-DESC, QTY-ORD, PRICE) ORDER- NUM ORDER- DATE PART- NUM PART-DESCQTY-ORDPRICE AX12Washer BT04Dryer AX12Washer CB03Sink CX11Mixer AZ52Skates BA74Basketball149

6 1NF ORDERS(ORDER-NUM, ORDER-DATE, PART-NUM, PART-DESC, QTY-ORD, PRICE) ORDER-NUM, PART-NUM ---> QTY-ORD ORDER-NUM ---> ORDER-DATE PART-NUM ---> PART-DESC, PRICE

7 ORDER-NUMORDER-DATE PART-NUMPART-DESCPRICE AX12Washer699 BT04Dryer450 CB03Sink150 CX11Mixer95 AZ52Skates169 BA74Basketball49 ORDER-NUMPART-NUMQTY-ORD 12489AX BT AX CB CX AZ BA741 ORDERS (ORDER-NUM, ORDER-DATE) PART (PART-NUM, PART-DESC, PRICE) ORDER-LINE (ORDER-NUM, PART-NUM, QTY-ORD) 2NF Orders Part Order_Line

8 CUSTOMER (CUST-NUM, CUST-NAME, CUST-ADDR, SALES-NUM, SALES ‑ NAME) 3NF Problems CUST-NUMCUST-NAMECUST-ADDRSALES-NUMSALES- NAME 124S. Adams123 Oak St.3M. Jones 256A. Samuels456 Elm St.6W. Smith 311C. Don48 College Ave.12S. Brown 315T. Daniels519 Cherry St.6W. Smith 405A. Williams16 Watson Rd.12S. Brown Customer CUST-NUM ---> CUST-NAME, CUST-ADDR, SALES-NUM, SALES-NAME SALES-NUM ---> SALES-NAME

9 3NF Problems CUST-NUM ---> CUST-NAME, CUST-ADDR, SALES-NUM, SALES-NAME SALES-NUM ---> SALES-NAME

10 CUST-NUMCUST-NAMECUST-ADDRSALES-NUM 124S. Adams123 Oak St.3 256A. Samuels456 Elm St.6 311C. Don48 College Ave T. Daniels519 Cherry St.6 405A. Williams16 Watson Rd.12 SALES-NUMSALES-NAME 3M. Jones 6W. Smith 12S. Brown CUSTOMER (CUST-NUM, CUST-NAME, CUST-ADDR, SALES-NUM) SALES-REP (SALES-NUM, SALES-NAME) 3NF

11 NAMEDEPTOFFICERANKDATE- HIRED SmithCISB-20Instructor JonesMUSICM-15Professor HenryMUSICM-13Assist. Professor FrankCHEMC-17Assoc. Professor BC/NF Problem FACULTY (NAME, DEPT, OFFICE, RANK, DATE-HIRED) OFFICE ---> DEPT NAME, DEPT ---> OFFICE, RANK, DATE-HIRED NAME, OFFICE ---> DEPT, RANK, DATE-HIRED

12 OFFICE ---> DEPT NAME, DEPT ---> OFFICE, RANK, DATE-HIRED NAME, OFFICE ---> DEPT, RANK, DATE-HIRED BC/NF Problem

13 BC/NF Solution FAC-LOC (OFFICE, DEPT) FACULTY (NAME, OFFICE, RANK, DATE-HIRED) The NAME,OFFICE candidate key was chosen as the primary key because the NAME,DEPT candidate key would not be in BCNF. In fact, it would not even be in 2NF since there would be a partial dependency between OFFICE and DEPT.

14 FACULTY (FAC-ID, {STU-ID}, {COMMITTEE-CODE}) FAC-IDSTU-IDCOMMITTEE-CODE ADV PER HSG CUR HSG 0NF Relation

15 FACULTY (FAC-ID, STU-ID, COMMITTEE-CODE) FAC-IDSTU-IDCOMMITTEE-CODE ADV ADV PER PER HSG HSG CUR CUR CUR HSG Normalized? FAC-NAME --->> STU-ID FAC-NAME --->> COMMITTEE-CODE

16 FAC-STU (FAC-ID, STU-ID) FAC-COMM (FAC-ID, COMMITTEE-CODE) FAC-IDSTU-ID FAC-IDCOMMITTEE-CODE 123ADV 123PER 123HSG 456CUR 444HSG 5NF

17 Normalization “Rules” 0NF to 1NF – Remove repeating groups 1NF to 2NF – Remove partial functional dependencies 2NF to 3NF – Remove transitive dependencies 3NF to BC/NF – Every determinate is a candidate key BC/NF to 4NF – Remove multi-valued dependencies 4NF to 5NF – Remove join dependencies DK/NF – Every constraint is a consequence of domain and key constraints


Download ppt "BACS 485 Normalization. Data Anomalies WORKER (WORKER-ID, NAME, SKILL-TYPE, SUPV-ID, BLD-ID) WORKER-IDNAMESKILL-TYPESUPV-IDBLD-ID 1235M. FaradayElectric1311312."

Similar presentations


Ads by Google