The Relational Model and Normalization

Size: px
Start display at page:

Download "The Relational Model and Normalization"

Transcription

1 The Relational Model and Normalization 1. Introduction 2 2. Relational Model Terminology 3 4. Normal Forms Multi-valued Dependency The Fifth Normal Form 22

2 The Relational Model and Normalization 1. Introduction Questions? - Should we store these two tables as they are, or - Should we combine them into one table in our new database? We need to understand: - The relational model - Relational model terminology

3 2. Relational Model Terminology Relational Model - Introduced in 1970 Created by E.F. Codd - He was an IBM engineer - The model used mathematics known as "relational algebra" Now the standard model for commercial DBMS products The most Important Terms used by the Relational Model Entity Relation Functional Dependency Determinant Candidate Key Composite Key Primary Key Surrogate Key Foreign Key Referential integrity constraint Normal Form Multivalued Dependency (1) Entity An entity is some identifiable thing that users want to track: - Customers - Computers - Sales

4 (2) Relation A Relation : - Figure 3-5 : Tables that are not relations (a) Table with Multiple entries per cell (b) Table with Required Row order - Alternative Terminology

5 (3) Functional Dependency A functional dependency occurs when the value of one (a set of) attribute(s) determines the value of a second (set of) attribute(s): StudentID StudentName StudentID (DormName, DormRoom, Fee) X Y : If the value of X determines the value of Y, attribute Y is functionally dependent on attribute X Determinant - The attribute on the left side of the functional dependency is called the determinant - Functional dependencies may be based on equations: ExtendedPrice = Quantity X UnitPrice (Quantity, UnitPrice) ExtendedPrice - Function dependencies are not equations! Composite Determinant - A determinant of a functional dependency that consists of more than one attribute (StudentName, ClassName) (Grade) Functional Dependency Rule 1 If X (Y, Z), then X Y and X Z 2 But, If (X, Y) Z, it is not true X Y and Y Z neither X nor Y determines Z by itself

6 Formal Description Let R be a relation schema α R, β R The functional dependency α β holds on R if and only if for any legal relation r(r), whenever any two tuples t1 and t2 of r agree on the attributes α, they also agree on the attributes on the β That is, t1[α] = t2[α] t1[β] = t2[β] l Example : Supplier Relation S# (SNAME, STATUS, CITY) S# SNAME STATUS CITY Smith 20 London S2 Jones 10 Paris S3 Blake 30 Paris S4 Clark 20 London S5 Adams 30 Athens S# FD diagram SNAME STATUS CITY Finding Functional Dependency in SKU_DATA Relation SKU (SKU_Description, Department, Buyer) SKU_Description (SKU, Department, Buyer) Buyer Department

7 Finding Functional Dependency in Order_ITEM Relation (OrderNumber, SKU) (Quantity, Price, ExtendedPrice) (Quantity, Price) (ExtendedPrice) SKU PRICE (the price can be changed after an order has been processed) What Are Determinant Values Unique? A determinant is unique in a relation if, and only if, it determines every other column in the relation You cannot find the determinants of all functional dependencies simply by looking for unique values in one column: - Data set limitations - Must be logically a determinant To determine if attribute A determines attribute B "Every time that a value of attribute A appears is it mateched with the same value of attribute B?" - sample data can be incomplete

8 Keys Key A group of one or more attributes that uniquely identifies a row K is a super key for relation schema R if and only if K R (uniqueness property) K is candidate key for R if and only if K R and there is no α K, α R ( minimality property) A primary key is a candidate key selected as the primary means of identifying rows in a relation: - There is one and only one primary key per relation - The primary key may be a composite key There is at least one candidate key - because relations do not contain duplicate tuples - at least the combination of all attributes of the relation has the uniqueness property A surrogate key as an artificial column added to a relation to serve as a primary key: A foreign key is the primary key of one relation that is placed in another relation to form a link between the relations: - A foreign key can be a single column or a composite key - The term refers to the fact that key values are foreign to the relation in which they appear as foreign key values DEPARTMENT (DepartmentName, BudgetCode, ManagerName) EMPLOYEE(EmployeeNumber,EmployeeName, DepartmentName)

9 Definition of Foreign Key Let R2 be a base relation. Then foreign key in R2 is a subset of the set of attributes of R2, say FK, such that 1 There exists a base relation R1 with a candidate key CK, (R1 and R2 not necessarily distinct) 2 For all time, each value of FK in the current value of R2 is identical to the value of CK in some tuple in the current value of R1 R1 CK R2 FK Referential Integrity Rule The database must not contain any unmatched foreign key values If B references A, A must exist "foreign key" and "referential integrity" are defined in terms of each other Database Designer - specify which operations should be rejected - specify which compensating operations should be performed What should happen on an attempt to delete the target of a foreign key reference? RESTRICTED : "restricted" to the case where there are no matching. CASCADES : " cascades" to delete those matching also

10 Nulls - as a basis for dealing with the problem of missing information - "date of birth unknown","to be announced" - Nulls are not the same as blank or zero three valued logic AND True False unknown True True False unknown False False False False unknown Unknown False unknown OR True False unknown True True True True False True False unknown unknown True unknown unknown l Entity Integrity Rule No component of the primary key of a base relation is allowed to accept nulls. definition of every attribute involved in primary key must include the specification NULLS NOT ALLOWED l Integrity Rules - Summary Referential Integrity Rule Entity Integrity Rule

