Examples of normalization

Slides:



Advertisements
Similar presentations
Normalisation.
Advertisements

A Normalisation Example
RJP/RDA 1 /93 Relational Data Analysis (RDA) RDA organises all the system’s data items into a set of well NORMALISED relations. These should avoid: 1.
GCSE Computing#BristolMet Session Objectives# 21 MUST describe methods of validating data as it is input. SHOULD explain the use of key fields to connect.
Normalisation Ensuring data integrity in database design 1.
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.
Normalisation “A formal technique for analysing relations based on their primary key and functional dependencies.” [Codd]. Process – Analyse each relation.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
1 An Introduction to Relational Data Analysis (Normalisation)
Relational Data Analysis II. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
Chapter 5 Normalization of Database Tables
Project and Data Management Software
Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.
Introduction to Databases
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
Week 6 Lecture Normalization
Modelling Techniques - Normalisation Description and exemplification of normalisation.Description and exemplification of normalisation. Creation of un-normalised.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
Concepts and Terminology Introduction to Database.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
A Normalisation Example Mark Kelly McKinnon Secondary College Vceit.com Based on work by Robert Timmer-Arends.
Normalisation Mia’s Sandwich Shop The Process Explained.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
1 CMPT 275 Phase: Design. Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces Data Persistance.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
Normalization Information Systems II Ioan Despi. Informal approach Building a database structure : A process of examining the data which is useful & necessary.
1 Information Retrieval and Use Data Analysis & Data Modeling, Relational Data Analysis and Logical Data Modeling Geoff Leese September 2009.
Chapter 10 Normalization Pearson Education © 2009.
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.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Chapter 56 Relational Database Design Compiled by Eddie Moorcroft.
Sample Table Standard Notation Entity name in uppercase
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
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.
NORMALIZATION.
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Normalisation Unit 6: Databases. Just to recap  What is an Entity  What is an Attribute?
Normalisation Worked example for an Order Remember : The data should depend upon the key, the whole key and nothing but the key.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
Dr Gordon Russell, Napier University Normalisation 1 - V2.0 1 Normalisation 1 Unit 3.1.
N5 Databases Notes Information Systems Design & Development: Structures and links.
Normalization.
Revised: 2 April 2004 Fred Swartz
Chapter 5: Relational Database Design
Normalization Karolina muszyńska
Chapter 4: Relational Database Design
Database Normalization
MIS 322 – Enterprise Business Process Analysis
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Normalization Referential Integrity
Normalization of Database Tables PRESENTED BY TANVEERA AKHTER FOR BCA 2ND YEAR dated:15/09/2015 DEPT. OF COMPUTER SCIENCE.
Entity relationship diagrams
Normalization and Databases
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
Examples of normalization
Database Normalisation
Normalization February 28, 2019 DB:Normalization.
國立臺北科技大學 課程:資料庫系統 2015 fall Chapter 14 Normalization.
Database Normalisation
Normalization of DB relations examples Fall 2015
Databases and Information Management
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Normalisation Un-normalised Data (UNF or 0NF) Data Attributes:
Presentation transcript:

Examples of normalization

Example1 Step 1 Identify a key for the table. Remove duplicate data

Step 2 Transform a table of unnormalised data into first normal form (1NF). any repeating attributes to a new table. A repeating attribute is a data field within the UNF relation that may occur with multiple values for a single value of the key. The process is as follows: Identify repeating attributes. Remove these repeating attributes to a new table together with a copy of the key from the UNF table. Assign a key to the new table . The key from the original unnormalised table always becomes part of the key of the new table. A compound key is created. The value for this key must be unique for each entity occurrence.

In the previous table the Project Title, Project Manager, Project Budget are repeating. That is, there is potential for more than one occurrence of these attributes for each project code. These are the repeating attributes and have been to a new table together with a copy of the original key (ie: Project Code).

1NF Tables: Repeating Attributes Removed

Step 3 Transform 1NF data into second normal form (2NF). Remove any -key attributes (partial Dependencies) that only depend on part of the table key to a new table. What has to be determined "is field A dependent upon field B or vice versa?" This means: "Given a value for A, do we then have only one possible value for B, and vice versa?" If the answer is yes, A and B should be put into a new relation with A becoming the primary key. A should be left in the original relation and marked as a foreign key. Ignore tables with (a) a simple key or (b) with no non-key attributes (these go straight to 2NF with no conversion). The process is as follows: Take each non-key attribute in turn and ask the question: is this attribute dependent on one part of the key? If yes, remove the attribute to a new table with a copy of the part of the key it is dependent upon. The key it is dependent upon becomes the key in the new table. Underline the key in this new table. If no, check against other part of the key and repeat above process If still no, ie: not dependent on either part of the key, keep attribute in current table.

