Normalization. Rigorous technique used to break down data represented in a user view into a set of 2- dimensional tables where “all attributes in the.

Slides:



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

Normalisation.
Normalization Rules for Database Tables
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
T ERMINOLOGY & N ORMALIZATION DBS201. Equivalent Terms: Relational Model Table-Oriented DBMS Conventional File Systems Conceptionally Repreesents RelationTableFileEntity.
Normalisation Ensuring data integrity in database design 1.
Normalization – Additional Notes. Normalization Abstract Example For the following un-normalized relation: RELN1[A, B, {C, D}, E, F, G] where E can be.
Athabasca University Under Development for COMP 200 Gary Novokowsky
Jump to first page Normalization Jump to first page Topics n Why normalization is needed n What causes anomalies n What the 4 normal forms are n How.
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.
The Relational Database Model:
Database Design Concepts Lecture 19 Term 2 week 8 Worked example of normalisation.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
Normalization REVIEW DBS201.
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
Logical Relational Database Design. Logical Relational Design Purpose of logical data design is to represent application data in the form of related 2-dimensional.
Chapter 4: Logical Database Design and the Relational Model (Part II)
Functional Dependence An attribute A is functionally dependent on attribute(s) B if: given a value b for B there is one and only one corresponding value.
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Bordoloi Database Design: Normalization Dr. Bijoy Bordoloi.
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
A Normalisation Example Mark Kelly McKinnon Secondary College Vceit.com Based on work by Robert Timmer-Arends.
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 Normalization 取材自 AIS, 6 th edition By Gelinas et al.
Database Normalization Lynne Weldon July 17, 2000.
Normalization Transparencies
1 CMPT 275 Phase: Design. Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces Data Persistance.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Normalization Information Systems II Ioan Despi. Informal approach Building a database structure : A process of examining the data which is useful & necessary.
Customer Order Order Number Date Cust ID Last Name First Name State Amount Tax Rate Product 1 ID Product 1 Description Product 1 Quantity Product 2 ID.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
Lecture 5 Normalization. Objectives The purpose of normalization. How normalization can be used when designing a relational database. The potential problems.
Chapter 10 Normalization Pearson Education © 2009.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
1 5 Chapter 5 Database Design 1: Some Normalization Examples Spring 2006.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Normalizing Your Database CPT 242. Normalization The procedure where the developer analyzes the data and establishes the table structure to create the.
Normalization Data Design - Mr. Ahmad Al-Ghoul
IT The Relational DBMS Section 05. Relational Database Theory Normalization for Logical Database Design.
Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working.
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 MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.
Logical (Information Level) Design of Relational Databases.
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
Databases Database Normalisation. Learning Objectives Design simple relational databases to the third normal form (3NF).
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Databases Introduction - concepts. Concepts of Relational Databases.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
Normalizing Database Designs. 2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design.
Relations, Keys, & Normalization
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Examples of normalization
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
Some Normalization Examples
A Normalization Example
Examples of normalization
Chapter 8 – Part2 Database Design.
Chapter 8 – Part2 Database Design.
Relations, Keys, & Normalization
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Some Normalization Examples
Presentation transcript:

Normalization

Rigorous technique used to break down data represented in a user view into a set of 2- dimensional tables where “all attributes in the relation are defined by the key, the whole key and nothing but the key” Resulting relations will correspond to the tables to be used in a relational database Identification of primary key for a relation is critical

Sample Userview: Class List Section: DBS201ASubject Name: Intro to DB Instructor No: 213Instr Name:Belvedere Student No: Student Name: Joe Brown Student No: Student Name: Le Huang Section: DBS201BSubject Name: Intro to DB Instructor No: 222Instr Name: Langer Student No: Student Name: Ella Zeltserman Student No: Student Name: Maria Ramirez

Un-normalized Relation Identify all attributes presented in user view Choose a primary key (made up of 1 or more attributes) that best represents what user view describes Name the relation and list all attributes for the relation Indicate primary key by underlining 1 or more attributes Indicate if an attribute or group of related attributes can have more than one value for a given value of the primary key by enclosing within brace brackets { } – this is referred to as a ‘repeating group’

Class List Relation – Un-normalized Form CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName, SubjectName, {StudentNumber, StudentName} ]