11 4. Normal Forms Modification Anomalies update anomaly (before update) (after update) Deletion Anomaly - To lose facts that tow different things, ( a machine and a repair) - If you delete a tuple that has the item number 200 or 300 Insertion Anomaly Primary Key :( OrderNumber, SKU) - We assume that situation when we are going to insert the fact that related with only the SKU ( SKU, SKU_Descripion, Department, Buyer) - Is it possible?

12 Normalization Theory All Possible Relational Schema Repetition of information Inability to represent certain information Inefficient retrieval and update performance Normalization Good Database Design Relations are categorized as a normal form based on which modification anomalies or other problems that they are subject to:

13 Normalization Category 1NF - A table that qualifies as a relation is in 1NF 2NF - A relation is in 2NF if all of its nonkey attributes are dependent on all of the primary key 3NF - A relation is in 3NF if it is in 2NF and has no determinants except the primary key - The relation R is 3NF iff it is 2NF and has no transitive dependencies Boyce-Codd Normal Form (BCNF) - A relation is in BCNF if every determinant is a candidate key Eliminating Anomalies from Functional Dependencies Put all relations into Boyce-Codd Normal Form (BCNF):

14 Eliminating Anomalies from Functional Dependencies : Example 1 (page 84) - SKU_DATA relation FDs SKU (SKU_Description, Department, Buyer) SKU_Description (SKU, Department, Buyer) Buyer Department SKU and SKU_Description ; all of the attributes in the table, so they are candidate keys Buyer ; It does not determine all of the other attributes Hence, the SKU_DATA relation is not in BCNF Step 3-A in Figure 3-11 : Step 3-B : make the Buyer attribute the primary key BUYER(Buyer, Department) Step 3-C and 3-D : SKU_DATA_2(SKU, SKU_Description, Buyer)

