Rob Gleasure R.Gleasure@ucc.ie www.robgleasure.com IS6125 Database Analysis and Design Lecture 11: Normalization of Data Tables Rob Gleasure R.Gleasure@ucc.ie.

Slides:



Advertisements
Similar presentations
 Definition  Components  Advantages  Limitations Contents  Definition Definition  Normal Forms Normal Forms  First Normal Form First Normal Form.
Advertisements

Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
+ Review: Normalization and data anomalies CSCI 2141 W2013 Slide set modified from courses.ischool.berkeley.edu/i257/f06/.../Lecture06_257.ppt.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Normalization I.
Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.
CS 405G: Introduction to Database Systems 16. Functional Dependency.
Lecture 12 Inst: Haya Sammaneh
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.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
CORE 2: Information systems and Databases NORMALISING DATABASES.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
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.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Lecture 8: Database Concepts May 4, Outline From last lecture: creating views Normalization.
IS6125 Database Analysis and Design Lecture 11: Normalization of Data Tables Rob Gleasure
Chapter 5.1 and 5.2 Brian Cobarrubia Database Management Systems II January 31, 2008.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part c): Logical Database Design and the Relational Model Modern Database Management.
Logical Database Design and the Relational Model.
IST Database Normalization Todd Bacastow IST 210.
IS6145 Database Analysis and Design Lecture 10: Normalization of Data Tables Rob Gleasure
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Lecture 4: Logical Database Design and the Relational Model 1.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
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
Lecture # 17 Chapter # 10 Normalization Database Systems.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 4: PART C LOGICAL.
Logical Design & the Relational Model
Normalization.
Understanding Data Storage
INLS 623 – Database Normalization
Functional Dependency and Normalization
Revised: 2 April 2004 Fred Swartz
Advanced Normalization
Relational Model.
CS422 Principles of Database Systems Normalization
A brief summary of database normalization
IS6125 Database Analysis and Design Lecture 12: Exam Revision and Semester Roundup Rob Gleasure
Database Normalization
Chapter 5: Logical Database Design and the Relational Model
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
CS422 Principles of Database Systems Normalization
Normalization DBS201.
Payroll Management System
Advanced Normalization
Unit 4: Normalization of Relations
Database Management systems Subject Code: 10CS54 Prepared By:
Database Normalization
System Analysis and Design
1st, 2nd, and 3rd Normal Forms
Rob Gleasure IS6125 Database Analysis and Design Lecture 11: Normalization of Data Tables Rob Gleasure
Normalization.
RDBMS RELATIONAL DATABASE MANAGEMENT SYSTEM.
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Rob Gleasure IS6145 Database Analysis and Design Lecture 9: Normalization of Data Tables Rob Gleasure
Normalisation to 3NF.
CS 405G: Introduction to Database Systems
1st, 2nd, and 3rd Normal Forms
Database Normalisation
Sampath Jayarathna Cal Poly Pomona
Schema Refinement and Normal Forms
Normalization DBS201.
BTEC ICT – Unit 18 With Mr Griffiths.
Database.
Presentation transcript:

Rob Gleasure R.Gleasure@ucc.ie www.robgleasure.com IS6125 Database Analysis and Design Lecture 11: Normalization of Data Tables Rob Gleasure R.Gleasure@ucc.ie www.robgleasure.com

IS6125 Today’s session Normalisation Functional dependencies First normal form Second normal form Third normal form

Themes from the reports Three Vs Datafication and the Internet of Things Recording things is the first step Information asymmetry It’s bad for a market when one side knows more than the other about the quality of specific instances Privacy Data has value to a consumer Different types of data Self-reported data Trace/exhaust data Profiling data

Normalisation Not actually as terrifying as it sounds… Just about making a database as efficient as possible by breaking big tables with redundant data into smaller tables with less redundant data We do this by taking advantage of functional dependencies

