©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

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.
Advanced Data Modeling
Normalisation The theory of Relational Database Design.
Chapter 6 Advanced Data Modelling
The Relational Model System Development Life Cycle Normalisation
Chapter 5 Normalization of Database Tables
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
Normalization of Database Tables
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.
Normalization of Database Tables
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Normalization of Database Tables
Normalization By Albert Lin. 2 Basics Process of efficiently organizing data in a database. Goals Eliminate redundant data Ensure data dependency sensibility.
Normalization of Database Tables
Modern Systems Analysis and Design Third 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.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
NORMALIZATION N. HARIKA (CSC).
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Normalization Quiz Tao Li Grant Horntvedt. 1. Which of the following statements is true: a. Normal forms can be derived by inspecting the data in various.
Chapter 5 Normalization of Database Tables
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Week 6 Lecture Normalization
CSC271 Database Systems Lecture # 30.
Web-Enabled Decision Support Systems
Concepts and Terminology Introduction to Database.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
Database Systems: Design, Implementation, and Management Tenth Edition
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
1 A Guide to MySQL 2 Database Design Fundamentals.
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.
Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
CORE 2: Information systems and Databases NORMALISING DATABASES.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Database Design – Lecture 8
In this session, you will learn to: Map an ER diagram to a table Objectives.
Database Principles: Fundamentals of Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables Carlos Coronel, Steven.
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.
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,
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Lecture 4: Logical Database Design and the Relational Model 1.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
Logical Database Design and Relational Data Model Muhammad Nasir
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
Data Modeling Advanced Concepts Updated 20/4/2015 TMC2034 Database Concept and Design1.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Database Normalization. What is Normalization Normalization allows us to organize data so that it: Normalization allows us to organize data so that it:
Understanding Data Storage
Normalization Karolina muszyńska
Chapter 4 Relational Databases
Review of Week 3 Relation Transforming ERD into Relations
Presentation transcript:

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form (BCNF) Appreciate the need for denormalization

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 2 of 18 Pre-assessment Questions 1.The scenario where a student can do only one project and no other student can do the same project, the relationship between student and project is a ______ relationship. a.One-to-One b.One-to-Many c.Many-to-One d.Many-to-Many 2.Which of the following options is true? a.The primary key of the supertype is the primary key of the subtype. b.The foreign key of the supertype is the primary key of the subtype. c.The primary key of the supertype is the foreign key of the subtype. d.The foreign key of the supertype is the foreign key of the subtype.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 3 of 18 Pre-assessment Questions (Contd..) 3.A candidate key that does not become a primary key is called a(n) ______ key. a.Candidate key b.Foreign key c.Alternate key d.Composite key 4.Which of the following problems arise when a primary key is allowed NULL values? a.It becomes difficult to identify the rows uniquely. b.It becomes difficult to identify the columns uniquely. c.It becomes difficult to join tables. d.It becomes difficult to identify foreign key. 5.In ______, every higher-level entity must also be a lower-level entity. a.Generalization b.E/R diagram c.Specialization d.Many-to-Many relationship

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 4 of 18 Solutions Ans1. One-to-One Ans2. The primary key of the supertype is the foreign key of the subtype. Ans3.Alternate key Ans4.It becomes difficult to identify the rows uniquely. Ans5.Generalization

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 5 of 18 Top-Down and Bottom-Up Approach There are two approaches to logical database design: The top-down approach The bottom-up approach The E/R modeling technique is the top-down approach. It involves identifying entities, relationships and attributes, drawing the E/R diagram, and mapping the diagram to tables. Normalization is the bottom-up approach. It is a step-by-step decomposition of complex records into simple records. Normalization reduces redundancy using the principle of non-loss decomposition. Non-loss decomposition is the reduction of a table to smaller tables without any loss of information. The bottom-up approach is best for validation of existing designs.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 6 of 18 Data Redundancy Redundancy means repetition of data. Redundancy increases the time involved in updating, adding, and deleting data. Redundancy also increases the utilization of disk space, and hence, disk I/O increases. Redundancy can lead to: Update anomalies—Inserting, modifying, and deleting data may cause inconsistencies. Inconsistencies—Errors are more likely to occur when facts are repeated. Unnecessary utilization of extra disk space.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 7 of 18 Need for Normalization Normalization is a scientific method of breaking down complex table structures into simple table structures by using certain rules. Using normalization, you can reduce redundancy in a table and eliminate the problems of inconsistency and disk space usage. You can also ensure that there is no loss of information. Normalization has several benefits as follows: It enables faster sorting and index creation. It helps to create more clustered indexes. It requires few indexes per table. It reduces the number of NULL values in a table. It makes the database compact.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 8 of 18 Need for Normalization (Contd..) The performance of an application is directly linked to the database design. Some rules that should be followed to achieve a good database design are: Each table should have an identifier. Each table should store data for a single type of entity. Columns that accept NULL s should be avoided. The repetition of values or columns should be avoided.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 9 of 18 Normal Forms Normalization results in the formation of tables that satisfy certain specified rules and represent certain normal forms. The normal forms are used to ensure that various types of anomalies and inconsistencies are not introduced in the database. A table structure is always in a certain normal form. The most important and widely used normal forms are: First Normal Form (1NF) Second Normal Form (2 NF) Third Normal Form (3 NF) Boyce-Codd Normal Form (BCNF)

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 10 of 18 Functional Dependency The normalization theory is based on the fundamental notion of functional dependency. In a relation R, attribute A is functionally dependent on attribute B if each value of A in R is associated with precisely one value of B. Attribute B is called the determinant. All attributes of a table must be functionally dependent on the key. However, functional dependency does not require an attribute to be the key in order to functionally determine other attributes. Functional dependency can also be defined as follows: Given a relation R, attribute A is functionally dependent on B only if whenever two tuples of R agree on their B value, they must agree on their A value. Functional dependencies represent many-to-one relationships.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 11 of 18 First Normal Form (1 NF) A table is said to be in the 1 NF when each cell of the table contains precisely one value.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 12 of 18 Second Normal Form (2 NF) A table is said to be in 2 NF when it is in 1 NF and every attribute in the row is functionally dependent upon the whole key, and not just part of the key. Guidelines for converting a table to 2 NF: Find and remove attributes that are functionally dependent on only a part of the key and not on the whole key. Place them in a different table. Group the remaining attributes.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 13 of 18 Third Normal Form (3 NF) A table is said to be in the 3 NF when it is in 2 NF and every non- key attribute is functionally dependent only on the primary key. Guidelines for converting a table to 3 NF: Find and remove non-key attributes that are functionally dependent on attributes that are not the primary key. Place them in a different table. Group the remaining attributes.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 14 of 18 Boyce-Codd Normal Form (BCNF) The original definition of 3 NF was inadequate and not satisfactory for the tables: that had multiple candidate keys. where the multiple candidate keys were composite. where the multiple candidate keys overlapped. The Boyce-Codd Normal Form (BCNF) was introduced to normalize the table in the above conditions. A relation is in BCNF if and only if every determinant is a candidate key. Guidelines for converting a table to BCNF: Find and remove the overlapping candidate keys. Place the part of the candidate key and the attribute it is functionally dependent on, in a different table. Group the remaining items into a table.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 15 of 18 Denormalization The intentional introduction of redundancy in a table in order to improve query performance is called denormalization. The decision to denormalize results in a trade-off between performance and data consistency. Denormalization also increases disk space utilization.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 16 of 18 Summary In this lesson, you learned that: There are two approaches to logical database design: The top-down approach The bottom-up approach The E/R modeling technique is the top-down approach, while normalization is the bottom-up approach. Normalization is used to simplify table structures. Normalization results in the formation of tables that satisfy certain specified constraints, and represent certain normal forms. A table structure is always in a certain normal form.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 17 of 18 Summary (Contd..) The most important and widely used normal forms are: First Normal Form (1 NF) Second Normal Form (2 NF) Third Normal Form (3 NF) Boyce-Codd Normal Form (BCNF) The normalization theory is based on the fundamental notion of functional dependency. Functional dependencies represent many-to-one relationships. A table is said to be in the 1 NF when each cell of the table contains precisely one value. A table is said to be in the 2NF when it is in 1 NF and every attribute in the row is functionally dependent upon the whole key, and not just part of the key. A table is said to be in the 3NF when it is in 2 NF and every non-key attribute is functionally dependent only on the primary key.

©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 18 of 18 Summary (Contd..) The original definition of 3NF was inadequate and not satisfactory for the tables: that had multiple candidate keys. where the multiple candidate keys were composite. where the multiple candidate keys overlapped. A relation is in the Boyce-Codd normal form (BCNF) if and only if every determinant is a candidate key. The intentional introduction of redundancy in a table in order to improve query performance is called denormalization. The decision to denormalize results in a trade-off between performance and data consistency. Denormalization also increases disk space utilization.