Review: Attribute closure

Size: px
Start display at page:

Download "Review: Attribute closure"

Transcription

1 CS445 - Introduction to Database Management Systems Fall Semester 2015 LECTURE 10 Functional Dependencies, Normalization Part II TEXTBOOK REFERENCE: CHAPTER 19 CS445 DATABASES: LECTURE 10 1 Review: Attribute closure Suppose given R(A,B,C,D,E,F,G) with FD s: F: A->B, BC->F, BD->EG, AD->C, D->F, BEG->FA Find: A+ ACEG+ BD+ CS445 DATABASES: LECTURE

2 Review: Candidate keys Suppose given R(A,B,C,D,E,G) with FD s: AB->C, C->A, BC->D, ACD->B,D->EG, BE->C,CG->BD, CE->AG Is BC a candidate key? (BC)+= Others? CS445 DATABASES: LECTURE 10 3 Using Closure to infer ALL FD s Suppose R(A,B,C,D) and given FD s: AB->C, AD->B, B->D Step 1: Compute X+ for every X: A+=A, B+=BD, C+=C, D+=D AB+=ABCD, AC+=AC, AD+=ABCD BC+=BCD, BD+=BD, CD+=CD ABC+=ABD+=ACD+=ABCD BCD+=BCD, ABCD+=ABCD Step 2: Enumerate FD s X->Y so Y in X+ and X Y = : AB->CD, AD->BC, BC->D, ABC->D, ABD->C, ACD->B CS445 DATABASES: LECTURE

3 Review: Inferring FD s Suppose given R(A,B,C,D,E,G) with FD s: AB->C, C->A, BC->D, ACD->B,D->EG, BE->C,CG->BD, CE->AG Does BD->ACG follow from F? CS445 DATABASES: LECTURE 10 5 Functional Dependencies (Review) A functional dependency X Y holds over relation schema R if, for every allowable instance r of R: t1 r, t2 r, p X (t1) = p X (t2) implies p Y (t1) = p Y (t2) (where t1 and t2 are tuples; X and Y are sets of attributes) In other words: X Y means Given any two tuples in r, if the X values are the same, then the Y values must also be the same. (but not vice versa) Can read as determines CS445 DATABASES: LECTURE

4 Functional Dependencies Which functional dependencies might hold? A->B B->C C->B CS445 DATABASES: LECTURE 10 7 Normal Forms Back to schema refinement Q1: is any refinement is needed??! If a relation is in a normal form (BCNF, 3NF etc.): we know that certain problems are avoided/minimized. helps decide whether decomposing a relation is useful. Role of FDs in detecting redundancy: Consider a relation R with 3 attributes, ABC. No (non-trivial) FDs hold: There is no redundancy here. Given A B: If A is not a key, then several tuples could have the same A value, and if so, they ll all have the same B value! 1 st 2 nd (of historical interest) 3 rd Boyce-Codd CS445 DATABASES: LECTURE

5 Boyce-Codd Normal Form if there is an FD B->a in relation R then: B -> a is trivial (a ϵ B) or B is a superkey (i.e. non-minimal candidate key) 9 3 rd Normal Form if there is an FD B->a in relation R then B -> a is trivial (a ϵ B) or B is a superkey or a is part of some candidate key for R Possible violations: X -> A X is a proper subset of some key K partial dependency X is not a proper subset of any key transitive dependency (S->R->W) Less restrictive (weaker) than BCNF. More practical, easier to preserve dependencies. BCNF Everything in BCNF is in 3NF, everything not in 3NF is not in BCNF 3NF 10 5

6 Example 3NF BoatReservation (SailorID, BoatID, Date, CreditCard) Key: (SailorID, BoatID, Date) FD: {SailorID} -> {CreditCard} What does this FD mean? Is this in 3NF? Is this in BCNF? 11 Example 3NF (modified) BoatReservation (SailorID, BoatID, Date, CreditCard) Key: (SailorID, BoatID, Date) FD: {CreditCard}->{SailorID} What does this FD mean? Is this in 3NF? Is this in BCNF? 12 6