Inferring Functional Dependencies (The Armstrong Axioms) 1. Reflexivity: If Y is a subset of X, then X Y 2. Augmentation: If X Y, then XZ YZ 3: Transitivity: If X Y, and Y Z, then X Z

Normalisation: Orders Table Full_ Name Address Zone Order _ID Date Product_1 Cost_P1 Units_P1 Product_2 Cost_P2 Units_P2 Product_3 Cost_P3 Units_ P3 John Murphy 123 Fake St Inner-city S345 31/12/ 2014 Football $20.00 2 Gloves $53.50 1 Whistle $5.00 Mary Byrne Kildaman-fadar Rural R367 9/9/ Helmet $30.50 Anne Dunne N654 10/6/ Pants $13.75 Hat $11.00 Jim Feltz 20c Fake St D896 13/06/ $28.75 Boots $75.95 S354 1/01/ 2015 Socks $3.50 5

Normalisation: First Normal Form Name Address Zone Order _ID Date Product Cost Units John Murphy 123 Fake St Inner-city S345 31/12/ 2014 Football $20.00 2 Gloves $53.50 1 Whistle $5.00 S354 Socks $3.50 5 Mary Ahern Kildaman-fadar Rural R367 9/9/ Helmet $30.50 Anne Dunne N654 10/6/ Pants $13.75 Hat $11.00 Jim Feltz 20c Fake St D896 13/06/ $28.75 Boots $75.95

First Normal Form (continued) Name Last_ Address Zone Order _ID Date Product Cost Units John Murphy 123 Fake St Inner-city S345 31/12/ 2014 Football $20.00 2 Gloves $53.50 1 Whistle $5.00 S354 Socks $3.50 5 Mary Byrne Kildaman-fadar Rural R367 9/9/ Helmet $30.50 Anne Dunne N654 10/6/ Pants $13.75 Hat $11.00 Jim Feltz 20c Fake St D896 13/06/ $28.75 Boots $75.95

Summary of First Normal Form (1NF) A database is in the first normal form when Attributes store only atomic values Duplicate columns are removed

Moving to Second Normal Form First_ Name Last_ Address Zone Order _ID Date Product Cost Units John Murphy 123 Fake St Inner-city S345 31/12/ 2014 Football $20.00 2 Gloves $53.50 1 Whistle $5.00 S354 Socks $3.50 5 Mary Byrne Kildaman-fadar Rural R367 9/9/ Helmet $30.50 Anne Dunne N654 10/6/ Pants $13.75 Hat $11.00 Jim Feltz 20c Fake St D896 13/06/ $28.75 Boots $75.95

Second Normal Form Cust_ID Order _ID Date Product Cost Units Cust_ID 1 S345 31/12/ 2014 Football $20.00 2 Gloves $53.50 Whistle $5.00 S354 Socks $3.50 5 R367 9/9/ Helmet $30.50 3 N654 10/6/ Pants $13.75 Hat $11.00 4 D896 13/06/ $28.75 Boots $75.95 Cust_ID First_ Name Last_ Address Zone 1 John Murphy 123 Fake St Inner-city 2 Mary Byrne Kildaman-fadar Rural 3 Anne Dunne 4 Jim Feltz 20c Fake St

Second Normal Form (Continued) Cust_ ID Order _ID Date Product Units 1 S345 31/12/ 2014 2 3 S354 4 5 R367 9/9/ N654 10/6/ 6 7 D896 13/06/ 8 Cust_ ID First_ Name Last_ Address Zone 1 John Murphy 123 Fake St Inner-city 2 Mary Byrne Kildaman-fadar Rural 3 Anne Dunne 4 Jim Feltz 20c Fake St Product_ID Product_1 Cost_P1 1 Football $20.00 2 Gloves $53.50 3 Whistle $5.00 4 Socks $3.50 5 Helmet $30.50 6 Pants $13.75 7 Hat $11.00 8 Boots $75.95

