Database Tables and Normalization

Slides:



Advertisements
Similar presentations
Normalization of Database Tables
Advertisements

Chapter 5 Normalization of Database Tables
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
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
Need for Normalization
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
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.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design 1: Normalization.
NORMALIZATION N. HARIKA (CSC).
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
Chapter 5 Normalization of Database Tables
Week 6 Lecture Normalization
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z. Yang Course Website: 3220m.htm
Avoiding Database Anomalies
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.
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.
Logical Database Design Relational Model. Logical Database Design Logical database design: process of transforming conceptual data model into a logical.
Database Design – Lecture 8
Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management Peter Rob & Carlos Coronel.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
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.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
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 Normalization of Database Tables. 5 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures to minimize.
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.
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 6 Normalization of Database Tables
Normalization A337.
Normalization of Database Tables Uploaded by: mysoftbooks.ml
Normalization of DB relations examples Fall 2015
DATABASE DESIGN & DEVELOPMENT
Review of Week 3 Relation Transforming ERD into Relations
Presentation transcript:

Database Tables and Normalization Normalization is a process for assigning attributes to entities. It reduces data redundancies and helps eliminate the data anomalies. Normalization works through a series of stages called normal forms: First normal form (1NF) Second normal form (2NF) Third normal form (3NF) The highest level of normalization is not always desirable.

Database Tables and Normalization The Need for Normalization Case of a Construction Company Building project -- Project number, Name, Employees assigned to the project. Employee -- Employee number, Name, Job classification The company charges its clients by billing the hours spent on each project. The hourly billing rate is dependent on the employee’s position. Periodically, a report is generated as shown in Table 5.1. The table whose contents correspond to the reporting requirements is shown in Database Table 5.1.

Database Tables and Normalization Problems with the Table 5.1 The project number is intended to be a primary key, but it contains nulls. The table displays data redundancies. The table entries invite data inconsistencies. The data redundancies yield the following anomalies: Update anomalies. Addition anomalies. Deletion anomalies.

Database Tables and Normalization Conversion to First Normal Form A relational table must not contain repeating groups. Repeating groups can be eliminated by adding the appropriate entry in at least the primary key column(s). (See Database Table 5.3) Database Table 5.2 The Evergreen Data

Database Tables and Normalization Database Table 5.3 Data Organization: First Normal Form

Database Tables and Normalization Dependency Diagram The arrows above the entity indicate that the entity’s attributes are dependent on the combination of PROJ_NUM and EMP_NUM. The arrows below the dependency diagram indicate less desirable dependencies based on only a part of the primary key -- partial dependencies. Figure 5.1 A Dependency Diagram: First Normal Form

Database Tables and Normalization 1NF Definition The term first normal form (1NF) describes the tabular format in which: All the key attributes are defined. There are no repeating groups in the table. All attributes are dependent on the primary key.

Database Tables and Normalization Conversion to Second Normal Form Starting with the 1NF format, the database can be converted into the 2NF format by Writing each key component on a separate line, and then writing the original key on the last line and Writing the dependent attributes after each new key. PROJECT (PROJ_NUM, PROJ_NAME) EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS, CHG_HOUR) ASSIGN (PROJ_NUM, EMP_NUM, HOURS)

Database Tables and Normalization 2NF Definition A table is in 2NF if: It is in 1NF and It includes no partial dependencies; that is, no attribute is dependent on only a portion of the primary key. Note: It is still possible for a table in 2NF to exhibit transitive dependency; that is, one or more attributes may be functionally dependent on nonkey attributes.

Database Tables and Normalization Conversion to Third Normal Form Create a separate table with attributes in a transitive functional dependence relationship. PROJECT (PROJ_NUM, PROJ_NAME) ASSIGN (PROJ_NUM, EMP_NUM, HOURS) EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS) JOB (JOB_CLASS, CHG_HOUR)

Normalization and Database Design Figure 5.8 The Modified E-R Diagram for a Contacting Company

Normalization and Database Design Creation of the Composite Entity ASSIGN Figure 5.9 The Final (Implementable) E-R Diagram for the Contracting Company

Normalization and Database Design Attribute ASSIGN_HOUR is assigned to the composite entity ASSIGN. “Manages” relationship is created between EMPLOYEE and PROJECT. PROJECT (PROJ_NUM, PROJ_NAME, EMP_NUM) EMPLOYEE (EMP_NUM, EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_HIREDATE, JOB_CODE) JOB (JOB_CODE, JOB_DESCRIPTION, JOB_CHG_HOUR) ASSIGN (ASSIGN_NUM, ASSIGN_DATE, PROJ_NUM, EMP_NUM, ASSIGN_HOURS)

Normalization and Database Design Figure 5.10 The Relational Schema for the Contracting Company

Higher-Level Normal Forms 4NF Definition A table is in 4NF if it is in 3NF and has no multiple sets of multivalued dependencies. Version 1 10123 Red Cross 1 10123 United Way 5 10123 12 Version 2 10123 Red Cross 10123 United Way 10123 1 10123 5 10223 12 Version 3 Database Table 5.4 Tables with Multivalued Dependencies 10123 Red Cross 1 10123 Red Cross 5 10123 United Way 12

Higher-Level Normal Forms Database Table 5.5 A Set of Tables in 4NF

Denormalization Normalization is only one of many database design goals. Normalized (decomposed) tables require additional processing, reducing system speed. Normalization purity is often difficult to sustain in the modern database environment. The conflict between design efficiency, information requirements, and processing speed are often resolved through compromises that include denormalization. 32