15 [Report #3] Describe the whole process of below examples and write your explanation and PKs, FKs of the decomposed relations for each step of process for putting a relation into BCNF. 1) Eliminating Anomalies from Functional Dependencies : Example 2 (page 85) 2) Eliminating Anomalies from Functional Dependencies : Example 3 (page 86) 3) Eliminating Anomalies from Functional Dependencies : Example 4 (page 87) 4) Eliminating Anomalies from Functional Dependencies : Example 5 (page 89)

16 Theoretical Approach : The First Normal Form definition - Any table of data that meets the definition of a relation Formal Definition A relation is in 1NF iff all underlying domains contain scalar values only Example " 상태 20 인도시 런던 에위치한공급자 이부품 P1 을 300 개공급한다 S# STATUS CITY 20 London 20 London 20 London 20 London S2 10 Paris S2 10 Paris S3 10 Paris P# P1 P2 P3 P4 P1 P2 P2 QTY S5 40 Athens P4 100 S# P# QTY CITY STATUS l Anomalies in 1NF 3 Insertion Anomaly New Supplier without P# 4 Deletion Anomaly Unexpected loss of bundled information 5 Update Anomaly FIRST London Paris redundancy S# STATUS CITY P# QTY 20 London P London P London P London P4 200 S2 10 Paris P1 300 S2 10 Paris P2 400 S3 90 New York P2 200 S5 40 Athens P4 100 S6 70 Florence Null Null

17 l Solution Decomposition First SECOND(S#, STATUS, CITY), SP(S#, P#, QTY) l Nonloss(lossless decomposition) - Reversibility S S# STATUS CITY S3 30 Paris S5 30 Athens nonloss S# STATUS S3 30 S5 30 SC S# CITY S3 Paris S5 Athens lossy S# STATUS S3 30 S5 30 STC STATUS CITY 30 Paris 30 Athens l test for the lossless decomposition nonloss (a) SST S# STATUS SC S# CITY S# STATUS CITY S S3 30 S3 Paris S3 30 Paris S5 30 S5 Athens S5 30 Athens lossy (b) SST S# STATUS STC STATUS CITY S# STATUS CITY S S Paris S3 30 Paris S Athens S3 30 Athens S5 30 Paris S5 30 Athens

18 l Decomposition : In a view of functional dependency S S# STATUS CITY S3 30 Paris S5 30 Athens S# S# STATUS S# S# CITY CITY (a) SST S# STATUS S3 30 S5 30 SC S# CITY S3 Paris S5 Athens S# S# STATUS S# S# CITY CITY (b) SST We cannot tell which supplier has which city S# STATUS S3 30 S5 30 STC STATUS CITY 30 Paris 30 Athens S# STATUS S# STATUS S# CITY is lost l Heath's Theorem Let R(A, B, C) be a Relation, where A, B, C are set of attributes, - If R satisfies the FD A B, - then R is equal to join of its projections on R(A, B) and R(B, C) l First SECOND(S#, STATUS, CITY), SP(S#, P#, QTY) SECOND S# S2 S3 S5 STATUS CITY 20 London 10 Paris 10 Paris 40 Athens SP S# P# QTY P1 300 P2 200 P3 400 P4 200 S2 P1 300 S2 P2 400 S3 P2 200 S5 P4 100

19 Theoretical Approach : The Second Normal Form l Definition - R is in 2NF When all of a relation's nonkey attributes are dependent of a key l Formal Definition A relation R is in 2NF if and only if - 1NF - Every non-key attribute is irreducibly(fully) dependent on the primary key Anomaly in 2NF Insertion Anomaly - Insertion {Florence, Italy} Deletion Anomaly - Deletion of tuple : Unexpected loss of bundled information Update Anomaly SECOND S# S2 S3 S5 STATUS CITY 20 London 10 Paris 10 Paris 40 Athens S# CITY STATUS Because, Transitive Dependency Decomposition SECOND(S#, STATUS, CITY) decomposition SC(S#, STATUS), CS(CITY, STATUS) SC S# CITY CITY STATUS CS London Athens 30 S2 Paris London 20 S3 Paris Paris 10 S5 Athens Rome 50

20 Theoretical Approach : The Third Normal Form Definition The relation R is 3NF iff it is 2NF and has no transitive dependencies Formal Definition - 2NF - Every non-key attribute is non-transitively(no mutual dependency) on the primary key Anomaly in 3NF 3NF o w S Smith Smith Jones Jones Semantic constraints J Math Physics Math Physics T Prof. White Prof. Green Prof. White Prof. Brown S J T Two candidate keys : {S,J}, {S, T} w For each subject, each student of that subject is taught by only one teacher { S, J } T w Each teacher teaches only one subject T J w Each subject is taught by several teachers Anomaly w Jones drops the physics w delete the last tuple w we loss the information Prof. Brown teaches Physic Solution : Decomposition - SJT ST(S, T), TJ((T, J) - BCNF(Boyce-Codd Normal Form)

21 5. Multi-valued Dependency A multi-valued dependency occurs when a determinant determines a particular set of values: Employee Degree Employee Sibling PartKit Part The determinant of a multivalued dependency can never be a primary key Multivalued dependencies are not a problem if they are in a separate relation, so: - Always put multivaled dependencies into their own relation - This is known as Fourth Normal Form (4NF)

22 A relation is in 4NF iff, for all multi-valued dependency A B, non-key attributes are dependent on A C T B database database Prof. White Prof. White Korth Ullman database Prof. White Prof. Green Korth Ullman database Prof. Green Korth database Prof. Green Ullman insertion C T C B database Prof. Sara Ullman database Prof. Sara Korth 6. The Fifth Normal Form A relation is in 5NF iff, for all join dependency (R 1, R 2,..., R n ), R 1, R 2,, R n is a candidate key S# P# P1 P2 J# J2 J1 S2 P1 J1 P1 J1 S# P# P1 P2 P# P1 P2 J# J2 J1 S# J# J2 J1 S# P# P1 P2 P# P1 P2 J# J2 J1 S# J# J2 J1 S2 P1 P1 J1 S2 J1 P1 J1

23 [Report #4] 1. make the relation that is the result of join on the relation CUSTOMER and ORDER. CUSTOMER (Cid, Name, Address) Cid (Name, Address, zipcode) Address Zipcode ORDER (BookNumber, Cid, Price, Orderdate) (BookNumber, Cid) (Price, Orderdate) 2. Write a detail process the following problems. (1) Describe the FDs in result relation 1 and illustrate the anomaly (2) Transform into the second Normal Form (3) Transform into the third Normal Form (4) Transform into the BCNF (5) make sure that result of (4) is the same as the result of problem 1

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization Chapter Objectives To understand basic relational terminology

More information

Database Systems Relational Model. A.R. Hurson 323 CS Building

Database Systems Relational Model. A.R. Hurson 323 CS Building Relational Model A.R. Hurson 323 CS Building Relational data model Database is represented by a set of tables (relations), in which a row (tuple) represents an entity (object, record) and a column corresponds

More information

Relational Design: Characteristics of Well-designed DB

Relational Design: Characteristics of Well-designed DB 1. Minimal duplication Relational Design: Characteristics of Well-designed DB Consider table newfaculty (Result of F aculty T each Course) Id Lname Off Bldg Phone Salary Numb Dept Lvl MaxSz 20000 Cotts

More information

Normalization Rule. First Normal Form (1NF) Normalization rule are divided into following normal form. 1. First Normal Form. 2. Second Normal Form

Normalization Rule. First Normal Form (1NF) Normalization rule are divided into following normal form. 1. First Normal Form. 2. Second Normal Form Normalization Rule Normalization rule are divided into following normal form. 1. First Normal Form 2. Second Normal Form 3. Third Normal Form 4. BCNF First Normal Form (1NF) As per First Normal Form, no

More information

Chapter 4. The Relational Model

Chapter 4. The Relational Model Chapter 4 The Relational Model Chapter 4 - Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations and relations in the relational model.

More information

Normalization. Murali Mani. What and Why Normalization? To remove potential redundancy in design

Normalization. Murali Mani. What and Why Normalization? To remove potential redundancy in design 1 Normalization What and Why Normalization? To remove potential redundancy in design Redundancy causes several anomalies: insert, delete and update Normalization uses concept of dependencies Functional

More information

UNIT 3 DATABASE DESIGN

UNIT 3 DATABASE DESIGN UNIT 3 DATABASE DESIGN Objective To study design guidelines for relational databases. To know about Functional dependencies. To have an understanding on First, Second, Third Normal forms To study about

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 14 Basics of Functional Dependencies and Normalization for Relational Databases Slide 14-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1 Semantics of the Relation Attributes

More information

CS 338 Functional Dependencies

CS 338 Functional Dependencies CS 338 Functional Dependencies Bojana Bislimovska Winter 2016 Outline Design Guidelines for Relation Schemas Functional Dependency Set and Attribute Closure Schema Decomposition Boyce-Codd Normal Form

More information

Supplier-Parts-DB SNUM SNAME STATUS CITY S1 Smith 20 London S2 Jones 10 Paris S3 Blake 30 Paris S4 Clark 20 London S5 Adams 30 Athens

Supplier-Parts-DB SNUM SNAME STATUS CITY S1 Smith 20 London S2 Jones 10 Paris S3 Blake 30 Paris S4 Clark 20 London S5 Adams 30 Athens Page 1 of 27 The Relational Data Model The data structures of the relational model Attributes and domains Relation schemas and database schemas (decomposition) The universal relation schema assumption

More information

Draw A Relational Schema And Diagram The Functional Dependencies In The Relation >>>CLICK HERE<<<

Draw A Relational Schema And Diagram The Functional Dependencies In The Relation >>>CLICK HERE<<< Draw A Relational Schema And Diagram The Functional Dependencies In The Relation I need to draw relational schema and dependency diagram showing transitive and partial Functional dependency and normalization

More information

Steps in normalisation. Steps in normalisation 7/15/2014

Steps in normalisation. Steps in normalisation 7/15/2014 Introduction to normalisation Normalisation Normalisation = a formal process for deciding which attributes should be grouped together in a relation Normalisation is the process of decomposing relations

More information

Redundancy:Dependencies between attributes within a relation cause redundancy.

Redundancy:Dependencies between attributes within a relation cause redundancy. Normalization Normalization: It is the process of removing redundant data from your tables in order to improve storage efficiency, data integrity and scalability. This improvement is balanced against an

More information

Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2

Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2 Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant

More information

customer = (customer_id, _ customer_name, customer_street,

customer = (customer_id, _ customer_name, customer_street, Relational Database Design COMPILED BY: RITURAJ JAIN The Banking Schema branch = (branch_name, branch_city, assets) customer = (customer_id, _ customer_name, customer_street, customer_city) account = (account_number,

More information

Chapter 10. Normalization. Chapter Outline. Chapter Outline(contd.)

Chapter 10. Normalization. Chapter Outline. Chapter Outline(contd.) Chapter 10 Normalization Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant Information in Tuples and Update Anomalies 1.3 Null

More information

IS 263 Database Concepts

IS 263 Database Concepts IS 263 Database Concepts Lecture 4: Normalization Instructor: Henry Kalisti 1 Department of Computer Science and Engineering Limitations of E- R Designs Provides a set of guidelines, does not result in

More information

Relational Model. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Relational Model. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan Relational Model DCS COMSATS Institute of Information Technology Rab Nawaz Jadoon Assistant Professor COMSATS IIT, Abbottabad Pakistan Management Information Systems (MIS) Relational Model Relational Data

More information

begin [atomic] operation, operation, { commit rollback} end

begin [atomic] operation, operation, { commit rollback} end Set Processing Languages standard, simple data structure RELATION abstracted retrievals RELATIONAL ALGEBRA abstracted updating INSERT, DELETE, UPDATE transaction indivisible set of active operations begin

More information

Database Design Theory and Normalization. CS 377: Database Systems

Database Design Theory and Normalization. CS 377: Database Systems Database Design Theory and Normalization CS 377: Database Systems Recap: What Has Been Covered Lectures 1-2: Database Overview & Concepts Lecture 4: Representational Model (Relational Model) & Mapping

More information

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database? DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS Complete book short Answer Question.. QUESTION 1: What is database? A database is a logically coherent collection of data with some inherent meaning, representing

More information

Normalisation Chapter2 Contents

Normalisation Chapter2 Contents Contents Objective... 64 Superkey & Candidate Keys... 65 Primary, Alternate and Foreign Keys... 65 Functional Dependence... 67 Using Instances... 70 Normalisation Introduction... 70 Normalisation Problems...

More information

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 19 Relational Database Design (Contd.) Welcome to module

More information

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases Chapter 10 Functional Dependencies and Normalization for Relational Databases Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant

More information

The strategy for achieving a good design is to decompose a badly designed relation appropriately.

The strategy for achieving a good design is to decompose a badly designed relation appropriately. The strategy for achieving a good design is to decompose a badly designed relation appropriately. Functional Dependencies The single most important concept in relational schema design theory is that of

More information

Databases -Normalization I. (GF Royle, N Spadaccini ) Databases - Normalization I 1 / 24

Databases -Normalization I. (GF Royle, N Spadaccini ) Databases - Normalization I 1 / 24 Databases -Normalization I (GF Royle, N Spadaccini 2006-2010) Databases - Normalization I 1 / 24 This lecture This lecture introduces normal forms, decomposition and normalization. We will explore problems

More information

In This Lecture. Normalisation to BCNF. Lossless decomposition. Normalisation so Far. Relational algebra reminder: product

In This Lecture. Normalisation to BCNF. Lossless decomposition. Normalisation so Far. Relational algebra reminder: product In This Lecture Normalisation to BCNF Database Systems Lecture 12 Natasha Alechina More normalisation Brief review of relational algebra Lossless decomposition Boyce-Codd normal form (BCNF) Higher normal

More information

Chapter 6: Relational Database Design

Chapter 6: Relational Database Design Chapter 6: Relational Database Design Chapter 6: Relational Database Design Features of Good Relational Design Atomic Domains and First Normal Form Decomposition Using Functional Dependencies Second Normal

More information

Schema Refinement: Dependencies and Normal Forms

Schema Refinement: Dependencies and Normal Forms Schema Refinement: Dependencies and Normal Forms Grant Weddell Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Spring 2016 CS 348 (Intro to DB Mgmt)

More information

CS211 Lecture: Database Design

CS211 Lecture: Database Design CS211 Lecture: Database Design Objectives: last revised November 21, 2006 1. To introduce the anomalies that result from redundant storage of data 2. To introduce the notion of functional dependencies

More information

Fig. 7.1 Levels of normalization

Fig. 7.1 Levels of normalization 7 Normalization 7.1 INTRODUCTION The concept of normalization was introduced in Section 3.2. A normalized relation may be defined as one for which each of the, underlying domains contains atomic (nondecomposable)

More information

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies Chapter 14 Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies Copyright 2012 Ramez Elmasri and Shamkant B. Navathe Chapter Outline 1 Informal Design Guidelines

More information

Databases 1. Daniel POP

Databases 1. Daniel POP Databases 1 Daniel POP Week 6 & 7 Agenda Introduction to normalization Functional dependencies 1NF 2NF 3NF. Transitive dependencies BCNF 4NF. Multivalued dependencies 5NF De-normalization Normalization

More information

Schema Refinement: Dependencies and Normal Forms

Schema Refinement: Dependencies and Normal Forms Schema Refinement: Dependencies and Normal Forms M. Tamer Özsu David R. Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Fall 2012 CS 348 Schema Refinement

More information

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 9 Normalizing Database Designs NORMALIZATION What is normalization? Normalization is a procedure that is

More information

Informal Design Guidelines for Relational Databases

Informal Design Guidelines for Relational Databases Outline Informal Design Guidelines for Relational Databases Semantics of the Relation Attributes Redundant Information in Tuples and Update Anomalies Null Values in Tuples Spurious Tuples Functional Dependencies

More information

Schema Refinement: Dependencies and Normal Forms

Schema Refinement: Dependencies and Normal Forms Schema Refinement: Dependencies and Normal Forms Grant Weddell David R. Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Spring 2012 CS 348 (Intro to

More information

Unit 3 : Relational Database Design

Unit 3 : Relational Database Design Unit 3 : Relational Database Design Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Content Relational Model: Basic concepts, Attributes and Domains, CODD's Rules, Relational

More information

Learning outcomes. On successful completion of this unit you will: 1. Understand data models and database technologies.

Learning outcomes. On successful completion of this unit you will: 1. Understand data models and database technologies. 2015-2016 Phil Smith Learning outcomes On successful completion of this unit you will: 1. Understand data models and database technologies. (Assignment 1) Recap and setting the scene Before we get to Normalisation

More information

Functional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys)

Functional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys) 1 / 13 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant d Information in Tuples and Update Anomalies 1.3 Null Values in Tuples 1.4 Spurious Tuples

More information

V. Database Design CS448/ How to obtain a good relational database schema

V. Database Design CS448/ How to obtain a good relational database schema V. How to obtain a good relational database schema Deriving new relational schema from ER-diagrams Normal forms: use of constraints in evaluating existing relational schema CS448/648 1 Translating an E-R

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 6 Normalization of Database Tables

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 6 Normalization of Database Tables Database Systems: Design, Implementation, and Management Tenth Edition Chapter 6 Normalization of Database Tables Objectives In this chapter, students will learn: What normalization is and what role it

More information

Relational Database design. Slides By: Shree Jaswal

Relational Database design. Slides By: Shree Jaswal Relational Database design Slides By: Shree Jaswal Topics: Design guidelines for relational schema, Functional Dependencies, Definition of Normal Forms- 1NF, 2NF, 3NF, BCNF, Converting Relational Schema

More information

Chapter 3. The Relational database design

Chapter 3. The Relational database design Chapter 3 The Relational database design Chapter 3 - Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations and relations in the relational

More information

This lecture. Databases -Normalization I. Repeating Data. Redundancy. This lecture introduces normal forms, decomposition and normalization.

This lecture. Databases -Normalization I. Repeating Data. Redundancy. This lecture introduces normal forms, decomposition and normalization. This lecture Databases -Normalization I This lecture introduces normal forms, decomposition and normalization (GF Royle 2006-8, N Spadaccini 2008) Databases - Normalization I 1 / 23 (GF Royle 2006-8, N

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Spring 2013 An Introductory Course on Database Systems http://www.it.uu.se/edu/course/homepage/dbastekn/vt13/ Uppsala Database Laboratory Department of Information Technology,

More information

Introduction to Relational Databases. Introduction to Relational Databases cont: Introduction to Relational Databases cont: Relational Data structure

Introduction to Relational Databases. Introduction to Relational Databases cont: Introduction to Relational Databases cont: Relational Data structure Databases databases Terminology of relational model Properties of database relations. Relational Keys. Meaning of entity integrity and referential integrity. Purpose and advantages of views. The relational

More information

Chapter 14 Outline. Normalization for Relational Databases: Outline. Chapter 14: Basics of Functional Dependencies and

Chapter 14 Outline. Normalization for Relational Databases: Outline. Chapter 14: Basics of Functional Dependencies and Ramez Elmasri, Shamkant B. Navathe(2016) Fundamentals of Database Systems (7th Edition), pearson, isbn 10: 0-13-397077-9;isbn-13:978-0-13-397077-7. Chapter 14: Basics of Functional Dependencies and Normalization

More information

Chapter 7: Relational Database Design

Chapter 7: Relational Database Design Chapter 7: Relational Database Design Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 7: Relational Database Design Features of Good Relational Design Atomic Domains

More information

Edited by: Nada Alhirabi. Normalization

Edited by: Nada Alhirabi. Normalization Edited by: Nada Alhirabi Normalization Normalization:Why do we need to normalize? 1. To avoid redundancy (less storage space needed, and data is consistent) Ssn c-id Grade Name Address 123 cs331 A smith

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Autumn 2012 An Introductory Course on Database Systems http://www.it.uu.se/edu/course/homepage/dbastekn/ht12/ Uppsala Database Laboratory Department of Information Technology,

More information

Dr. Anis Koubaa. Advanced Databases SE487. Prince Sultan University

Dr. Anis Koubaa. Advanced Databases SE487. Prince Sultan University Advanced Databases Prince Sultan University College of Computer and Information Sciences Fall 2013 Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases Anis Koubaa SE487

More information

Database Normalization. (Olav Dæhli 2018)

Database Normalization. (Olav Dæhli 2018) Database Normalization (Olav Dæhli 2018) 1 What is normalization and why normalize? Normalization: A set of rules to decompose relations (tables) into smaller relations (tables), without loosing any data

More information

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION JING YANG 2010 FALL Class 3: The Relational Data Model and Relational Database Constraints Outline 2 The Relational Data Model and Relational Database Constraints

More information

8) A top-to-bottom relationship among the items in a database is established by a

8) A top-to-bottom relationship among the items in a database is established by a MULTIPLE CHOICE QUESTIONS IN DBMS (unit-1 to unit-4) 1) ER model is used in phase a) conceptual database b) schema refinement c) physical refinement d) applications and security 2) The ER model is relevant