1 st Normal Form Relation A relation is in 1 st normal form when the primary key determines a single value of each attribute for all attributes in the relation (i.e. the relation contains no repeating groups) 2 different approaches can be used to take a relation from un-normalized to 1NF (both produce same results at the end of the normalization process!)

Unnormalized ->1 st Normal Form Approach 1 Unnormalized relation: CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName, SubjectName, {StudentNumber, StudentName} ] Restate original unnormalized relation without repeating group: CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName, SubjectName ] Create new relation consisting of key of original relation and attributes within repeating group and add to key to ensure uniqueness: CLASSLISTSTUDENT [ SubjectCode, SectionCode, StudentNumber, StudentName ]

Unnormalized ->1 st Normal Form Approach 2 Unnormalized Relation: CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName, SubjectName, {StudentNumber, StudentName} ] Add to key of unnormalized relation to insure primary key identifies 1 and only 1 value of each attribute in the relation: CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName, SubjectName, StudentNumber, StudentName ] Regardless of approach used you will now have 1 or more relations in which the primary key identifies 1 and only 1 value of each of the non- key attributes in the 1NF relation

2 nd Normal Form A 1NF relation is in 2NF when the entire primary key is needed to determine the value of each non-key attribute (i.e. relation has no partial dependencies – attributes whose values can be determined by knowing only part of the key)

1 st Normal Form -> 2 nd Normal Form 1NF Relations: CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName, SubjectName ] contains the partial dependency SubjectCode -> SubjectName and CLASSLISTSTUDENT [ SubjectCode, SectionCode, StudentNumber, StudentName ] contains the partial dependency StudentNumber-> StudentName so are not in 2NF Create new relation(s) consisting of part of the primary key and all attributes whose values are determined by this part of the primary key: SUBJECT [SubjectCode, SubjectName ] and STUDENT [StudentNumber, StudentName ] Restate original relation(s) without partially dependent attributes: CLASSLISTSTUDENT [ SubjectCode, SectionCode, StudentNumber ] and CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName ]

3 Rd Normal Form A 2NF relation is in 3NF when the primary key and nothing but the primary key can be used to determine the value of each non-key attribute (i.e. relation has no transitive dependencies – attributes whose values can be determined by knowing something other than the key)

2NF -> 3NF 2NF Relations: CLASSLISTSTUDENT [ SubjectCode, SectionCode, StudentNumber ], CLASSLIST [ SubjectCode, SectionCode, InstructorNo, InstructorName ], SUBJECT [SubjectCode, SubjectName ] and STUDENT [StudentNumber, StudentName ] Create new relation(s) consisting of the attribute(s) which are determined by something other than the primary key (transitive dependencies) and make the primary key of these new relation(s) the attribute that actually determines the value of these attributes. In CLASSLIST the Instructor Name is determined by InstructorNo so create the new relation: INSTRUCTOR [InstructorNo, InstructorName ] Restate original relation(s) without transitively dependent attributes (Original relation will now contain a foreign key – a non-key attribute that relates to the primary key of the new relation) : CLASSLIST [ SubjectCode, SectionCode, InstructorNo ], CLASSLISTSTUDENT [ SubjectCode, SectionCode, StudentNumber ], SUBJECT [SubjectCode, SubjectName ] and STUDENT [StudentNumber, StudentName ]

Resulting 3NF Relations for ClassList Userview Set of 3NF Relations for the Class List Userview: CLASSLIST [ SubjectCode, SectionCode, InstructorNo ] CLASSLISTSTUDENT [ SubjectCode, SectionCode, StudentNumber ] SUBJECT [SubjectCode, SubjectName ] STUDENT [StudentNumber, StudentName ] INSTRUCTOR [InstructorNo, InstructorName ] 1 unnormalized userview will always result in 1 or more relations in 1NF Each 1NF relation will result in 1 or more 2NF relations Each 2NF relation will result in 1 or more 3NF relations You can never lose (ie not include) an attribute – it must always be found in one of the relations at each step You can never lose a relation

Normalize Remaining User views Normalization process is then applied to each remaining user view (eg grade sheet, timetable request, …) A set of 3NF relations is produced for each user view Then 3NF relations from each user view are then integrated to form one complete set of relations for the application