Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.

Slides:



Advertisements
Similar presentations
Normalization of Database Tables
Advertisements

Chapter 5 Normalization of Database Tables
Database Tables and Normalization
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
DBS201: Introduction to Normalization
Chapter 5 Normalization of Database Tables
Normalization of Database Tables Special adaptation for INFS-3200
Normalization of Database Tables
Need for Normalization
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design: Normalization.
Normalization of Database Tables
4 Chapter 4 Normalization Hachim Haddouti. 4 Hachim Haddouti, CH4, see also Rob & Coronel 2 In this chapter, you will learn: What normalization is and.
Normalization of Database Tables
Normalization of Database Tables
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 5 Normalization of Database Tables
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Normalization A337. A337 - Reed Smith2 Structure What is a database? ◦ Tables of information  Rows are referred to as records  Columns are referred.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
NORMALIZATION N. HARIKA (CSC).
Chapter 5 Normalization of Database Tables
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Database Systems: Design, Implementation, and Management Tenth Edition
Concepts of Database Management Sixth Edition Chapter 5 Database Design 1: Normalization.
Concepts of Database Management, Fifth Edition
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
The Relational Model and Normalization R. Nakatsu.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Database Design – Lecture 8
Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management Peter Rob & Carlos Coronel.
1 5 Chapter 5 Database Design 1: Some Normalization Examples Spring 2006.
Database Principles: Fundamentals of Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables Carlos Coronel, Steven.
Normalization of Database Tables
A337 - Reed Smith1 Structure What is a database? –Table of information Rows are referred to as records Columns are referred to as fields Record identifier.
Chapter 4 Normalization of Database Tables. 2 Database Tables and Normalization Table is basic building block in database design Table is basic building.
E-R Modeling: Table Normalization. Normalization of DB Tables Normalization ► Process for evaluating and correcting table structures determines the optimal.
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
Microsoft Access 2010 Chapter 11 Database Design.
Lecture 4: Logical Database Design and the Relational Model 1.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
5 1 Normalization of Database Tables. 5 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures to minimize.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Logical Database Design and Relational Data Model Muhammad Nasir
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Normalizing Database Designs. 2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design.
Chapter 5: Relational Database Design
Chapter 4: Relational Database Design
Functional Dependencies
Normalization of Database Tables PRESENTED BY TANVEERA AKHTER FOR BCA 2ND YEAR dated:15/09/2015 DEPT. OF COMPUTER SCIENCE.
Chapter 6 Normalization of Database Tables
Normalization A337.
Normalization of Database Tables Uploaded by: mysoftbooks.ml
DATABASE DESIGN & DEVELOPMENT
Review of Week 3 Relation Transforming ERD into Relations
Presentation transcript:

Normalization Example

Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures to minimize data redundancies Reduces data anomalies –Works through a series of stages called normal forms: First normal form (1NF) Second normal form (2NF) Third normal form (3NF)

Normal Forms: Review Unnormalized – There are multivalued attributes or repeating groups 1 NF – No multivalued attributes or repeating groups. 2 NF – 1 NF plus no partial dependencies 3 NF – 2 NF plus no transitive dependencies

Database Systems, 8 th Edition 4 Database Tables and Normalization (continued) Normalization (continued) –2NF is better than 1NF; 3NF is better than 2NF –For most business database design purposes, 3NF is as high as needed in normalization –Highest level of normalization is not always most desirable

5

Database Systems, 8 th Edition 6 The Normalization Process Each table represents a single subject No data item will be unnecessarily stored in more than one table All attributes in a table are dependent on the primary key Each table void of insertion, update, deletion anomalies

Database Systems, 8 th Edition 7 Conversion to First Normal Form Repeating group –Group of multiple entries of same type exist for any single key attribute occurrence Relational table must not contain repeating groups Normalizing table structure will reduce data redundancies Normalization is three-step procedure

Database Systems, 8 th Edition 8 Conversion to First Normal Form (continued) Step 1: Eliminate the Repeating Groups –Eliminate nulls: each repeating group attribute contains an appropriate data value Step 2: Identify the Primary Key –Must uniquely identify attribute value –New key must be composed Step 3: Identify All Dependencies –Dependencies depicted with a diagram