7 Lossy Decomposition What data was lost? Test to determine losslessness: When R is decomposed into R1 and R2, the attributes common to R1 and R2 must contain a key for either R1 or R2. Formally: F + (of R) contains either FD R1 R2 -> R1 or FD R1 R2 ->R2 13 Dependency Preservation Allow us to enforce all FDs by examining a single relation instance on each change of that relation instance Enforcing an FD across relations instances is expensive (if possible) If we decompose relation R down in to X and Y, the dependencies are preserved if (F x U F y ) + = F + if we insert/delete/update into/from X or Y, we only need to examine the respective relation to check constraints 14 7

8 Normalization The process of putting a schema in a particular normal form BCNF may not be a be able to create a dependency-preserving decomposition in BCNF 3NF can always create a lossless, dependency-preserving decomposition in 3NF To do this we need: all the candidate keys A clean set of functional dependencies No FD s that are implied by others 15 Candidate Keys (A)+, (B)+, (C)+, (D)+,,(Z)+, (AB)+,(AC)+?? Really? Need to be wiser, partition attributes into three groups based on location in FD s: Necessary: 1) Occurs only in LHS of FD s. 2) Doesn t occur on either side of ANY FD. Useless: Occurs only in RHS of FD s. MEH: Occurs on BOTH sides of FD s (when FD s considered as a set) CS445 DATABASES: LECTURE

9 Candidate Keys: Algorithm Necessary: Must be a part of ALL candidate keys! Useless: Never a part of ANY candidate key! MEH: Could be a part of some candidate key must check. Important Note: If X includes all the necessary attributes and X+=R (all attributes), then done. Otherwise, include systematically include the MEH variables until key is reached. CS445 DATABASES: LECTURE Candidate Keys: Examples One: R(ABCDEG), F: {AB->C, C->D, AD->E} Necessary: A, B, G Useless: E MEH: C, D (ABG)+=R, so done Two: R(ABCDE), F: {A->E, BC->E, ED->A} Necessary: Useless: MEH: Candidate Keys? CS445 DATABASES: LECTURE

10 Minimal Cover: Definition Minimal Cover set for FDs given a set of FDs F, a minimal cover set of FDs G is X->A is in G, and A is a single attribute F + is equal to G + if any FDs are deleted from G to form set H, H + F + Not Unique! CS445 DATABASES: LECTURE Minimal Cover: Algorithm Given R, set of FD s F: 1) Rewrite all rules so single attribute on right: X->YZ becomes X->Y, X->Z 2) Minimize left side: Can replace XB->Y by X->Y if Y X F + (closure of X wrt FD s F) 3) Delete redundant FD s Remove FD, see if can be deduced from remaining FD s: For X->Y, let F denote original set F with FD X->Y removed If Y X + F, then can remove X->Y from F. CS445 DATABASES: LECTURE

11 Minimal Cover: Example Suppose given R(ABCDEFGH) with FD s F: A->B ABCD->E EF-> G EF->H ACDF->EG STEP 1: Rewrite with single attribute on left A->B ABCD->E EF-> G EF->H ACDF->E ACDF->G CS445 DATABASES: LECTURE Minimal Cover: Example, cont. R(ABCDEFGH) with FD s F: A->B ABCD->E. Becomes ACD->E EF->G EF->H ACDF->E. Becomes ACD ->E ACDF->G STEP 2: Minimize left side A) Eliminate B in ABCD->E since E (ACD) F + B) Eliminate F in ACDF->E since E (ACD) F + CS445 DATABASES: LECTURE

12 Minimal Cover: Example, cont. R(ABCDEFGH) with FD s F: A->B ACD->E EF->G EF->H ACD ->E is eliminated ACDF->G is eliminated STEP 3: Delete redundant FD s A) eliminate one ACD ->E + B) Remove ACDF->G since G (ACDF) F So, minimal cover is: G={A->B, ACD->E, EF->G, EF->H} CS445 DATABASES: LECTURE Normalization to BCNF If R is not in BCNF there must be at least one FD X->Y such that Y is a single attribute and X->Y violates BCNF. Decompose R into R-Y and XY Repeat while R is not in BCNF To preserve dependencies in BCNF, we may store some redundant information 24 12