More information

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1 COSC344 Database Theory and Applications σ a= c (P) S P Lecture 3 The Relational Data π A, C (H) Model COSC344 Lecture 3 1 Overview Last Lecture Database design ER modelling This Lecture Relational model

More information

Databases Tutorial. March,15,2012 Jing Chen Mcmaster University

Databases Tutorial. March,15,2012 Jing Chen Mcmaster University Databases Tutorial March,15,2012 Jing Chen Mcmaster University Outline 1NF Functional Dependencies BCNF 3NF Larger Schema Suppose we combine borrower and loan to get bor_loan - borrower = (customer_id,

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Autumn 2012 An Introductory Course on Database Systems http://www.it.uu.se/edu/course/homepage/dbastekn/ht12/ Uppsala Database Laboratory Department of Information Technology,

More information

Normalisation. Normalisation. Normalisation

Normalisation. Normalisation. Normalisation Normalisation Normalisation Main objective in developing a logical data model for relational database systems is to create an accurate and efficient representation of the data, its relationships, and constraints

More information

Relational Database Design (II)

Relational Database Design (II) Relational Database Design (II) 1 Roadmap of This Lecture Algorithms for Functional Dependencies (cont d) Decomposition Using Multi-valued Dependencies More Normal Form Database-Design Process Modeling

More information

Relational Model. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011

Relational Model. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011 Relational Model IT 5101 Introduction to Database Systems J.G. Zheng Fall 2011 Overview What is the relational model? What are the most important practical elements of the relational model? 2 Introduction

More information

CMU SCS CMU SCS CMU SCS CMU SCS whole nothing but

CMU SCS CMU SCS CMU SCS CMU SCS whole nothing but Faloutsos & Pavlo 15-415/615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications Lecture #17: Schema Refinement & Normalization - Normal Forms (R&G, ch. 19) Overview - detailed

More information

Logical Database Design Normalization

Logical Database Design Normalization Chapter Four Logical Database Design Normalization Objectives Recalling Relational concepts Understand different anomalies and functional dependency concepts Use normalization to convert anomalous tables

More information

Chapter 8: Relational Database Design

Chapter 8: Relational Database Design Chapter 8: Relational Database Design Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 8: Relational Database Design Features of Good Relational Design Atomic Domains

More information

CSCI 403: Databases 13 - Functional Dependencies and Normalization

CSCI 403: Databases 13 - Functional Dependencies and Normalization CSCI 403: Databases 13 - Functional Dependencies and Normalization Introduction The point of this lecture material is to discuss some objective measures of the goodness of a database schema. The method

More information

The Basic (Flat) Relational Model. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

The Basic (Flat) Relational Model. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley The Basic (Flat) Relational Model Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 Outline The Relational Data Model and Relational Database Constraints Relational

More information

Lecture 11 - Chapter 8 Relational Database Design Part 1

Lecture 11 - Chapter 8 Relational Database Design Part 1 CMSC 461, Database Management Systems Spring 2018 Lecture 11 - Chapter 8 Relational Database Design Part 1 These slides are based on Database System Concepts 6th edition book and are a modified version

More information

Unit IV. S_id S_Name S_Address Subject_opted

Unit IV. S_id S_Name S_Address Subject_opted Page no: 1 Unit IV Normalization of Database Database Normalizations is a technique of organizing the data in the database. Normalization is a systematic approach of decomposing tables to eliminate data

More information

Dr. Lyn Mathis Page 1

Dr. Lyn Mathis Page 1 CSIS 3222, Fall 2008, Chapter 1, 3, 4, 5 (through p. 128) Name (Six Pages) Part I: MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. (3 points each)

More information

CSC 742 Database Management Systems

CSC 742 Database Management Systems CSC 742 Database Management Systems Topic #5: Relational Model Spring 2002 CSC 742: DBMS by Dr. Peng Ning 1 Motivation A relation is a mathematical abstraction for a table The theory of relations provides

More information

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Overview - detailed. Goal. Faloutsos & Pavlo CMU SCS /615

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Overview - detailed. Goal. Faloutsos & Pavlo CMU SCS /615 Faloutsos & Pavlo 15-415/615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications Lecture #17: Schema Refinement & Normalization - Normal Forms (R&G, ch. 19) Overview - detailed

More information

DBMS. Relational Model. Module Title?

DBMS. Relational Model. Module Title? Relational Model Why Study the Relational Model? Most widely used model currently. DB2,, MySQL, Oracle, PostgreSQL, SQLServer, Note: some Legacy systems use older models e.g., IBM s IMS Object-oriented

More information

CS2300: File Structures and Introduction to Database Systems

CS2300: File Structures and Introduction to Database Systems CS2300: File Structures and Introduction to Database Systems Lecture 9: Relational Model & Relational Algebra Doug McGeehan 1 Brief Review Relational model concepts Informal Terms Formal Terms Table Relation

More information

Relational Design Theory. Relational Design Theory. Example. Example. A badly designed schema can result in several anomalies.

Relational Design Theory. Relational Design Theory. Example. Example. A badly designed schema can result in several anomalies. Relational Design Theory Relational Design Theory A badly designed schema can result in several anomalies Update-Anomalies: If we modify a single fact, we have to change several tuples Insert-Anomalies:

More information

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered

More information

Midterm Exam #1 Version A CS 122A Winter 2017

Midterm Exam #1 Version A CS 122A Winter 2017 NAME: SEAT NO.: STUDENT ID: Midterm Exam #1 Version A CS 122A Winter 2017 Max. Points: 100 (Please read the instructions carefully) Instructions: - The total time for the exam is 50 minutes; be sure to

More information

Unit- III (Functional dependencies and Normalization, Relational Data Model and Relational Algebra)

Unit- III (Functional dependencies and Normalization, Relational Data Model and Relational Algebra) Unit- III (Functional dependencies and Normalization, Relational Data Model and Relational Algebra) Important questions Section A :(2 Marks) 1.What is Functional Dependency? Functional dependency (FD)

More information

Functional Dependencies and Normalization for Relational Databases Design & Analysis of Database Systems

Functional Dependencies and Normalization for Relational Databases Design & Analysis of Database Systems Functional Dependencies and Normalization for Relational Databases 406.426 Design & Analysis of Database Systems Jonghun Park jonghun@snu.ac.kr Dept. of Industrial Engineering Seoul National University

More information

Functional dependency theory

Functional dependency theory Functional dependency theory Introduction to Database Design 2012, Lecture 8 Course evaluation Recalling normal forms Functional dependency theory Computing closures of attribute sets BCNF decomposition

More information

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise CSC 74 Database Management Systems Topic #6: Database Design Weak Entity Type E Create a relation R Include all simple attributes and simple components of composite attributes. Include the primary key

More information

DATABASE TECHNOLOGY - 1DL124

DATABASE TECHNOLOGY - 1DL124 1 DATABASE TECHNOLOGY - 1DL124 Summer 2007 An introductury course on database systems http://user.it.uu.se/~udbl/dbt-sommar07/ alt. http://www.it.uu.se/edu/course/homepage/dbdesign/st07/ Kjell Orsborn

More information

CS275 Intro to Databases

CS275 Intro to Databases CS275 Intro to Databases The Relational Data Model Chap. 3 How Is Data Retrieved and Manipulated? Queries Data manipulation language (DML) Retrieval Add Delete Update An Example UNIVERSITY database Information

More information

Databases The theory of relational database design Lectures for m

Databases The theory of relational database design Lectures for m Databases The theory of relational database design Lectures for mathematics students April 2, 2017 General introduction Look; that s why there s rules, understand? So that you think before you break em.

More information

Normalization in DBMS

Normalization in DBMS Unit 4: Normalization 4.1. Need of Normalization (Consequences of Bad Design-Insert, Update & Delete Anomalies) 4.2. Normalization 4.2.1. First Normal Form 4.2.2. Second Normal Form 4.2.3. Third Normal

More information

Normal Forms. Winter Lecture 19

Normal Forms. Winter Lecture 19 Normal Forms Winter 2006-2007 Lecture 19 Equivalent Schemas Many schemas can represent a set of data Which one is best? What does best even mean? Main goals: Representation must be complete Data should

More information

Relational Database Systems 1. Christoph Lofi Simon Barthel Institut für Informationssysteme Technische Universität Braunschweig

Relational Database Systems 1. Christoph Lofi Simon Barthel Institut für Informationssysteme Technische Universität Braunschweig Relational Database Systems 1 Christoph Lofi Simon Barthel Institut für Informationssysteme Technische Universität Braunschweig www.ifis.cs.tu-bs.de 10.0 Introduction Up to now, we have learned... how

More information

Databases 1. Daniel POP

Databases 1. Daniel POP Databases 1 Daniel POP Week 4 Agenda The Relational Model 1. Origins and history 2. Key concepts 3. Relational integrity 4. Relational algebra 5. 12+1 Codd rules for a relational DBMSes 7. SQL implementation

More information

DBMS Chapter Three IS304. Database Normalization-Comp.

DBMS Chapter Three IS304. Database Normalization-Comp. Database Normalization-Comp. Contents 4. Boyce Codd Normal Form (BCNF) 5. Fourth Normal Form (4NF) 6. Fifth Normal Form (5NF) 7. Sixth Normal Form (6NF) 1 4. Boyce Codd Normal Form (BCNF) In the first

More information

Database Foundations. 3-9 Validating Data Using Normalization. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Foundations. 3-9 Validating Data Using Normalization. Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Foundations 3-9 Roadmap Conceptual and Physical Data Models Business Rules Entities Attributes Unique Identifiers Relationships Validating Relationships Tracking Data Changes over Time Validating

More information

Lecture 15: Database Normalization

Lecture 15: Database Normalization Lecture 15: Database Normalization Dr Kieran T. Herley Department of Computer Science University College Cork 2018/19 KH (12/11/18) Lecture 15: Database Normalization 2018/19 1 / 18 Summary The perils

More information

L12: ER modeling 5. CS3200 Database design (sp18 s2) 2/22/2018

L12: ER modeling 5. CS3200 Database design (sp18 s2)   2/22/2018 L12: ER modeling 5 CS3200 Database design (sp18 s2) https://course.ccs.neu.edu/cs3200sp18s2/ 2/22/2018 200 Announcements! Keep bringing your name plates J Exam 1 discussion: questions on grading: Piazza,

More information

Relational Design 1 / 34

Relational Design 1 / 34 Relational Design 1 / 34 Relational Design Basic design approaches. What makes a good design better than a bad design? How do we tell we have a "good" design? How to we go about creating a good design?

More information

CS 377 Database Systems

CS 377 Database Systems CS 377 Database Systems Relational Data Model Li Xiong Department of Mathematics and Computer Science Emory University 1 Outline Relational Model Concepts Relational Model Constraints Relational Database

More information

CPS510 Database System Design Primitive SYSTEM STRUCTURE

CPS510 Database System Design Primitive SYSTEM STRUCTURE CPS510 Database System Design Primitive SYSTEM STRUCTURE Naïve Users Application Programmers Sophisticated Users Database Administrator DBA Users Application Interfaces Application Programs Query Data

More information

Normalization. VI. Normalization of Database Tables. Need for Normalization. Normalization Process. Review of Functional Dependence Concepts

Normalization. VI. Normalization of Database Tables. Need for Normalization. Normalization Process. Review of Functional Dependence Concepts VI. Normalization of Database Tables Normalization Evaluating and correcting relational schema designs to minimize data redundancies Reduces data anomalies Assigns attributes to tables based on functional

More information

Relational Database Design. Announcements. Database (schema) design. CPS 216 Advanced Database Systems. DB2 accounts have been set up

Relational Database Design. Announcements. Database (schema) design. CPS 216 Advanced Database Systems. DB2 accounts have been set up Relational Database Design CPS 216 Advanced Database Systems Announcements 2 DB2 accounts have been set up Let me know if you have not received an email from me regarding your account Recitation session

More information

7+8+9: Functional Dependencies and Normalization

7+8+9: Functional Dependencies and Normalization 7+8+9: Functional Dependencies and Normalization how good is our data model design? what do we know about the quality of the logical schema? 8 how do we know the database design won t cause any problems?

More information

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam Question No: 1 ( Marks: 1 ) - Please choose one Which of the following is NOT a feature of Context DFD?

More information

Chapter 8 INTEGRITY 1

Chapter 8 INTEGRITY 1 Chapter 8 INTEGRITY 1 Introduction Integrity refers to the correctness or accuracy of data in the database For examples: In Supplier-Part-Project database, the status values might have to be in the range

More information

Unit 3 The Relational Model

Unit 3 The Relational Model Unit 3 The Relational Model 3-1 Outline 31 Introduction 32 Relational Data Structure 33 Relational Integrity Rules 34 Relational Algebra 35 Relational Calculus 3-2 31 Introduction 3-3 Relational Model

More information