Database Systems, 8 th Edition 9 Conversion to Second Normal Form Step 1: Write Each Key Component on a Separate Line –Write each key component on separate line, then write original (composite) key on last line –Each component will become key in new table Step 2: Assign Corresponding Dependent Attributes –Determine those attributes that are dependent on other attributes –At this point, most anomalies have been eliminated

Database Systems, 8 th Edition 10 Conversion to Second Normal Form (continued) Table is in second normal form (2NF) when: –It is in 1NF and –It includes no partial dependencies: No attribute is dependent on only portion of primary key

Partial Dependency Partial Dependency – when an non-key attribute is determined by a part, but not the whole, of a COMPOSITE primary key. Partial Dependency

Database Systems, 8 th Edition 12 Conversion to Third Normal Form Step 1: Identify Each New Determinant –For every transitive dependency, write its determinant as PK for new table –Determinant: any attribute whose value determines other values within a row Step 2: Identify the Dependent Attributes –Identify attributes dependent on each determinant identified in Step 1 Identify dependency –Name table to reflect its contents and function

Database Systems, 8 th Edition 13 Conversion to Third Normal Form (continued) Step 3: Remove the Dependent Attributes from Transitive Dependencies –Eliminate all dependent attributes in transitive relationship(s) from each of the tables –Draw new dependency diagram to show all tables defined in Steps 1–3 –Check new tables as well as tables modified in Step 3 Each table has determinant No table contains inappropriate dependencies

Database Systems, 8 th Edition 14 Conversion to Third Normal Form (continued) A table is in third normal form (3NF) when both of the following are true: –It is in 2NF –It contains no transitive dependencies

Transitive Dependency Transitive Dependency – when a non-key attribute determines another non-key attribute. Transitive Dependency

You are given a spreadsheet that contains information about a private airline company that provides chartered flights to clients. The spreadsheet has been turned into 1NF by removing the repeating groups and choosing a composite primary key. You need to conduct normalization up to 3NF. 1NF: (CHAR_TRIP, CHAR_DATE, CHAR_CITY, CHAR_MILES, CUST_NUM, CUST_LNAME, CHAR_PAX, CHAR_CARGO, PILOT, COPILOT, FLT_ENGINEER, LOAD_MASTER, SEAT_NUMBER, MODEL_CODE, MODEL_SEATS, MODEL_CHG_MILE) What is the composite primary key? Now write down the partial dependencies and the transitive dependencies. 16

Partial Dependencies CHAR_TRIP → CHAR_DATE, CHAR_CITY, CHAR_MILES, CHAR_PAX, CHAR_CARGO, PILOT, COPILOT, FLT_ENGINEER, LOAD_MASTER, MODEL_CODE, MODEL_SEATS, MODEL_CHG_MILE CUST_NUM → CUST_LNAME CHAR_TRIP, CUST_NUM → SEAT_NUMBER 17

Transitive Dependencies MODEL_CODE → MODEL_SEATS, MODEL_CHG_MILE 18

Remove all partial dependencies to complete 2NF CHARTER(CHAR_TRIP, CHAR_DATE, CHAR_CITY, CHAR_MILES, CHAR_PAX, CHAR_CARGO, PILOT, COPILOT, FLT_ENGINEER, LOAD_MASTER, MODEL_CODE, MODEL_SEATS, MODEL_CHG_MILE) CUSTOMER(CUST_NUM, CUST_LNAME) TICKET(CHAR_TRIP, CUST_NUM, SEAT_NUMBER) (Could also call bridge entity Charter Customer or Customer Charter) 19

Remove all Transitive dependencies to complete 3NF CHARTER(CHAR_TRIP, CHAR_DATE, CHAR_CITY, CHAR_MILES, CHAR_PAX, CHAR_CARGO, PILOT, COPILOT, FLT_ENGINEER, LOAD_MASTER, MODEL_CODE) MODEL(MODEL_CODE, MODEL_SEATS, MODEL_CHG_MILE) Note: CUSTOMER and TICKET table remains the same. Database Systems, 8 th Edition 20