13 Decomposition: Questions! Relation R(C,S,J,D,P,Q,V) FD: {C}->{CSJDPQV}, {JP} ->{C}, {SD} -> {P} What are candidate keys? Super keys? What violates BCNF? How do we decompose this? What dependency is not preserved? 25 Normalization to 3NF R is a relation with a set of FDs F where F is a minimal cover Produce a lossless decomposition as per BCNF produce relations D = {R 1, R 2,...,R n } Identify FDs in F not preserved in the closure of the FDs in R 1...R n for each non-preserved FD {X}->{A}, add relation XA to D What relation would you have to add to previous example? 26 13

14 3NF Synthesis Build a set of relations (tables) up from FDs start with a minimal cover set, F, of FDs If X -> A is in F, add the relation schema (table) XA Preserves all FDs May not be lossless add relation schema containing necessary attributes Polynomial time to find minimal set synthesis find a key (finding all keys is NP-Complete) testing if a schema is in 3NF is NP-Complete! 27 Example C -> CSJDPQV, JP->C, SD->P, J->S Minimal cover: Relation Schemas for 3NF: 28 14

CSE 562 Database Systems

CSE 562 Database Systems Goal CSE 562 Database Systems Question: The relational model is great, but how do I go about designing my database schema? Database Design Some slides are based or modified from originals by Magdalena

More information

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization CSE 544 Principles of Database Management Systems Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization References R&G Book. Chapter 19: Schema refinement and normal forms Also relevant to this

More information

Schema Refinement and Normal Forms

Schema Refinement and Normal Forms Schema Refinement and Normal Forms Chapter 19 Quiz #2 Next Wednesday Comp 521 Files and Databases Fall 2010 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational

More information

Schema Refinement & Normalization Theory 2. Week 15

Schema Refinement & Normalization Theory 2. Week 15 Schema Refinement & Normalization Theory 2 Week 15 1 How do we know R is in BCNF? If R has only two attributes, then it is in BCNF If F only uses attributes in R, then: R is in BCNF if and only if for

More information

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization CSE 544 Principles of Database Management Systems Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization References R&G Book. Chapter 19: Schema refinement and normal forms Also relevant to

More information

Functional Dependencies CS 1270

Functional Dependencies CS 1270 Functional Dependencies CS 1270 Constraints We use constraints to enforce semantic requirements on a DBMS Predicates that the DBMS must ensure to be always true. Predicates are checked when the DBMS chooses

More information

Functional Dependencies and Finding a Minimal Cover

Functional Dependencies and Finding a Minimal Cover Functional Dependencies and Finding a Minimal Cover Robert Soulé 1 Normalization An anomaly occurs in a database when you can update, insert, or delete data, and get undesired side-effects. These side

More information

Design Theory for Relational Databases

Design Theory for Relational Databases By Marina Barsky Design Theory for Relational Databases Lecture 15 Functional dependencies: formal definition X Y is an assertion about a relation R that whenever two tuples of R agree on all the attributes

More information

Normalization 03. CSE3421 notes

Normalization 03. CSE3421 notes Normalization 03 CSE3421 notes 1 Example F: A B (1) ABCD E (2) EF G (3) EF H (4) ACDF EG (5) Calculate the minimal cover of F. 2 Step 1: Put F in standard form FDs (1) (4) are already in standard form.

More information

BCNF. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong BCNF

BCNF. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong BCNF Yufei Tao Department of Computer Science and Engineering Chinese University of Hong Kong Recall A primary goal of database design is to decide what tables to create. Usually, there are two principles:

More information

SCHEMA REFINEMENT AND NORMAL FORMS

SCHEMA REFINEMENT AND NORMAL FORMS 19 SCHEMA REFINEMENT AND NORMAL FORMS Exercise 19.1 Briefly answer the following questions: 1. Define the term functional dependency. 2. Why are some functional dependencies called trivial? 3. Give a set

More information

CS 2451 Database Systems: Database and Schema Design

CS 2451 Database Systems: Database and Schema Design CS 2451 Database Systems: Database and Schema Design http://www.seas.gwu.edu/~bhagiweb/cs2541 Spring 2018 Instructor: Dr. Bhagi Narahari Relational Model: Definitions Review Relations/tables, Attributes/Columns,

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

