Normalisation.

Slides:



Advertisements
Similar presentations
Database Fundamentals
Advertisements

Relational Database Systems Higher Information Systems.
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Relational Database Systems Higher Information Systems.
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.
Ingredients: - 1/4 cup butter (dairy) - 1 cup brown sugar (spice) - 1/2 teaspoon cinnamon (spice) - 1/4 cup banana liqueur (alcohol) - 4 bananas, cut in.
WJEC Applied ICT Databases – Attributes & Entities Normalisation It is important in Database Design to make sure that the correct attributes are grouped.
Relational Data Analysis. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
Relational Database Appendix
Relational Database Systems Higher Information Systems.
Section 11 : Normalisation - A Worked Example
Normalisation Ensuring data integrity in database design 1.
Accounting 6500 Relational Databases: Accounting Applications Introduction to Normalization.
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.
Relational Data Analysis Learning outcomes  understand the process of normalisation;  perform Relational Data Analysis;  recognise the importance of.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
CS263:Revision on Normalisation
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Normalisation up to 1NF Bottom-up Approach to Data Modelling.
Relational Data Analysis II. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
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.
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
Lecture 12 Inst: Haya Sammaneh
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)
Richard Merritt1 Data Modelling Entities, Attributes and Relationships.
Avoiding Database Anomalies
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
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.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.
CORE 2: Information systems and Databases NORMALISING DATABASES.
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 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
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.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Quiz questions. 1 A data structure that is made up of fields and records? Table.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Data modeling Process. Copyright © CIST 2 Definition What is data modeling? –Identify the real world data that must be stored on the database –Design.
Databases Database Normalisation. Learning Objectives Design simple relational databases to the third normal form (3NF).
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
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
MS Access. Most A2 projects use MS Access Has sufficient depth to support a significant project. Relational Databases. Fairly easy to develop a good user.
Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.
Normalisation Worked example for an Order Remember : The data should depend upon the key, the whole key and nothing but the key.
Relational Databases – Further Study I think we’ve covered all you need to know for GCSE about relational databases I’m not aware of any practical coursework.
Flat file and relational databases Flat file database In a flat file database information is held in a single table. Student IDStudent name GenderDOBCourse.
Normalization.
Intro to MIS – MGS351 Relational Database Design
Payroll Management System
Do it now – PAGE 13 You will find your do it now task in your workbook – look for the start button! Thursday, 20 September 2018.
Examples of normalization
System Analysis and Design
Normalization and Databases
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
Examples of normalization
Database Normalisation
Database Normalisation
Logical Data Modeling – Normalization
Database Normalization.
Chapter 14 Normalization Pearson Education © 2009.
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Normalisation Un-normalised Data (UNF or 0NF) Data Attributes:
Presentation transcript:

Normalisation

Un-normalised Form (UNF) Identify an entity List all the attributes Identify a key ORDER (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number Item Code Description Unit Cost Quantity)

Un-normalised Form (UNF) Identify repeating data items

Un-normalised Form (UNF) Identify repeating data items ORDER (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number Item Code Description Unit Cost Quantity)

First Normal Form (1NF) Remove repeating data items to form a new entity Take the key with you! ORDER (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number Repeating items Item Code Description Unit Cost Quantity)

First Normal Form (1NF) Remove repeating data items to form a new entity Take the key with you! ORDER ORDER_ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) Item Code Description Unit Cost Quantity)

First Normal Form (1NF) Identify a key for the new entity It will be a compound key Use the original key and add to it ORDER ORDER_ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) Item Code Description Unit Cost Quantity)

First Normal Form (1NF) Identify a key for the new entity It will be a compound key Use the original key and add to it Label the foreign key Order Number is both part of the compound primary key and also a foreign key. ORDER ORDER_ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number Item Code Description Unit Cost Quantity)

First Normal Form (1NF) A data model is in 1NF if it has no multi-valued attributes ORDER ORDER_ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number Item Code Description Unit Cost Quantity)

First Normal Form (1NF)

First Normal Form (1NF) But what if there were lots of orders for large deluxe red widgets…? There are still update anomalies

Second Normal Form (2NF) Examine any entity with a compound key (in this case ORDER_ITEM) See if any attributes are dependent on just one part of the compound key These are called partial dependencies ORDER ORDER_ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number Item Code Description Unit Cost Quantity)

Second Normal Form (2NF) Order Number is part of the key Item Code is part of the key Description is dependent on the Item Code Unit Cost is dependent on the Item Code Quantity is dependent on both Order Number and Item Code. ORDER ORDER_ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number Item Code Description Unit Cost Quantity)

Second Normal Form (2NF) Description and Unit Cost are partial dependencies They are dependent on Item Code Remove these attributes to a new entity Take a copy of the attribute they are dependent on ORDER ORDER_ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number Item Code Description Unit Cost Quantity)

Second Normal Form (2NF) Item Code becomes the key of the new entity And becomes a foreign key in ORDER-ITEM ORDER ORDER_ITEM ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number *Item Code Quantity) (Item Code Description Unit Cost)

Second Normal Form (2NF) A data model is in 2NF if it is in 1NF and there are no partial dependencies ORDER ORDER_ITEM ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number *Item Code Quantity) (Item Code Description Unit Cost)

Second Normal Form (2NF) We can add an item to the Item table without it having to be on an order We can delete an order in the Order table without deleting details of the items on the order We can update item details once in the Item table without affecting the orders for that item in the Order-Item table

Second Normal Form (2NF) But there are still update anomalies with the Order entity ORDER (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number)

Third Normal Form (3NF) Examine all the entities produced so far See if there are any non-key attributes which are dependent on any other non-key attributes These are called non-key dependencies ORDER ORDER_ITEM ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number *Item Code Quantity) (Item Code Description Unit Cost)

Third Normal Form (3NF) In the ORDER entity, Customer Name, Address, Post Code and Telephone Number are all dependent on Customer Number ORDER ORDER_ITEM ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number *Item Code Quantity) (Item Code Description Unit Cost)

Third Normal Form (3NF) Remove these attributes to a new entity ORDER ORDER_ITEM ITEM (Order Number Order Date Customer Number Customer Name Address Post Code Telephone Number) (*Order Number *Item Code Quantity) (Item Code Description Unit Cost)

Third Normal Form (3NF) Remove these attributes to a new entity Customer Number is the key of the new entity Leave Customer Number behind as a foreign key ORDER CUSTOMER ORDER_ITEM ITEM (Order Number Order Date *Customer Number) (Customer Number Customer Name Address Post Code Telephone Number) (*Order Number *Item Code Quantity) (Item Code Description Unit Cost)

Third Normal Form (3NF) A data model is in 3NF if it is in 2NF and there are no non-key dependencies ORDER CUSTOMER ORDER_ITEM ITEM (Order Number Order Date *Customer Number) (Customer Number Customer Name Address Post Code Telephone Number) (*Order Number *Item Code Quantity) (Item Code Description Unit Cost)

Third Normal Form (3NF) We can add a customer to the Customer table without the customer having to place an order We can delete an order in the Order table without deleting details of the customer who placed the order We can update a customer’s details once in the Customer table without affecting the orders placed by that customer in the Order table

Memory Aid In 3NF, each attribute is dependent on the key the whole key and nothing but the key