Second Normal Form (Continued) Cust_ID Order _ID Product Units 1 S345 2 3 S354 4 5 R367 N654 6 7 D896 8 Cust_ ID First_ Name Last_ Address Zone 1 John Murphy 123 Fake St Inner-city 2 Mary Byrne Kildaman-fadar Rural 3 Anne Dunne 4 Jim Feltz 20c Fake St Order _ID Date S345 31/12/ 2014 S354 R367 09/09/ N654 10/6/ D896 13/06/ Product_ID Product_1 Cost_P1 1 Football $20.00 2 Gloves $53.50 3 Whistle $5.00 4 Socks $3.50 5 Helmet $30.50 6 Pants $13.75 7 Hat $11.00 8 Boots $75.95

Second Normal Form (Continued) Order _ID Product Units S345 1 2 3 S354 4 5 R367 N654 6 7 D896 8 Cust_ ID First_ Name Last_ Address Zone 1 John Murphy 123 Fake St Inner-city 2 Mary Byrne Kildaman-fadar Rural 3 Anne Dunne 4 Jim Feltz 20c Fake St Order _ID Cust_ ID S345 1 R367 2 N654 3 D896 4 Order _ID Date S345 31/12/ 2014 S354 R367 09/09/ N654 10/6/ D896 13/06/ Product_ID Product_1 Cost_P1 1 Football $20.00 2 Gloves $53.50 3 Whistle $5.00 4 Socks $3.50 5 Helmet $30.50 6 Pants $13.75 7 Hat $11.00 8 Boots $75.95

Summary of Second Normal Form (2NF) A database is in the second normal form when It satisfies the criteria for the first normal form Each non-candidate key is dependent on the whole candidate key (i.e. subsets of data across multiple rows are removed) Put differently, we have no partial dependencies via a concatenated key Takes advantage of reflexivity and augmentation

Moving to Third Normal Form Order _ID Product Units S345 1 2 3 S354 4 5 R367 N654 6 7 D896 8 Cust_ ID First_ Name Last_ Address Zone 1 John Murphy 123 Fake St Inner-city 2 Mary Byrne Kildaman-fadar Rural 3 Anne Dunne 4 Jim Feltz 20c Fake St Order _ID Cust_ ID S345 1 R367 2 N654 3 D896 4 Order _ID Date S345 31/12/ 2014 S354 R367 09/09/ N654 10/6/ D896 13/06/ Product_ID Product_1 Cost_P1 1 Football $20.00 2 Gloves $53.50 3 Whistle $5.00 4 Socks $3.50 5 Helmet $30.50 6 Pants $13.75 7 Hat $11.00 8 Boots $75.95

Moving to Third Normal Form Order _ID Product Units S345 1 2 3 S354 4 5 R367 N654 6 7 D896 8 Cust_ ID First_ Name Last_ Address 1 John Murphy 123 Fake St 2 Mary Byrne Kildaman-fadar 3 Anne Dunne 4 Jim Feltz 20c Fake St Order _ID Cust_ ID S345 1 R367 2 N654 3 D896 4 Order _ID Date S345 31/12/ 2014 S354 R367 09/09/ N654 10/6/ D896 13/06/ Address Zone 123 Fake St Inner-city 20c Fake St Kildaman-fadar Rural Product_ID Product_1 Cost_P1 1 Football $20.00 2 Gloves $53.50 3 Whistle $5.00 4 Socks $3.50 5 Helmet $30.50 6 Pants $13.75 7 Hat $11.00 8 Boots $75.95

Summary of Third Normal Form (3NF) A database is in the second normal form when It satisfies the criteria for the second normal form Each non-key attribute that depends on anything other than the entire primary key is removed (insertion anomalies are impossible) Put differently, we have no transitive dependencies via non-key attributes Takes advantage of transitivity

Readings Some more descriptions of normal forms http://databases.about.com/od/specificproducts/a/normalization.htm http://phlonx.com/resources/nf3/ http://www.bkent.net/Doc/simple5.htm