CS411 Database Systems. 05: Relational Schema Design Ch , except and

CS411 Database Systems. 05: Relational Schema Design Ch , except and CS411 Database Systems 05: Relational Schema Design Ch. 3.1-3.5, except 3.4.2-3.4.3 and 3.5.3. 1 How does this fit in? ER Diagrams: Data Definition Translation to Relational Schema: Data Definition Relational

More information

Part II: Using FD Theory to do Database Design

Part II: Using FD Theory to do Database Design Part II: Using FD Theory to do Database Design 32 Recall that poorly designed table? part manufacturer manaddress seller selleraddress price 1983 Hammers R Us 99 Pinecrest ABC 1229 Bloor W 5.59 8624 Lee

More information

The Relational Data Model

The Relational Data Model The Relational Data Model Lecture 6 1 Outline Relational Data Model Functional Dependencies Logical Schema Design Reading Chapter 8 2 1 The Relational Data Model Data Modeling Relational Schema Physical

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

CSIT5300: Advanced Database Systems

CSIT5300: Advanced Database Systems CSIT5300: Advanced Database Systems L06: Relational Database Design BCNF Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR,

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

LOGICAL DATABASE DESIGN Part #2/2

LOGICAL DATABASE DESIGN Part #2/2 NOTE, the decomposition algorithms (2NF in p. 10-11, 3NF in p. 14-16, and BCNF in P. 18) have been modified. Read the algorithms very carefully. LOGICAL DATABASE DESIGN Part #2/2 Relational Database Design

More information

Lecture 6a Design Theory and Normalization 2/2

Lecture 6a Design Theory and Normalization 2/2 CompSci 516 Data Intensive Computing Systems Lecture 6a Design Theory and Normalization 2/2 Instructor: Sudeepa Roy 1 HW1 deadline: Announcements Due on 09/21 (Thurs), 11:55 pm, no late days Project proposal

More information

Homework 6: FDs, NFs and XML (due April 13 th, 2016, 4:00pm, hard-copy in-class please)

Homework 6: FDs, NFs and XML (due April 13 th, 2016, 4:00pm, hard-copy in-class please) Virginia Tech. Computer Science CS 4604 Introduction to DBMS Spring 2016, Prakash Homework 6: FDs, NFs and XML (due April 13 th, 2016, 4:00pm, hard-copy in-class please) Reminders: a. Out of 100 points.

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

Lecture #8 (Still More Relational Theory...!)

Lecture #8 (Still More Relational Theory...!) Introduction to Data Management Lecture #8 (Still More Relational Theory...!) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v

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

From Murach Chap. 9, second half. Schema Refinement and Normal Forms

