Normalization Refine data To attain a good DB design

Slides:



Advertisements
Similar presentations
Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
Advertisements

Nov 11, 2003Murali Mani Normalization B term 2004: lecture 7, 8, 9.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Chapter 14 Advanced Normalization Transparencies © Pearson Education Limited 1995, 2005.
Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.
Introduction to Schema Refinement
CS 405G: Introduction to Database Systems 16. Functional Dependency.
Lecture 12 Inst: Haya Sammaneh
Copyright © Curt Hill Schema Refinement III 4 th NF and 5 th NF.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
CS 222 Database Management System Spring Lecture 5 Database Design (Decomposition) Korra Sathya Babu Department of Computer Science NIT Rourkela.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
Multivalued Dependencies Fourth Normal Form Tony Palladino 157B.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
Objectives of Normalization  To create a formal framework for analyzing relation schemas based on their keys and on the functional dependencies among.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Normalization and FUNctional Dependencies. Redundancy: root of several problems with relational schemas: –redundant storage, insert/delete/update anomalies.
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts.
4TH NORMAL FORM By: Karen McVay.
Lecture 11: Functional Dependencies
Normalization.
Normalization Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 19.
Normalization (Database Design)
Advanced Normalization
Gergely Lukács Pázmány Péter Catholic University
A brief summary of database normalization
Normalization First Normal Form (1NF) Boyce-Codd Normal Form (BCNF)
Normal Forms.
Database Design Dr. M.E. Fayad, Professor
Payroll Management System
Advanced Normalization
Functional Dependency & Normalization
Normal forms First Normal Form (1NF) Second Normal Form (2NF)
Problems in Designing Schema
Functional Dependencies and Normalization for Relational Databases
Database Normalization
Module 5: Overview of Normalization
Schema Refinement What and why
Normalization Murali Mani.
Lecture #17: Schema Refinement & Normalization - Normal Forms
Functional Dependencies and Normalization
Sridhar Narayan Normalization Sridhar Narayan
Cse 344 May 16th – Normalization.
Functional Dependencies and Relational Schema Design
Introduction to Database Systems CSE 444 Lectures 8 & 9 Database Design October 12 & 15, 2007.
Outline: Normalization
Normalization.
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
4 Normal Form.
Lecture 8: Database Design
Unit 7 Normalization (表格正規化).
Normalization cs3431.
CS 405G: Introduction to Database Systems
Instructor: Mohamed Eltabakh
NORMALIZATION FIRST NORMAL FORM (1NF):
Lecture 5: Functional dependencies and normalization
Relational Database Design
Database Normalization.
Database Design Dr. M.E. Fayad, Professor
Lecture 6: Functional Dependencies
Chapter 7a: Overview of Database Design -- Normalization
Lecture 09: Functional Dependencies
CS4222 Principles of Database System
Design Theory for Relational Databases
Presentation transcript:

Normalization Refine data To attain a good DB design To reduce redundancy Minimize storage space req Eliminate data anomalies

Non loss decomposition vs lossy decomposition Un normalized table

Functional dependency AB DETERMINANT DETERMINED 1-a 1-a 1-a 1-a 1-b 2-a 2-b 1-a

1NF Identify and remove repeating groups Identify and remove non atomic attr Identify the keys for the table

First (sid, status,city,pid,qty) LPU First (sid, status,city,pid,qty) Sid Status City Pid Qty s1 20 Jal p1 100 P2 150 s2 10 Asr P1 200 250 s3 300 s4 P3 jal p4

2NF A relation is in 2NF iff It is in 1NF Every non key attribute is fully depend on the primary key (remove partial dependencies) Anomalies INSERT UPDATE

Break down the relation FIRST into: SECOND(sid, status, city) and SP(sid,pid,QTY)

3NF Elimination of transitive dependencies Still anomalies are there DELETE UPDATE That’s why SP is further breakdown to : SC(sid, city) CS(city, status)

BCNF A relation is said to be in BCNF iff: It is in 3NF All its determinants (i.e the attributes on which other attribute depends) are candidate keys First (sid, status,city,pid,qty)--- not in BCNF SECOND(sid, status, city) SP(sid,pid,QTY) SC(sid, city) CS(city, status)

Trivial − If a functional dependency (FD) X → Y holds, where Y is a subset of X, then it is called a trivial FD. Trivial FDs always hold. Non-trivial − If an FD X → Y holds, where Y is not a subset of X, then it is called a non-trivial FD. Examples: AA ABA ABC

More examples R={A,B,C,D,E} {A->B,B->C,C->D,D->E,E->A) A-Prime attribute B,C,D- Non Prime attribute {AB->C,C->D, D->E,A->B}

4NF A relation is said to be in 4NF iff It is in 3NF or BCNF It does not contain any multi value dependencies

Multivalue dependency It is the dependancy where one attribute value is a multi-value fact about another. a) {customer_name, address} customer_name -> -> address Address <- <- customer_name b) {Course, student_name, Text_book} Course -> -> student_name Course -> -> Text_book c) {Emp_id,Language, Skill} Emp_id -> -> Language Emp_id -> -> Skill Will result in spurious tuples

EMPID LANGUAGE SKILL 101 English Teaching Hindi Conversation 202 Singing

Rule to transform a relation into 4NF A relation R having A, B,C as attributes can be non loss decomposed into two projections R1(A,B) and R2(A,C) iff: MVD A-> -> B/C holds in R

5NF A relation is said to be in 5NF iff Relation is in 4NF It can n’t be further non loss decomposed