Lecture # 17 Chapter # 10 Normalization Database Systems.

Slides:



Advertisements
Similar presentations
Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4.
Advertisements

1 Logical Database Design and the Relational Model Modern Database Management.
CSc-340 6b1 Relational Database Design Chapter 8 [1 of 2] Features of Good Relational Designs Atomic Domains and First Normal Form Decomposition Using.
Chapter 8 Normal Forms Based on Functional Dependencies Deborah Costa Oct 18, 2007.
Systems Development Life Cycle
© 2005 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B.
The Database Approach u Emphasizes the integration of data across the organization.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Chapter 4: Logical Database Design and the Relational Model
Terms - data,information, file record, table, row, column, transaction, concurrency Concepts - data integrity, data redundancy, Type of databases – single-user,
Bad DB Design Duplicate of data Duplicate of data Updating Updating Deleting Deleting.
© 2007 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B.
Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 4: Logical Database Design and the Relational Model Modern Database Management 10.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Chapter 4: Logical Database Design and the Relational Model (Part II)
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Chapter 5: Logical Database Design and the Relational Model
Logical Database Design ( 補 ) Unit 7 Logical Database Design ( 補 )
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
Lecture9:Functional Dependencies and Normalization for Relational Databases Prepared by L. Nouf Almujally Ref. Chapter Lecture9 1.
CORE 2: Information systems and Databases NORMALISING DATABASES.
1 5 Normalization. 2 5 Database Design Give some body of data to be represented in a database, how do we decide on a suitable logical structure for that.
Chapter 5 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
© 2005 by Prentice Hall 1 The Database Development Process Dr. Emad M. Alsukhni The Database Development Process Dr. Emad M. Alsukhni Modern Database Management.
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
1 5 Chapter 5 Database Design 1: Some Normalization Examples Spring 2006.
Normalization Is the gradual and sequential process of efficiently organizing data in a database that follows the rules listed in the previous slide –
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
Pree Thiengburanathum, CAMT, Chiang Mai University 1 Database System Logical Database Design and the Relational Model November 1 st, 2009 Software Park,
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Logical Database Design and the Relational Model.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part c): Logical Database Design and the Relational Model Modern Database Management.
The Normal Forms 3NF and BCNF
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Logical Database Design and the Relational Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Normalization Hour1,2 Presented & Modified by Mahmoud Rafeek Alfarra.
6-1 © Prentice Hall, 2007 Topic 6: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Functional Dependencies Zaki Malik September 25, 2008.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 3: LOGICAL DATABASE.
Chapter 5 MODULE 6: Normalization © 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Prepared by: KIM GASTHIN M. CALIMQUIM.
© 2007 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B.
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Functional Dependencies. Babies Exercise 2.2.5: At a birth, there is one baby (twins would be represented by two births), one mother, any number of nurses,
Chapter 4, Part A: Logical Database Design and the Relational Model
Lecture 4: Logical Database Design and the Relational Model 1.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
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
Chapter 4 © 2013 Pearson Education, Inc. Publishing as Prentice Hall Chapter 4: Logical Database Design and the Relational Model Modern Database Management.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 4: PART C LOGICAL.
Database Normalization. What is Normalization Normalization allows us to organize data so that it: Normalization allows us to organize data so that it:
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Database, tables and normal forms
Normalization Karolina muszyńska
Example Question–Is this relation Well Structured? Student
Unit 4: Normalization of Relations
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Presentation transcript:

Lecture # 17 Chapter # 10 Normalization Database Systems

Bad Database Design Duplication of data Updating Deleting

Redundant

Deleting

Update

Normalization is a design technique that is widely used as a guide in designing relational databases. Normalization is essentially a two step process that puts data into tabular form by removing repeating groups and then removes duplicated data from the relational tables. Normalization theory is based on the concepts of normal forms. A relational table is said to be in a particular normal form if it satisfied a certain set of constraints. There are currently five normal forms that have been defined. In this course, we will cover the first three normal forms Normalization

The goal of normalization is to create a set of relational tables that are free of redundant data and that can be consistently and correctly modified or updated. This means that all tables in a relational database should be in the third normal form (3NF).

