Normalization Lite Pepper. Golden Rule Every attribute must depend upon the key, --- > 1NF the whole key, --- > 2NF and nothing but the key. -  3NF and.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

Normalization By Jason Park Fall 2005 CS157A. Database Normalization Database normalization is the process of removing redundant data from your tables.
Defined by Edgar Codd in 1970 Defined by Edgar Codd in 1970 Considered ingenious but impractical Considered ingenious but impractical Conceptually simple.
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.
Normalization What is it?
Athabasca University Under Development for COMP 200 Gary Novokowsky
Modeling the Data: Conceptual and Logical Data Modeling
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.
Introduction to Relational Database ISYS 464. Introduction to Relational Model Data is logically structured within relations. Each relation is a table.
Understand Normalization
Designing a Database Unleashing the Power of Relational Database Design.
Database Normalization Il-Han Yoo CS 157A Professor: Sin-Min Lee.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Project and Data Management Software
NORMALIZATION N. HARIKA (CSC).
Relation Decomposition A, A, … A 12n Given a relation R with attributes Create two relations R1 and R2 with attributes B, B, … B 12m C, C, … C 12l Such.
Database Normalization CP3410 Daryle Niedermayer, I.S.P., PMP.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
Normalization. Database Normalization Database normalization is the process of removing redundant data from your tables in to improve storage efficiency,
Cambridge TEC - Level 3 Certificate/Diploma IT. ICT Dept ScenarioLO1LO2LO3.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
The Relational Model and Normalization R. Nakatsu.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 4 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 4 Normalization.
Normalization Are we Normal. Normalization Normalization is the process of converting complex data structures into simple, stable data structures It also.
Module III: The Normal Forms. Edgar F. Codd first proposed the process of normalization and what came to be known as the 1st normal form. The database.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
Normalisation Rules and Practical Application Geoff Leese January 2010.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
Lecture9:Functional Dependencies and Normalization for Relational Databases Prepared by L. Nouf Almujally Ref. Chapter Lecture9 1.
Normal Forms through BCNF CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
1 5 Normalization. 2 5 Database Design Give some body of data to be represented in a database, how do we decide on a suitable logical structure for that.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
M1G Introduction to Database Development 4. Improving the database design.
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.
Announcements Reading for Monday –4.6 Homework 3 – Due 9/29.
Normalisation RELATIONAL DATABASES.  Last week we looked at elements of designing a database and the generation of an ERD  As part of the design and.
NORMALIZATION. What is Normalization  The process of effectively organizing data in a database  Two goals  To eliminate redundant data  Ensure data.
Understand Primary, Foreign, and Composite Keys Database Administration Fundamentals LESSON 4.2.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Postgresql East Philadelphia, PA Databases – A Historical Perspective.
Logical Database Design and the Relational Model.
RELATIONAL TABLE NORMALIZATION. Key Concepts Guidelines for Primary Keys Deletion anomaly Update anomaly Insertion anomaly Functional dependency Transitive.
Lecture 4: Logical Database Design and the Relational Model 1.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
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.
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.
Normal Forms 1NF – A table that qualifies as a relation is in 1NF. (Back)(Back) 2NF – A relation is in 2NF if all of its nonkey attributes are dependent.
Translating ER into Relations; Normalization
Database, tables and normal forms
Revised: 2 April 2004 Fred Swartz
CSIS 115 Database Design and Applications for Business
Database Normalization
Normalization Referential Integrity
Normalization By Jason Park Fall 2005 CS157A.
Relational Database Model
Normalization.
Normalization By Jason Park Fall 2005 CS157A.
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
BTEC ICT – Unit 18 With Mr Griffiths.
Presentation transcript:

Normalization Lite Pepper

Golden Rule Every attribute must depend upon the key, --- > 1NF the whole key, --- > 2NF and nothing but the key. -  3NF and BCNF

Forms Codd stated: –There is, in fact, a very simple elimination* procedure which we shall call normalization. Through decomposition nonsimple domains are replaced by "domains whose elements are atomic (nondecomposable) values."

1NF Eliminate duplicative columns from the same table. Every item has its own field. –(no name which is really first and last name) –(no phone1, phone 2, phone3) Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).

1NF example Table with: –Person –Favorite Color –Foods Not Eaten 1 –Foods Not Eaten 2 –Foods Not Eaten 3 How to fix this?

1NF example Table 1 with: –Person –Favorite Color Table 2 with –Person –Foods Not Eaten

2NF Meet all the requirements of the first normal form. Remove subsets of data that apply to multiple rows of a table and place them in separate tables. Create relationships between these new tables and their predecessors through the use of foreign keys. –Ex: Student address in the enrollment table – repeated for every course. Yes, student is part of the key, but not the full key When you notice data repeated in your table, pull it out into its own table

2NF problem Part's ID (primary key)Supplier's ID (primary key)Supplier's namePriceSupplier's address 652Stylized Parts$59.99VA 732Stylized Parts$20.00VA 651ACME Industries$49.99CA HOW TO FIX?

2NF solution Suppliers IDNameAddress 1ACME IndustriesCA 2Stylized PartsVA Part's ID (primary key)Supplier's ID (primary key)Price 652$ $ $49.99

3NF Meet all the requirements of the second normal form. Remove columns that are not dependent upon the primary key. –Same as 2NF, but looking at dependencies not on part of primary key Problem example: PART_NUMBER (PRIMARY KEY) MANUFACTURER_NAME MANUFACTURER_ADDRESS

3NF solution Table 1: –MANUFACTURER_NAME (PRIMARY KEY) –MANUFACTURER_ADDRESS Table 2: –PART_NUMBER (PRIMARY KEY) – MANUFACTURER_NAME (FOREIGN KEY)

BCNF the key uniquely identifies a row, but the key includes more columns than are actually required to uniquely identify a row, then no good Consider: CREATE TABLE t_employees1 ( employee_id INT IDENTITY, last_name VARCHAR(25) NOT NULL, first_name VARCHAR(25) NOT NULL CONSTRAINT XPKt_employees1 PRIMARY KEY (employee_id, last_name, first_name))

BCNF solution CREATE TABLE t_employees1 ( employee_id INT IDENTITY, last_name VARCHAR(25) NOT NULL, first_name VARCHAR(25) NOT NULL CONSTRAINT XPKt_employees1 PRIMARY KEY (employee_id))

4NF Meet all the requirements of the third normal form. A relation is in 4NF if it has no multi-valued dependencies Problem table: (employees have different combinations of qualifications and training courses) –EMPLOYEE_ID –QUALIFICATION_ID –TRAINING_COURSE_ID

4NF Solution employee_qualification table: –EMPLOYEE_ID –QUALIFICATION_ID employee_training_course table: –EMPLOYEE_ID –TRAINING_COURSE_ID But this is ok: –EMPLOYEE_ID –DEGREE_ID –UNIVERSITY_ID

Golden rules Don’t repeat data Watch empty fields Don’t have summary fields in tables – leave them in the detail and calculate them Every field should rely on the full primary key