Normalizing Database Designs. 2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design.

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
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
BTM 382 Database Management Chapter 6: Normalization of Database Tables Chitu Okoli Associate Professor in Business Technology Management John Molson School.
DBS201: Introduction to Normalization
1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Chapter 5 Normalization of Database Tables
Normalization of Database Tables Special adaptation for INFS-3200
Normalization of Database Tables
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
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Week 6 Lecture Normalization
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
Text & Original Presentations
Avoiding Database Anomalies
Database Systems: Design, Implementation, and Management Tenth Edition
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.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
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 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Database Design – Lecture 8
Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management Peter Rob & Carlos Coronel.
Database Principles: Fundamentals of Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables Carlos Coronel, Steven.
Normalization of Database Tables
In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Chapter Three ( Relational Data Model) Objectives Introduction to Relational Data Models. Advantages of Relational Data Models. Restriction of Relational.
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.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.
Database Systems, 8 th Edition Improving the Design Table structures cleaned up to eliminate initial partial and transitive dependencies Normalization.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
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 9 Normalizing Database Designs
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:

Normalizing Database Designs

2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design process –About the normal forms 1NF, 2NF, 3NF

Database Tables and Normalization Normalization –Process for evaluating and correcting table structures to minimize data redundancies Reduces data anomalies –Series of stages called normal forms: First normal form (1NF) Second normal form (2NF) Third normal form (3NF) 3

Database Tables and Normalization (cont’d.) 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 Denormalization produces a lower normal form –Increased performance but greater data redundancy 4

The Need for Normalization Example: company that manages building projects –Charges its clients by billing hours spent on each contract –Hourly billing rate is dependent on employee’s position –Periodically, report is generated that contains information such as displayed in Table 6.1 5

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 6

The Need for Normalization (cont’d.) Structure of data set in Figure 6.1 does not handle data very well Table structure appears to work; report is generated with ease Report may yield different results depending on what data anomaly has occurred Relational database environment is suited to help designer avoid data integrity problems 7

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

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 9

10 The Normalization Process (cont’d.) Objective of normalization is to ensure that all tables are in at least 3NF Higher forms are not likely to be encountered in business environment Normalization works one relation at a time Progressively breaks table into new set of relations based on identified dependencies

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 11 Functional Dependency Functional dependency is a relationship that exists when one attribute uniquely determines another attribute. If R is a relation with attributes X and Y, a functional dependency between the attributes is represented as X->Y, which specifies Y is functionally dependent on X. Here X is a determinant set and Y is a dependent attribute. Each value of X is associated precisely with one Y value.

Partial Dependency –non-key attribute of a table in a database is dependent on the value of only a part of the table’s primary key but not the entire primary key. Example: Given a relation R(A,B,C,D,E), Functional Dependency : AB→CDE, Primary_key(or simply 'key') is AB. Then A→C : is a Partial Dependency A→D : is a Partial Dependency A→E : is a Partial Dependency B→C : is a Partial Dependency B→D : is a Partial Dependency B→E : is a Partial Dependency 12

Transitive Dependency If the value in a non-key attribute is determined by the value in another non-key attribute then that field has transitive dependency. For example, look at the relation below: The attribute teacher_name is determined by the non-key attribute teacher_id, and not the primary key of course_id. This means that teacher_name is transitively dependent on the primary key of course_id.

Conversion to First Normal Form Repeating group –Group of multiple entries of same type can 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 14

Conversion to First Normal Form (cont’d.) 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 are depicted with a diagram 15

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 16

Conversion to First Normal Form (cont’d.) Dependency diagram: –Depicts all dependencies found within given table structure –Helpful in getting bird’s-eye view of all relationships among table’s attributes –Makes it less likely that you will overlook an important dependency 17

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 18

Conversion to First Normal Form (cont’d.) First normal form describes tabular format: –All key attributes are defined –No repeating groups in the table –All attributes are dependent on primary key All relational tables satisfy 1NF requirements Some tables contain partial dependencies –Dependencies are based on part of the primary key –Should be used with caution 19

Conversion to Second Normal Form Step 1: Make New Tables to Eliminate Partial Dependencies –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: Reassign Corresponding Dependent Attributes –Determine attributes that are dependent on other attributes –At this point, most anomalies have been eliminated 20

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 21

Conversion to Second Normal Form (cont’d.) 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 22

Conversion to Third Normal Form Step 1: Make New Tables to Eliminate Transitive Dependencies –For every transitive dependency, write its determinant as PK for new table –Determinant: any attribute whose value determines other values within a row 23

Conversion to Third Normal Form (cont’d.) Step 2: Reassign Corresponding Dependent Attributes –Identify attributes dependent on each determinant identified in Step 1 Identify dependency –Name table to reflect its contents and function 24

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 25

Conversion to Third Normal Form (cont’d.) A table is in third normal form (3NF) when both of the following are true: –It is in 2NF –It contains no transitive dependencies 26

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 27

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 28

Denormalization Creation of normalized relations is important database design goal Processing requirements should also be a goal If tables are decomposed to conform to normalization requirements: –Number of database tables expands 29

Denormalization (cont’d.) Joining the larger number of tables reduces system speed Conflicts are often resolved through compromises that may include denormalization Defects of unnormalized tables: –Data updates are less efficient because tables are larger –Indexing is more cumbersome –No simple strategies for creating virtual tables known as views 30

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 31