From Murach Chap. 9, second half. Schema Refinement and Normal Forms From Murach Chap. 9, second half The need for normalization A table that contains repeating columns Schema Refinement and Normal Forms A table that contains redundant data (same values repeated over and

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

Database Design Principles

Database Design Principles Database Design Principles CPS352: Database Systems Simon Miner Gordon College Last Revised: 2/11/15 Agenda Check-in Design Project ERD Presentations Database Design Principles Decomposition Functional

More information

Fundamentals of Database Systems

Fundamentals of Database Systems Fundamentals of Database Systems Assignment: 3 Due Date: 23st August, 2017 Instructions This question paper contains 15 questions in 6 pages. Q1: Consider the following relation and its functional dependencies,

More information

Relational Database Design Theory. Introduction to Databases CompSci 316 Fall 2017

Relational Database Design Theory. Introduction to Databases CompSci 316 Fall 2017 Relational Database Design Theory Introduction to Databases CompSci 316 Fall 2017 2 Announcements (Thu. Sep. 14) Homework #1 due next Tuesday (11:59pm) Course project description posted Read it! Mixer

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

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

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

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

Database design III. Quiz time! Using FDs to detect anomalies. Decomposition. Decomposition. Boyce-Codd Normal Form 11/4/16

Database design III. Quiz time! Using FDs to detect anomalies. Decomposition. Decomposition. Boyce-Codd Normal Form 11/4/16 Lecture 3 Quiz time! Database design III Functional dependencies cont. BCNF and 3NF What s wrong with this schema? {(, 2, Databases, Steven Van Acker ), (, 4, Databases, Rogardt Heldal )} Redundancy! Using

More information

FUNCTIONAL DEPENDENCIES

FUNCTIONAL DEPENDENCIES FUNCTIONAL DEPENDENCIES CS 564- Spring 2018 ACKs: Dan Suciu, Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? Database Design Theory: Functional Dependencies Armstrong s rules The Closure Algorithm

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

Lectures 5 & 6. Lectures 6: Design Theory Part II

Lectures 5 & 6. Lectures 6: Design Theory Part II Lectures 5 & 6 Lectures 6: Design Theory Part II Lecture 6 Today s Lecture 1. Boyce-Codd Normal Form ACTIVITY 2. Decompositions & 3NF ACTIVITY 3. MVDs ACTIVITY 2 Lecture 6 > Section 1 1. Boyce-Codd Normal

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

Lectures 12: Design Theory I. 1. Normal forms & functional dependencies 2/19/2018. Today s Lecture. What you will learn about in this section

Lectures 12: Design Theory I. 1. Normal forms & functional dependencies 2/19/2018. Today s Lecture. What you will learn about in this section Today s Lecture Lectures 12: Design Theory I Professor Xiannong Meng Spring 2018 Lecture and activity contents are based on what Prof Chris Ré used in his CS 145 in the fall 2016 term with permission 1.

More information

Lecture 5 Design Theory and Normalization

Lecture 5 Design Theory and Normalization CompSci 516 Data Intensive Computing Systems Lecture 5 Design Theory and Normalization Instructor: Sudeepa Roy Duke CS, Fall 2017 CompSci 516: Database Systems 1 HW1 deadline: Announcements Due on 09/21

More information

Course Content. Database Design Theory. Objectives of Lecture 2 Database Design Theory. CMPUT 391: Database Design Theory

Course Content. Database Design Theory. Objectives of Lecture 2 Database Design Theory. CMPUT 391: Database Design Theory Database Management Systems Winter 2003 CMPUT 391: Database Design Theory Dr. Osmar R. Zaïane University of Alberta Chapter 19 of Textbook Course Content Introduction Database Design Theory Query Processing

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

COSC Dr. Ramon Lawrence. Emp Relation

COSC Dr. Ramon Lawrence. Emp Relation COSC 304 Introduction to Database Systems Normalization Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Normalization Normalization is a technique for producing relations

More information

5 Normalization:Quality of relational designs

5 Normalization:Quality of relational designs 5 Normalization:Quality of relational designs 5.1 Functional Dependencies 5.1.1 Design quality 5.1.2 Update anomalies 5.1.3 Functional Dependencies: definition 5.1.4 Properties of Functional Dependencies

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

Relational Design Theory

Relational Design Theory OpenStax-CNX module: m28252 1 Relational Design Theory Nguyen Kim Anh This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 3.0 Abstract One important theory

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

Design Theory for Relational Databases

Design Theory for Relational Databases Design Theory for Relational Databases csc343, fall 2014 Diane Horton University of Toronto Originally based on slides by Jeff Ullman 1 Introduction There are always many different schemas for a given

More information

Database Systems. Basics of the Relational Data Model

Database Systems. Basics of the Relational Data Model Database Systems Relational Design Theory Jens Otten University of Oslo Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 1 / 30 Basics of the Relational Data Model title year

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

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

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

NORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18

NORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18 NORMAL FORMS CS121: Relational Databases Fall 2017 Lecture 18 Equivalent Schemas 2 Many different schemas can represent a set of data Which one is best? What does best even mean? Main goals: Representation

More information

Relational design algorithms

Relational design algorithms lecture 9: Relational design algorithms course: Database Systems (NDBI025) doc. RNDr. Tomáš Skopal, Ph.D. SS2011/12 Department of Software Engineering, Faculty of Mathematics and Physics, Charles 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

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

Databases Lecture 7. Timothy G. Griffin. Computer Laboratory University of Cambridge, UK. Databases, Lent 2009

Databases Lecture 7. Timothy G. Griffin. Computer Laboratory University of Cambridge, UK. Databases, Lent 2009 Databases Lecture 7 Timothy G. Griffin Computer Laboratory University of Cambridge, UK Databases, Lent 2009 T. Griffin (cl.cam.ac.uk) Databases Lecture 7 DB 2009 1 / 17 Lecture 07: Decomposition to Normal

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

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

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

CS352 Lecture - Conceptual Relational Database Design

CS352 Lecture - Conceptual Relational Database Design CS352 Lecture - Conceptual Relational Database Design Objectives: last revised September 20, 2006 1. To define the concepts functional dependency and multivalued dependency 2. To show how to find the closure

More information

COMP7640 Assignment 2

COMP7640 Assignment 2 COMP7640 Assignment 2 Due Date: 23:59, 14 November 2014 (Fri) Description Question 1 (20 marks) Consider the following relational schema. An employee can work in more than one department; the pct time

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

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

Combining schemas. Problems: redundancy, hard to update, possible NULLs

Combining schemas. Problems: redundancy, hard to update, possible NULLs Handout Combining schemas Problems: redundancy, hard to update, possible NULLs Problems? Conclusion: Whether the join attribute is PK or not makes a great difference when combining schemas! Splitting schemas,

More information

Database Management System

Database Management System Database Management System Lecture 4 Database Design Normalization and View * Some materials adapted from R. Ramakrishnan, J. Gehrke and Shawn Bowers Today s Agenda Normalization View Database Management

More information

SCHEMA REFINEMENT AND NORMAL FORMS

SCHEMA REFINEMENT AND NORMAL FORMS 15 SCHEMA REFINEMENT AND NORMAL FORMS It is a melancholy truth that even great men have their poor relations. Charles Dickens Conceptual database design gives us a set of relation schemas and integrity

More information

Database Constraints and Design

Database Constraints and Design Database Constraints and Design We know that databases are often required to satisfy some integrity constraints. The most common ones are functional and inclusion dependencies. We ll study properties of

More information

CS352 Lecture - Conceptual Relational Database Design

CS352 Lecture - Conceptual Relational Database Design CS352 Lecture - Conceptual Relational Database Design Objectives: last revised September 16, 2004 1. To define the concepts functional dependency and multivalued dependency 2. To show how to find the closure

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

Schema Normalization. 30 th August Submitted By: Saurabh Singla Rahul Bhatnagar

Schema Normalization. 30 th August Submitted By: Saurabh Singla Rahul Bhatnagar Schema Normalization 30 th August 2011 Submitted By: Saurabh Singla 09010146 Rahul Bhatnagar 09010136 Normalization Consider the following ER diagram with some FD: Instructor iid A Student sid Department

More information

Theory of Normal Forms Decomposition of Relations. Overview

Theory of Normal Forms Decomposition of Relations. Overview .. Winter 2008 CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar.. Overview Theory of Normal Forms Decomposition of Relations Functional Dependencies capture the attribute dependencies

More information

The Relational Data Model. Functional Dependencies. Example. Functional Dependencies

The Relational Data Model. Functional Dependencies. Example. Functional Dependencies The Relational Data Model Functional Dependencies 1 Functional Dependencies X -> A is an assertion about a relation R that whenever two tuples of R agree on all the attributes of X, then they must also

More information

Acknowledgement: The slides were kindly lent by Doc. RNDr. Tomas Skopal, Ph.D., Department of Software Engineering, Charles University in Prague

Acknowledgement: The slides were kindly lent by Doc. RNDr. Tomas Skopal, Ph.D., Department of Software Engineering, Charles University in Prague course: Database Systems (A7B36DBS) Doc. RNDr. Irena Holubova, Ph.D. Acknowledgement: The slides were kindly lent by Doc. RNDr. Tomas Skopal, Ph.D., Department of Software Engineering, Charles University

More information

Chapter 16. Relational Database Design Algorithms. Database Design Approaches. Top-Down Design

Chapter 16. Relational Database Design Algorithms. Database Design Approaches. Top-Down Design Chapter 16 Relational Database Design Algorithms Database Design Approaches Top-Down design (Starting with conceptual design) Bottom-Up Design (relational synthesis) 2 Top-Down Design Design conceptual

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

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

Babu Banarasi Das National Institute of Technology and Management

Babu Banarasi Das National Institute of Technology and Management Babu Banarasi Das National Institute of Technology and Management Department of Computer Applications Question Bank (Short-to-Medium-Answer Type Questions) Masters of Computer Applications (MCA) NEW Syllabus

More information

Normalization. Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms

Normalization. Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms Normalization Niklas Fors (niklas.fors@cs.lth.se) Normalization 1 / 45

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

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

CSE 444 Midterm Test

CSE 444 Midterm Test CSE 444 Midterm Test Spring 2007 Name: Total time: 50 Question 1 /40 Question 2 /30 Question 3 /30 Total /100 1 1 SQL [40 points] Consider a database of social groups that allows people to become members

More information

Normalisation theory

Normalisation theory Normalisation theory Introduction to Database Design 2012, Lecture 7 Challenging exercises E-R diagrams example Normalisation theory, motivation Functional dependencies Boyce-Codd normal form (BCNF) 3rd

More information

18. Relational Database Design

18. Relational Database Design 18. Relational Database Design The relational datamodel was introduced by Codd in 1970. It is the most widely used datamodel extended with the possibilities of the World Wide Web, because of its simplicity

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

Functional Dependencies and Normalization

Functional Dependencies and Normalization Functional Dependencies and Normalization Jose M. Peña jose.m.pena@liu.se Overview Real world Databases DBMS Model Physical database Queries Processing of queries and updates Access to stored data Answers

More information

Homework 6: FDs, NFs and XML (due April 15 th, 2015, 4:00pm, hard-copy in-class please)

Homework 6: FDs, NFs and XML (due April 15 th, 2015, 4:00pm, hard-copy in-class please) Virginia Tech. Computer Science CS 4604 Introduction to DBMS Spring 2015, Prakash Homework 6: FDs, NFs and XML (due April 15 th, 2015, 4:00pm, hard-copy in-class please) Reminders: a. Out of 100 points.

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

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

Functional Dependencies and Single Valued Normalization (Up to BCNF)

Functional Dependencies and Single Valued Normalization (Up to BCNF) Functional Dependencies and Single Valued Normalization (Up to BCNF) Harsh Srivastava 1, Jyotiraditya Tripathi 2, Dr. Preeti Tripathi 3 1 & 2 M.Tech. Student, Centre for Computer Sci. & Tech. Central University

More information

Part V Relational Database Design Theory

Part V Relational Database Design Theory Part V Relational Database Design Theory Relational Database Design Theory 1 Target Model of the Logical Design 2 Relational DB Design 3 Normal Forms 4 Transformation Properties 5 Design Methods Saake

More information

MODULE: 3 FUNCTIONAL DEPENDENCIES

MODULE: 3 FUNCTIONAL DEPENDENCIES MODULE: 3 (13 hours) Database design: functional dependencies - Inference Rules for Functional Dependencies - Closure -- Minimal Cover -Normal forms First-second and third normal forms Boyce- Codd normal

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

The University of British Columbia

The University of British Columbia The University of British Columbia Computer Science 304 Midterm Examination January 30, 2012 Time: 50 minutes Total marks: 40 Instructor: Rachel Pottinger ANSWER KEY (PRINT) (Last) (First) Signature This

More information

Presentation on Functional Dependencies CS x265

Presentation on Functional Dependencies CS x265 Presentation on Functional Dependencies CS x265 This presentation assumes that you have previously viewed Watch videos (90 min) and answer questions from DB8 Relational Design Theory (https://class.stanford.edu/courses/db/rd/selfpaced/courseware/ch-relational_design_theory/)

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

Lecture 4. Database design IV. INDs and 4NF Design wrapup

Lecture 4. Database design IV. INDs and 4NF Design wrapup Lecture 4 Database design IV INDs and 4NF Design wrapup Problem description We want a database that we can use for scheduling courses and lectures. This is how it s supposed to work: code name Course dept

More information

Desirable database characteristics Database design, revisited

Desirable database characteristics Database design, revisited CMPT 354 Desirable database characteristics Database design, revisited Normal Forms First Normal Form Second Normal Form Third Normal Form Boyce-Codd Normal Form Normal forms and functional dependencies

More information