Database Normalization.

Slides:



Advertisements
Similar presentations
Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4.
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.
Chapter 5 Normalization of Database Tables
Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
Defined by Edgar Codd in 1970 Defined by Edgar Codd in 1970 Considered ingenious but impractical Considered ingenious but impractical Conceptually simple.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Boyce-Codd NF Takahiko Saito Spring 2005 CS 157A.
Normalisation The theory of Relational Database Design.
Information Resources Management March 13, Agenda n Administrivia n Normalization n Homework #7 n Mid-Term #2.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Project and Data Management Software
Week 6 Lecture Normalization
Lecture 12 Inst: Haya Sammaneh
SQL Normalization Database Design Lecture 5. Copyright 2006Page 2 SQL Normalization Database Design 1 st Normal Form 1 st Normal Form 2 nd Normal Form.
DATABASE LOGICAL DESIGN -- II Chandra S. Amaravadi 1.
Avoiding Database Anomalies
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
The Relational Model and Normalization The Relational Model Normalization First Through Fifth Normal Forms Domain/Key Normal Form The Synthesis of Relations.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Normalization Ioan Despi 2 The basic objective of logical modeling: to develop a “good” description of the data, its relationships and its constraints.
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.
By Abdul Rashid Ahmad. E.F. Codd proposed three normal forms: The first, second, and third normal forms 1NF, 2NF and 3NF are based on the functional dependencies.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) 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.
Lecture 3 Functional Dependency and Normal Forms Prof. Sin-Min Lee Department of Computer Science.
Normalization ACSC 425 Database Management Systems.
Normalization Or theoretical and common sense approaches to redesigning a database.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Normal Forms 1NF – A table that qualifies as a relation is in 1NF. (Back)(Back) 2NF – A relation is in 2NF if all of its nonkey attributes are dependent.
Logical Design & the Relational Model
Chapter 8: Object-Relational Modeling
Perancangan Basis Data
Functional Dependency and Normalization
CSIS 115 Database Design and Applications for Business
Advanced Normalization
Normalization Karolina muszyńska
Part IV: Logical Database Design
1st, 2nd, 3rd Normal Forms Boyce-Codd Normal Form
Payroll Management System
Chapter 8: Relational Database Design
The Relational Model and Normalization
Normalization.
Normalization of Database Tables PRESENTED BY TANVEERA AKHTER FOR BCA 2ND YEAR dated:15/09/2015 DEPT. OF COMPUTER SCIENCE.
Database Normalization
Chapter 6 Normalization of Database Tables
Module 5: Overview of Normalization
CSCI 2141 – Intro to Database Systems Database Normalization
Normalization By Jason Park Fall 2005 CS157A.
Database solutions The process of normalization Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology rooms:
Some Normalization Examples
A Normalization Example
Normalization Dale-Marie Wilson, Ph.D..
4 Normal Form.
Chapter 8 – Part2 Database Design.
Boyce-Codd Normal Form (BCNF)
Chapter 8 – Part2 Database Design.
Normalization February 28, 2019 DB:Normalization.
Normalization of DB relations examples Fall 2015
Database Normalization.
Database Management System
Normalization By Jason Park Fall 2005 CS157A.
Database Design Normalisation (2)
Chapter 7a: Overview of Database Design -- Normalization
Some Normalization Examples
Presentation transcript:

Database Normalization

7 Normal Forms Unnormalized data Normalized data 1NF 2NF 3NF BCNF 4NF 5NF (PJNF)‏ DKNF Normalized data

Steps in normalization Remove Table with repeating groups Repeating Groups 1st Normal Form Partial Dependencies 2nd Normal Form Transitive Dependencies 3rd Normal Form Determinant / Candidate Keys Boyce-Codd Normal Form Multivalued Dependencies 4th Normal Form Removing Remaining anomalies 5th Normal Form (Project Join NF)‏ Removing Remaining anomalies Domain Key Normal Form

Boyce-Codd Normal Form Determinant: “A determinant is a simple or composite attribute that functionally determines one or more other attributes”. A relation is in BCNF if and only if “Every determinant is a candidate key”. Y = f(X)‏ or X = f(Y)‏ Y = mX + C Determinant is X or Y Dependent is X or Y

