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

Slides:



Advertisements
Similar presentations
Chapter Three Objectives Identification of Keys Application of primary and foreign keys Converting a database design to Relational DB. What is a good DBMS.
Advertisements

PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Announcements Read 5.1 – 5.5 for today Read 5.6 – 5.7 for Wednesday Project Step 3, due Monday 10/18 Homework, due Friday 10/15 – by Research paper,
Normalization What is Normalization? Normalization Levels –First Normal Form –Second Normal Form –Third Normal Formal Referential Integrity.
4/30/2015 Database Design:Normalization. 4/30/2015 Functional Dependence An attribute (column) B, is functionally dependent on another attribute A if.
Order Entry System Please use speaker notes for additional information!
DBS201: Merging 3NF Tables Lecture 7.
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5.
Information Resources Management March 13, Agenda n Administrivia n Normalization n Homework #7 n Mid-Term #2.
Normalization A technique for identifying table structures that have potential maintenance problems.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
CS263:Revision on Normalisation
Normalization of Database Tables
Test 1 Review. What’s wrong with this table? ItemNoType InitialCost RepairNo Date RepairCost 100Drill Press /5/ Lathe /7/06.
Part ( PartNum, Description, OnHand, Class, Warehouse, Price,
Normalization A technique for identifying table structures that have potential maintenance problems.
Database Design: Normalization
Chapter 3 The Relational Model and Normalization
DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design.
Lecture 12 Inst: Haya Sammaneh
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
(C) 2000, The University of Michigan 1 Database Application Design Handout #4 January 28, 2000.
Fundamentals, Design, and Implementation, 9/e. Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/2 Copyright.
This presentation prepared for MIS 421 / MBA 575 at Western Washington University. Material in this presentation drawn from Richard T. Watson, Data Management:
Normalization A technique for identifying table structures that have potential maintenance problems.
Avoiding Database Anomalies
Chapter 4 The Relational Model and Normalization.
Concepts of Database Management Sixth Edition Chapter 5 Database Design 1: Normalization.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Announcements Read 5.8 – 5.13 for Monday Project Step 3, due Monday 10/18 Homework 4, due Friday 10/15 – by (or turn in Monday in class)
1 A Guide to MySQL 2 Database Design Fundamentals.
Objectives of Normalization Develop a good description of the data, its relationships and constraints Produce a stable set of relations that Is a faithful.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
Chapter 5: Normalizing the DB. What to do with a bad database structure? How do we determine the right structure? How do we determine primary keys? Normalization.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, Modified by Dr. Mathis 3-1 David M. Kroenke’s Chapter Three: The Relational.
The Relational Model and Normalization The Relational Model Normalization First Through Fifth Normal Forms Domain/Key Normal Form The Synthesis of Relations.
Normalization of Database Lecture - ANS Yong Choi School of Business CSUB.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Normalization Ioan Despi 2 The basic objective of logical modeling: to develop a “good” description of the data, its relationships and its constraints.
Further Normalization I
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
Customer Order Order Number Date Cust ID Last Name First Name State Amount Tax Rate Product 1 ID Product 1 Description Product 1 Quantity Product 2 ID.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
ABSTRACT OF FIRST LECTURE then … the second lesson.
Data Analysis Improving Database Design. Normalization The process of transforming a data model into a flexible, stable structure. Reduces anomalies Anomaly.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
DATA NORMALIZATION CS 260 Database Systems. Overview  Introduction  Anomalies  Functional dependence  Normal forms  1NF  2NF  3NF  BCNF  Denormalization.
PMIT-6102 Advanced Database Systems
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
CREATE TABLE Customer (CustNo number, CustName text (15), CustAddr text (30), Balance number, CredLim number, SLSRNo text (3), CONSTRAINT SPIndex PRIMARY.
Databases Illuminated Chapter 6 Normalization. Objectives of Normalization Develop a good description of the data, its relationships and constraints Produce.
Databases Illuminated
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 5 Part II.
IT-501 Database Management Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
1 First Normal Form (1NF) Unnormalized table : Contains a repeating group –Eg: from multi-valued attributes –Eg: from many-many relationship Table in 1NF:
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 4: PART C LOGICAL.
Normal Forms 1NF – A table that qualifies as a relation is in 1NF. (Back)(Back) 2NF – A relation is in 2NF if all of its nonkey attributes are dependent.
Normalization Practice & Solutions
A Guide to SQL, Eighth Edition
Announcements Read 5.1 – 5.5 for today Read 5.6 – 5.7 for Wednesday
Normalization – Part II
Database Normalization.
Chapter 4 The Relational Model and Normalization
Chapter 14 Normalization Pearson Education © 2009.
Database Management System
Presentation transcript:

BACS 485 Normalization

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

Normalization Process

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

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

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

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

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

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

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

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

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

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.

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

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

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

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