Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Database Fundamentals
Copyright: ©2005 by Elsevier Inc. All rights reserved. 1 Author: Graeme C. Simsion and Graham C. Witt Chapter 3 The Entity-Relationship Approach.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Database Design DB Chapter 5 J.G. Zheng June 29th 2005.
Database Design J.G. Zheng May 19 th Overview Entity Relationship Modeling Data modeling using Entity Relationship Diagram (ERD) Transforming.
The Relational Model DB Chapter 2 (and some from chapter 4, 5) J.G. Zheng June 27 th 2005.
The Relational Model J.G. Zheng May 15 th Introduction Edgar F. Codd, 1970 One sentence to explain relational database model: Data are organized.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Relational data integrity
Normal forms - 1NF, 2NF and 3NF
1 Term 2, 2004, Lecture 2, Normalisation - IntroductionMarian Ursu, Department of Computing, Goldsmiths College Normalisation Introduction.
Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
ITS232 Introduction To Database Management Systems
Functional Dependencies and Normalization for Relational Databases
Addition 1’s to 20.
25 seconds left…...
Week 1.
Modeling the Data: Conceptual and Logical Data Modeling
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Normalization I.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
1 Minggu 10, Pertemuan 19 Normalization (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Chapter 4: Logical Database Design and the Relational Model (Part II)
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Avoiding Database Anomalies
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Concepts of Database Management Sixth Edition Chapter 5 Database Design 1: Normalization.
1 A Guide to MySQL 2 Database Design Fundamentals.
1 A Guide to MySQL 2 Database Design Fundamentals.
BIS 360 – Lecture Eight Ch. 12: Database Design and Normalization.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u How to undertake process of normalization. u How to identify most commonly used normal.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Microsoft Access 2010 Chapter 11 Database Design.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 5 Part II.
Normalization ACSC 425 Database Management Systems.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Database Architecture Normalization. Purpose of Normalization A technique for producing a set of relations with desirable properties, given the data requirements.
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.
Lecture # 17 Chapter # 10 Normalization Database Systems.
Normalization.
A Guide to SQL, Eighth Edition
Database, tables and normal forms
A brief summary of database normalization
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Chapter 6 Normalization of Database Tables
Normalization – Part II
Chapter 14 Normalization.
Normalization February 28, 2019 DB:Normalization.
Sampath Jayarathna Cal Poly Pomona
Chapter 14 Normalization Pearson Education © 2009.
Presentation transcript:

Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4

2 Overview Normalization First three normal forms

3 Introduction/Review Two perspectives to design database E-R Diagram (top-down) Normalization (bottom-up) Normalization is a process of efficiently modeling data, by analyzing relationships between attributes The goal is to remove redundancy and anomaly Usually a table is divided into 2 or more tables Combining the two perspectives in practice

4 Normal Forms Normal forms are guidelines (steps) for the normalization process Unnormalized Form (UNF) 1st Normal Form (1NF) 2nd Normal Form (2NF) 3rd Normal Form (3NF) Boyce Codd Normal Form (BC/NF) 4th Normal Form (4NF) 5th Normal Form DK/NF Fewer anomalies... …but more tables Normalization

5 Normalization – 1NF A relation is in 1NF if it satisfies the definition of a relation Review: what are the characteristics of a relation? Particularly No repeating value sets (single value property)

6 Transforming to 1NF Row transformation (Figure 4.5 and 4.6 on page 287) UNF1NF

7 Higher Normal Forms Normal forms higher than 1NF deal with functional dependence Identify which normal form the table is by analyzing the functional dependence between attributes (fields)

8 Functional Dependence If each value of attribute A is associated with only one value of attribute B, we say A determines B Or, B is dependent on A Denoted as: A B Functional dependence describes relationships between attributes (not relations) Note: A (or B) could be a set of fields

9 Functional Dependence Examples Dependence example For each SSN, there is only one corresponding first name (or last name), so: SSN determines FirstName SSN FirstName Non-dependence example Each instructor teaches multiple courses, so: InstructorId does not determines CourseNumber

10 Functional Dependence and Keys By definition, primary key functionally determines all other attributes Primary key Surrogate key Composite primary key Dependency diagram ISBNTitlePubDateListPrice

11 Functional Dependency Exercise CustomerNum CustomerName? {Street, City, State} Zip? CustomerName Balance? State (?) Zip RepNum ( ? ) CustomerName

12 Normalization – 2NF A relation is in 2NF, if It is in 1 st normal formal, and All nonkey attributes must be functionally dependent on the whole primary key (Fully dependence) No partial dependence It also implies that a relation is in 2NF if the primary key is a single attribute

13 2NF Identify primary key (PK) If PK consists of only one field, then it is in 2NF If PK is a composite key, then analyze functional dependence between part of primary key and other non-key attributes

14 Normalization – 3NF A relation is in 3NF, if It is in 2 nd normal formal, and All attributes must, and only, be functionally dependent on candidate keys 3NF deals with [transitive dependence] A B C No transitive dependence

15 3NF Identify primary key (PK) and Look for transitive dependence

16 Some Practical Tips If there are attributes of two different entities in one table, there are usually anomalies To identify the normalization level, determine the primary key first; then look for partial dependence and transitive dependence

17 Normalization Exercise 1 Which normal form is the above table in? A. 1NF B. 2NF C. 3NF D. UNF

18 Normalization Exercise 2 Which normal form is the above table (2 nd one) in? A. 1NF B. 2NF C. 3NF D. UNF

19 Normalization Exercise 3 Which normal form is the above table (first one) in? 1NF 2NF 3NF UNF

20 Final database design with 3 tables

21 Summary