Boyce-Codd Normal Form Process All the determinants are identified. If the determinants are candidate keys, the relation is in BCNF.

BCNF Consider DEPARTMENT relation with following attributes: DNO DNAME Example with more than one candidate keys Consider DEPARTMENT relation with following attributes: DNO DNAME EMPS MGR_NO MGR_NAME 1 ACCT 10 100 ALI 2 ADMN 15 200 HASAN 3 FINANCE 20 300 KHAN 4 PROD 25 400 RAZA This relation has three determinants: DNO, DNAME and MGR_NO. Each of the determinants is thus a candidate key. So, the relation is in BCNF.

BCNF Consider SAM relation with following attributes: STID MAJOR Example 2 Consider SAM relation with following attributes: STID MAJOR ADVISOR 1 Database Asad S/w Engineering Faisal 2 Comp. Communication Imran 3 Zahid 4 In this relation, no single attribute is a candidate key. That is, no single attribute is a determinant for the remaining two attributes.

BCNF This relation is not in BCNF because: Example 2 This relation is not in BCNF because: Although ADVISOR is a determinant, it is not a candidate key. Although STID is a determinant, it is not a candidate key. The combination (STID, ADVISOR) is a candidate key for this relation. To convert into BCNF, divide this relation into two relations. The attribute that is a determinant but not a candidate key, must be placed in a separate relation and must be the key of that relation.

BCNF Relations in BCNF STID MAJOR ADVISOR MAJOR ADVISOR 1 Database Asad S/w Engineering Faisal 2 Comp. Communication Imran 3 Database Zahid 4 Database Asad

BCNF STID MAJOR ADVISOR STID ADVISOR ADVISOR MAJOR Relations in BCNF 1 Database Asad S/w Engineering Faisal 2 Comp. Communication Imran 3 Zahid 4 STID ADVISOR 1 Asad Faisal 2 Imran 3 Zahid 4 ADVISOR MAJOR Asad Database Faisal S/w Engineering Imran Comp. Communication Zahid

4th Normal Form Let R be a relation with A, B and C as the attributes. Multivalued Dependencies Let R be a relation with A, B and C as the attributes. There is a multivalued dependency of attribute B on attribute A if and only if the set of B values associated with a given A value is independent of the set of C values. Easy A type of dependency that exists when there are at least three attributes (Let A, B and C be the attributes) in a relation, and for each value of A there is a well defined set of values for B and a well defined set of values for C, but the set of values of B is independent of set of values of C.

4th Normal Form Example Emp_no Salary Child_Name 1 10000 Ali Akram 2 20000 Babar Elahi Here Child_Name is dependent on Emp_no and is independent of Salary. Emp_no determines salary because there is only one value of salary for each Emp_no. Salary depends on Emp_no. Emp_no multidetermines Child_Name, because there can be several values of Child_name for each Emp_no. Emp_no  Child_Name Emp_no  Salary

4th Normal Form Example COURSE INSTRUCTOR TEXTBOOK Table COURSE DBMS Ali Akram Babar XYZ ABC C++ Sajid PQR JKL Table COURSE INSTRUCTOR TEXTBOOK DBMS Ali XYZ Akram Babar ABC C++ Sajid PQR JKL Relation

4NF A relation is in 4th Normal Form if It is in BCNF and It contains no multivalued dependencies.

4NF Process Relation is in BCNF. Divide the relation containing m/v dependencies into new relations. Each of these relations contains attributes that have a multivalued relationship in the original relation.

4th Normal Form Example Emp_no Child_Name Salary 1 Ali 10000 Akram 2 Babar 20000 Elahi Emp_no Child_Name 1 Ali Akram 2 Babar Elahi Emp_no Salary 1 10000 2 20000

4th Normal Form Example COURSE INSTRUCTOR TEXTBOOK COURSE INSTRUCTOR DBMS Ali XYZ Akram Babar ABC C++ Majid PQR JKL COURSE INSTRUCTOR DBMS Ali Akram Babar C++ Majid COURSE TEXTBOOK DBMS XYZ ABC C++ PQR JKL