The first table went straight to 2NF as it has a simple key (Project Code). Employee name, Department No and Department Name are dependent upon Employee No only. Therefore, they were moved to a new table with Employee No being the key. However, Hourly Rate is dependent upon both Project Code and Employee No as an employee may have a different hourly rate depending upon which project they are working on. Therefore it remained in the original table.

2NF Tables: Partial Key Dependencies Removed

Step 4 data in second normal form (2NF) into third normal form (3NF).Remove to a new table any non-key attributes that are more dependent on other non-key attributes than the table key. Ignore tables with zero or only one non-key attribute (these go straight to 3NF with no conversion). The process is as follows: If a non-key attribute is more dependent on another non-key attribute than the table key: Move the dependent attribute, together with a copy of the non-key attribute upon which it is dependent, to a new table. Make the non-key attribute, upon which it is dependent, the key in the new table. Underline the key in this new table. Leave the non-key attribute, upon which it is dependent, in the original table and mark it a foreign key (*).

The project team table went straight from 2NF to 3NF as it only has one non-key attribute. Department Name is more dependent upon Department No than Employee No and therefore was moved to a new table. Department No is the key in this new table and a foreign key in the Employee table.

3NF Tables: Non-Key Dependencies Removed

Summary of Normalization Rules That is the complete process. Having started off with an unnormalised table we finished with four normalized tables in 3NF. You will notice that duplication has been removed (apart from the keys needed to establish the links between those tables). The process may look complicated. However, if you follow the rules completely, and do not miss out any steps, then you should arrive at the correct solution. If you omit a rule there is a high probability that you will end up with too few tables or incorrect keys. The following normal forms were discussed in this section: First normal form: A table is in the first normal form if it contains no repeating columns. Second normal form: A table is in the second normal form if it is in the first normal form and contains only columns that are dependent on the whole (primary) key. Third normal form: A table is in the third normal form if it is in the second normal form and all the non-key columns are dependent only on the primary key. If the value of a non-key column is dependent on the value of another non-key column we have a situation known as transitive dependency. This can be resolved by removing the columns dependent on non-key items to another table.

جمع وتنسيق واعداد أ/ أسماء العيسى Example2 UNF In this Relation (STUDENT _REPORT ) Grade Department Teacher TechNo Hours Subject SuCode Address Name St.No A Computer Ali 7 3 Introduction to computer csc101 Riyadh Fahad 5 B Math Saad 12 4 Itroduction to Calculation math102 C+ Rashid 2 C++ csc103 B+ Khalid DB1 csc325 Tariq DB2 csc426 جمع وتنسيق واعداد أ/ أسماء العيسى

جمع وتنسيق واعداد أ/ أسماء العيسى 1NF Relation STUDENT Address Name St.No Relation STUDENT Report Grade Department Teacher TechNo Hours Subject SuCode St.No جمع وتنسيق واعداد أ/ أسماء العيسى

جمع وتنسيق واعداد أ/ أسماء العيسى 2NF Relation STUDENT Address Name St.No Relation STUDENT -Subject Grade SuCode St.No Relation Subject -Teacher Department Teacher TechNo Hours Subject SuCode جمع وتنسيق واعداد أ/ أسماء العيسى

جمع وتنسيق واعداد أ/ أسماء العيسى 3NF Relation STUDENT Address Name St.No Relation STUDENT -Subject Grade SuCode St.No Relation Teacher-Subject TechNo Hours Subject SuCode Relation Teacher Department Teacher TechNo جمع وتنسيق واعداد أ/ أسماء العيسى

Example3 StdName CourseName Mark Course_no Stdno FD1 FD2 FD3 Describe and illustrate the process of normalization to produce 2NF relations.

Example4 E D C B A FD1 FD2 FD3 FD4 Describe and illustrate the process of normalization to produce 3NF relations.

Example5 Put this relation in the 3NF. Grade Instructor_Location InstructorName CourseTitle CourseID Major CampusAddress StudentName StudentID Put this relation in the 3NF.