Normalization A relational table is in 3NF if and only if all non-key columns are: – Mutually independent and – Fully dependent upon the primary key Mutual independence means that no non-key column is dependent upon any combination of the other columns The first two normal forms are intermediate steps to achieve the goal of having all tables in 3NF In order to better understand the 2NF and higher forms, it is necessary to understand the concepts of functional dependencies

Functional Dependencies The concept of functional dependencies is the basis for the first three normal forms. A column, Y, of the relational table R is said to be functionally dependent upon column X of R if and only if each value of X in R is associated with precisely one value of Y at any given time. X and Y may be composite. Saying that column Y is functionally dependent upon X is the same as saying the values of column X identify the values of column Y. If column X is a primary key, then all columns in the relational table R must be functionally dependent upon X. A short-hand notation for describing a functional dependency is: R.x —> R.y which can be read as in the relational table named R, column x functionally determines (identifies) column y in the relational table R.

Example FD Drinkers(name, addr, drinkLiked, manf, favdrink). Reasonable FD’s to assert: 1.name -> addr 2.name -> favdrink 3.drinkLiked -> manf Functional Dependency: The value of one attribute (the determinant) determines the value of another attribute

Example DF nameaddr drinkLiked manffavDrink JanewayVoyager Bud A.B.WickedAle JanewayVoyager WickedAle Pete’sWickedAle SpockEnterprise Bud A.B.Bud Because name -> addr Because name -> favDrink Because drinkLiked -> manf

Basic Idea To know what FD’s hold in a projection, we start with given FD’s and find all FD’s that follow from given ones. Then, restrict to those FD’s that involve only attributes of the projected schema.

Normalization What is normalization? Basically, it's the process of efficiently organizing data in a database. There are two goals of the normalization process: Eliminate redundant data (for example, storing the same data in more than one table) and Ensure data dependencies make sense (only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.

First Normalization Form 1FN Eliminate duplicative columns from the same table. BY the values in each column of a table are atomic. By atomic we mean that there are no sets of values within a column. Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).

First Normal Form No multivalued attributes Every attribute value is atomic Fig is not in 1 st Normal Form (multivalued attributes)  it is not a relation Fig is in 1 st Normal form All relations are in 1 st Normal Form

Table with multivalued attributes, not in 1 st normal form Note: this is NOT a relation

Table with no multivalued attributes and unique rows, in 1 st normal form Note: this is relation, but not a well-structured one

Second normal form 2NF Where the First Normal Form deals with atomicity of data, the Second Normal Form (or 2NF) deals with relationships between composite key columns and non- key columns: – Meet all the requirements of the first normal form. – Any non-key columns must depend on the entire primary key. In the case of a composite primary key, this means that a non-key column cannot depend on only part of the composite key. – Create relationships between these new tables and their predecessors through the use of foreign keys. – A relation R is in 2nf if every non-primary attribute A in R is fully Functionally dependent on the primary key.

Second Normal Form 1NF PLUS every non-key attribute is fully functionally dependent on the ENTIRE primary key – Every non-key attribute must be defined by the entire key, not by only part of the key – No partial functional dependencies

Order_ID  Order_Date, Customer_ID, Customer_Name, Customer_Address Therefore, NOT in 2 nd Normal Form Customer_ID  Customer_Name, Customer_Address Product_ID  Product_Description, Product_Finish, Unit_Price Order_ID, Product_ID  Order_Quantity

Getting it into Second Normal Form Partial Dependencies are removed, but there are still transitive dependencies

Third normal form 3NF Remove columns that are not dependent upon the primary key. Third Normal Form (3NF) requires that all columns depend directly on the primary key. – Example: Publisher (Publisher_ID, Name, Address, City, State, Zip) Zip (Zip, City, State)

Third Normal Form 2NF PLUS no transitive dependencies (functional dependencies on non-primary-key attributes) Note: this is called transitive, because the primary key is a determinant for another attribute, which in turn is a determinant for a third Solution: non-key determinant with transitive dependencies go into a new table; non-key determinant becomes primary key in the new table and stays as foreign key in the old table

Getting it into Third Normal Form Transitive dependencies are removed

Figure Steps in normalization