Normal Forms (Part 1) Steven Le ~ CS157B. Normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying.

Slides:



Advertisements
Similar presentations
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Advertisements

Shantanu Narang.  Background  Why and What of Normalization  Quick Overview of Lower Normal Forms  Higher Order Normal Forms.
Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
Boyce-Codd normal form (BCNF) Kai Zhu CS157B Professor: Dr. Lee.
Normal Forms By Christopher Archibald October 16 th 2007.
Relations The Relational Data Model John Sieg, UMass Lowell.
Chapter 8 Normal Forms Based on Functional Dependencies Deborah Costa Oct 18, 2007.
Need for Normalization
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Normalization I.
4 TH NORMAL FORM By: Karen McVay. REVIEW OF NFs 1NF  All values of the columns are atomic. That is, they contain no repeating values. 1NF  All values.
Databases 6: Normalization
1 Minggu 10, Pertemuan 19 Normalization (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
NORMALIZATION N. HARIKA (CSC).
Normalization II. Boyce–Codd Normal Form (BCNF) Based on functional dependencies that take into account all candidate keys in a relation, however BCNF.
Normalization Quiz Tao Li Grant Horntvedt. 1. Which of the following statements is true: a. Normal forms can be derived by inspecting the data in various.
Database Architecture The Relational Database Model.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design.
Lecture 12 Inst: Haya Sammaneh
Avoiding Database Anomalies
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
By Abdul Rashid Ahmad. E.F. Codd proposed three normal forms: The first, second, and third normal forms 1NF, 2NF and 3NF are based on the functional dependencies.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
THE RELATIONAL MODEL II IST 210: Organization of Data IST210 1.
©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach.
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.
R. J. Daigle Normalization Concepts CIS 507 Database Programming.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
1.  Database normalization is a design technique for structuring relational database tables.  More highly normalized tables reduce data duplication.
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!
Lecture 3 Functional Dependency and Normal Forms Prof. Sin-Min Lee Department of Computer Science.
Chapter 5.1 and 5.2 Brian Cobarrubia Database Management Systems II January 31, 2008.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
Functional dependencies and normalization 1 Normalization Functional dependencies NF + BCNF.
Brian Thoms.  Databases normalization The systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Dr. T. Y. Lin | SJSU | CS 157A | Fall 2015 Chapter 3 Database Normalization 1.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 5 Part II.
Normalization ACSC 425 Database Management Systems.
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
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
Normalization (Database Design)
Database Design Fundamentals
A brief summary of database normalization
1st, 2nd, 3rd Normal Forms Boyce-Codd Normal Form
Payroll Management System
Database Normalization
Database solutions The process of normalization Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology rooms:
Normalization Dale-Marie Wilson, Ph.D..
Normalization.
Presentation transcript:

Normal Forms (Part 1) Steven Le ~ CS157B

Normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain undesirable characteristics—insertion, update, and deletion anomalies—that could lead to a loss of data integrity.

In English: Normalization is a well-defined way to structure a database so that weird things don’t happen to your data when you use it

Normal Forms Edgar Codd, the inventor of the relational model, also introduced the concept of Normalization and Normal Forms (NF) Normal Forms are criteria for determining a table's degree of vulnerability to logical inconsistencies and anomalies

Edgar Codd Created First Normal Form (1NF) in 1970 Created Second Normal Form (2NF) and Third Normal Form (3NF) in 1971 With Raymond Boyce, created Boyce-Codd Normal Form (BCNF) in 1974

There also exists other Normal Forms invented by other people. These include 4NF, 5NF, and 6NF We will be looking at 1NF, 2NF, and 3NF

Normal Form Properties The higher the Normal Form a table has, the less vulnerable to inconsistencies and anomalies it is A table always meets the requirements of its Highest Normal Form (HNF), as well as all the requirements of all lower Normal Forms A table does not meet the requirements of Normal Forms higher than its HNF

Achieving a Normal Form is NOT step-wise i.e. 1NF -> 2NF -> 3NF Rather, you design the table to be around 3NF on the first try. This is usually the minimum for a table to be considered “Normalized”. Once there, it should be easier to achieve higher Normal Forms

Vocab Overview Superkey Candidate Key Primary Key Prime Attribute Dependency

Superkey a set of attributes of a relation variable for which it holds that in all relations assigned to that variable there are no two distinct tuples (rows) that have the same values for the attributes in this set

Candidate/Primary Key Candidate Key: Superkey with no proper subsets that are also superkeys Primary Key: Candidate Key with no NULL values Prime Attribute: Attribute part of the Candidate Key

Dependency X → A: The attribute set “X” determines set “A” Trivial Functional Dependency: X → Y is called trivial if Y is a subset of X

First Normal Form A table is said to be in First Normal Form if it faithfully represents a relation No repeating groups last NameFirst NameNickname CoddEdwardE-Money DavisBaronBoom Dizzle DavisBaronBD

Second Normal Form A table is 2NF if given any candidate key and any attribute that is not a constituent of a candidate key, the non-key attribute depends upon the whole of the candidate key rather than just a part of it

Person (Not 2NF)PetVeterinarian JohnCatDr. Howard JohnDogDr. Howard PaulBirdDr. Dre AndyCatDr. Dre Person (2NF)Pet JohnCat JohnDog PaulBird AndyCat Person (2NF)Veterinarian JohnDr. Howard PaulDr. Dre AndyDr. Dre

Third Normal Form A table is in 3NF if for each of its functional dependencies X → A, at least one of the following conditions holds: X contains A (that is, X → A is trivial functional dependency), or X is a superkey, or A is a prime attribute (i.e., A is contained within a candidate key)

Tournament (2NF)YearWinnerWinner DOB Peruvian Open1989Tom10/28/75 Westgate Masters1993Kurt6/9/69 Bolivian Open1986Tom10/28/75 Peruvian Open1993Blaire5/7/90 Tournament (3NF)YearWinner Peruvian Open1989Tom Westgate Masters1993Kurt Bolivian Open1986Tom Peruvian Open1993Blaire Player (3NF)Winner DOB Tom10/28/75 Kurt6/9/69 Blaire5/7/90

End Applause