Objectives, outcomes, and key concepts. Objectives: give an overview of the normal forms and their benefits and problems.

Size: px
Start display at page:

Download "Objectives, outcomes, and key concepts. Objectives: give an overview of the normal forms and their benefits and problems."

Transcription

1 Normalization Page 1 Objectives, outcomes, and key concepts Tuesday, January 6, :45 AM Objectives: give an overview of the normal forms and their benefits and problems. Outcomes: students should be able to: Describe the normal forms and their requirements. Check whether a given database satisfies a given normal form. Normalize a given database -- given a real-world description and a starting schema -- into a given normal form. Describe situations in which normalization is not possible. Key concepts and ideas: As far as requirements: 4NF BCNF 3NF Benefits of specific normal forms. Elimination of anomalies Preservation of dependencies Recovery of the base relation Eliminiation of redundancy MVDs and MVDAs

2 The normal forms Thursday, February 19, :10 AM 1NF: first normal form: values are atomic and indivisible; no "sets as values" 2NF: second normal form: values are only dependent upon candidate keys, and not parts of keys. 3NF: third normal form: recoverable, preserves functional dependencies, prevents insertion anomalies. Prevents transitive dependencies. BCNF (3.5NF): Boyce-Codd normal form. recoverable, prevents redundancy based upon preserving FDs, does not always preserve functional dependencies. 4NF: fourth normal form: BCNF + prevents redundant use of storage. (When I studied databases as a student, I learned that 4NF was 3NF plus redundancy elimination... BCNF had not become popular...) Normalization Page 2

3 A correction Thursday, February 19, :16 AM I guess part of my "Freudian slip" attitude toward BCNF is summarized by the fact that it is less faithful (in extremal cases) than 3NF. The lack of restrictions in 3NF allows it to be more faithful. Normalization Page 3

4 The true hierarchy of normal forms Thursday, February 19, :26 AM Normalization Page 4

5 Several facts about normal forms Thursday, February 19, :28 AM A normal form is a set of properties that must be true of a database as a set of relations. That a particular databases's design complies with a normal form is independent of how the design was derived. For example, it is very common for a database schema generated by the 3NF algorithm to also satisfy BCNF and 4NF. Thus, it is just as important to know how to check a database for compliance as it is to be able to transform a database into a specific form. Normalization Page 5

6 A short tour of what we know Thursday, February 19, :32 AM 3NF: Generated by eliminating redundant functional dependencies and then designing relations according to the remaining dependencies, with a single "catch-all" relation for those attributes that are not part of other relations. Always: eliminates common insertion anomalies. is recoverable. preserves functional dependencies. BCNF: Generated by splitting non-compliant relations into two parts. Splitting is not commutative unless all FDs have singleton LHSs. Splitting can -- in extreme cases -- lead to non-compliant databases or the elimination of existing functional dependencies. Always: Protects against more insertion anomalies. Is recoverable. Sometimes: Preserves functional dependencies. Normalization Page 6

7 Differences between 3NF and BCNF Thursday, February 19, :43 AM The 3NF conditions, as summarized by Zaniolo in 1982: For each functional dependency X A of the relation R, either: X contains A (X A is trivial), or X is a superkey for R, or Each attribute in A-X is contained in some candidate key for R. The BCNF conditions eliminate one possibility: X contains A (X A is trivial), or X is a superkey for R, or Each attribute in A-X is contained in some candidate key for R. Normalization Page 7

8 Normalization Page 8 BCNF 3NF Thursday, February 19, :59 PM Obviously, since BCNF disallows something that 3NF allows, anything in BCNF is automatically in 3NF. Also "almost everything" that is in 3NF is also in BCNF. The exception occurs when one has several overlapping candidate keys for a table. If candidate keys do not overlap, then 3NF BCNF

9 A very subtle example Thursday, February 19, :02 PM Court Start Time End Time Rate Type 1 09:30 10:30 SAVER 1 11:00 12:00 SAVER 1 14:00 15:30 STANDARD 2 10:00 11:30 PREMIUM-B 2 11:30 13:30 PREMIUM-B 2 15:00 16:30 PREMIUM-A From < Multiple overlapping candidate keys: { Court, Start Time } { Court, End Time } { Rate Type, Start Time } { Rate Type, End Time } and one very pesky functional dependency: Rate Type Court This violates BCNF but not 3NF, because the functional dependency Rate Type Court is allowed by the third clause in 3NF but not in BCNF. Normalization Page 9

10 Solution: encode the rate type dependency in another table {rate type, court, member} Leaving {rate type, start time, end time} Normalization Page 10

11 A no-win situation Thursday, February 19, :28 PM Normalization Page 11

12 Identifying 3NF relations Thursday, February 19, :19 PM The above example is a bit of a technicality but it provides a way to determine whether a relation is in 3NF or not: A relation in 3NF has no transitive dependencies A B C where A is in a candidate key A B, B A and neither B nor C are parts of candidate keys. In other words, to determine whether a relation is in 3NF, look for transitive dependencies. Normalization Page 12

13 Example Thursday, February 19, :21 PM The following table { shoe name, shoe maker, maker address } with the FDs shoe name shoe maker shoe name maker address shoe maker maker address is not in 3NF. The third dependency is transitive, in the sense that shoe name is a key and shoe maker and maker address are not. The appropriate fix is to normalize to {shoe name, shoe maker} and {shoe maker, maker address} via Boyce-Codd split. Since the normalized version is in 3NF and has no overlapping candidate keys, it is also in BCNF as well. Normalization Page 13

14 End of lecture on 2/8 Monday, February 8, :58 PM Normalization Page 14

15 So far, Wednesday, February 10, :07 PM We've studied normal forms 3NF and 3.5NF (BCNF) We know how to evaluate a decomposition through two methods: The Chase algorithm for determining lossless joins. The fact that a functional dependency is not preserved if its terms are split among more than one relation. Normalization Page 15

16 An example Wednesday, February 10, :09 PM Consider name address, position, extension position salary address phone snack Part 1: Compute the 3NF for this: {name, address, position, extension} {position, salary} {address, phone} {snack, name} (the catchall superkey) Part 2: Is this lossless? Let's notate the Chase tableau a different way, using subscripts instead of namesubscript name address position extension position 2 salary address phone 3 name snack name address position extension salary position 2 salary address phone 3 name snack name address position extension salary phone position 2 salary 2 2 Normalization Page 16

17 2 2 position 2 salary address phone 3 name snack name address position extension salary phone position 2 salary address phone 3 name address position extension salary phone snack So the Chase completes, and it is lossless. Does it preserve functional dependencies? Yes, the FDs are each contained in one relation. Normalization Page 17

18 Normalization Page 18 Multi-value dependencies Thursday, February 19, :01 PM It is perfectly fine -- in relational normalization terms -- to have data in tables that is not functionally determined. One user determines a list of preferences. Can have a list of friends in which person, friend is an unconstrained relation. What is not so fine is the situation in which, in some implicit fashion, a cross-product of data is included in the design of a table. This creates redundancy in the database as well as a second kind of insertion anomaly: insertion with omission.

19 Some multi-valued dependencies Wednesday, February 10, :50 PM {model} {color} A car model determines a set of possible colors {(color)} {recipe} {ingredient, quantity} A recipe determines a set of pairs {(ingredient, quantity)} {tournament} {team, opponent, score} A tournament determines a set of triples {(team, opponent, score)} Some simple facts about If X Y Z, this does not mean that X Y or X Z Ingredients in the above recipe are meaningless unless their quantity is also present! Likewise, if X Y and X Z, this does not mean that X Y Z There would be no correlation between the pairs! If X Y then X Y (perfectly good to have sets of one element!) Converse is obviously false. Normalization Page 19

20 Normalization Page 20 A very simple example Thursday, February 19, :05 PM We have models of cars. Every model can have one of five colors: white, black, blue, gray, yellow. Every model can have one of three trim finish grades: std, ltd, custom Then, to store descriptions of three cars in a table (model, color, trim), one has to store 3x5x3 = 45 rows. We call this a multi-value dependency and write model color and model trim = "multi-determines" The goal of fourth normal form is to eliminate this storage redundancy. The normalization step is to do a Boyce-Codd split that create a separate relation {model, color} and preserve model in the original relation. Thus, we obtain two relations (model, color) (model, trim) equivalent with the original relation (model, color, trim)

21 Normalization Page 21 (model, color, trim) The join (model, color) model (model, trim) exactly reproduces the cross product in the MVD. In other words, to remove an MVD, split X Y in R into relations (X Y), and (X (R-Y)) using a Boyce- Codd split.

22 Wednesday, February 10, :27 PM Normalization Page 22

23 Normalization Page 23

24 Normalization Page 24

25 Explicitly, the 4NF algorithm is Thursday, February 19, :44 PM Express the database in BCNF. For each MVD X Y, split the relation R into X Y, XuR-Y via a Boyce-Codd split. The difference here is that X Y is the key of (X,Y), not X. Until there are no more remaining MVDs combined with non-mvd columns. Watch out: The fact that there are two MVDs in a relation does not mean that two splits will be required. If the two MVDs are the whole relation, then one split will separate them. Only if there is other data that is not an MVD will two splits be necessary. Normalization Page 25

26 Normalization Page 26 A problem with the book Monday, February 8, :11 AM Last time I taught this, I stuck with the definition of MVD in the book: A multi-valued dependency occurs when two separate set-valued dependencies on the same key occur in the same table. The result was mass confusion mostly because the book itself is confused on the issue! It is therefore time for civil disobedience! My revised (and more common) definition: A multi-value dependency (MVD) is any situation in which a value for one set of attributes determines a set of values for another set of attributes. A multi-value dependency anomaly (MVDA) is any situation in which an MVD is expressed along with non-mvd columns in the same relation. In other words, a) an MVD by itself is still an MVD, but not a problem.

27 Normalization Page 27 b) problem. An MVD A B becomes part of an MVDA when there is a set of columns C in the relation that are not part of the MVD.

28 Normalization Page 28 The bad news Thursday, February 19, :23 PM MVDs are exceedingly difficult to define and locate in a relation. In general, a multi-value dependency anomaly occurs when a relation R has attributes A, B, and C such that A determines a set of values for B, There is a separate set of columns C, and the values of B and C are independent of each other. We satisfy ourselves with stepwise refinement by setting C to be the rest of the columns, because if the rest of the columns contain C, then we can utilize that set as an independent entity from B. Thus, the definition of an MVDA is somewhat contorted: Definition. For sets of columns X and Y, an MVD X Y is also part of an MVDA if: If t1 and t2 are tuples such that πx(t1) = πx(t2), then there are tuples t3 and t4 such that 1. πx(t1) = πx(t3) = πx(t4) 2. πy(t1) = πy(t3) and πy(t2) = πy(t4)

29 2. πy(t1) = πy(t3) and πy(t2) = πy(t4) 3. πz(t1) = πz(t4) and πz(t2) = πz(t3) where Z = R - (X U Y) Normalization Page 29

30 A rather strange definition Thursday, February 19, :40 PM X Y R-(X Y) t1 something v1 r1 t2 something v2 r2 t3 something v2 r1 t4 something v1 r2 Normalization Page 30

31 Spotting MVDAs Thursday, February 19, :50 PM These cannot be spotted easily from a database; they are a rather complex constraint on what values must appear (rather than what values must not appear, as with single-valued dependencies (FDs)). They are -- in essence -- hidden cross products. One violates an MVDA by leaving out a tuple of a cross-product. However, it is easy to spot them in English descriptions of a database. And similarly, it is easy to spot them in application code that manipulates databases. Normalization Page 31

32 Example: Wednesday, February 10, :31 PM model color model trim And suppose model=taurus, color=blue, gray model=taurus, trim = L, LX, SE So that we would need in our table model color trim taurur blue taurus blue taurus blue taurus gray taurus gray taurus gray L LX SE L LX SE Omitting any row of this is an omission anomaly. We would normalize this into two tables X= model color taurus blue taurus gray and Y= model trim Normalization Page 32

33 taurus L taurus LX taurus SE So that X Y is the original relation. Then omission anomalies cannot happen. Normalization Page 33

34 Normalization Page 34 What is not an MVDA Thursday, February 19, :11 PM MVDAs require that there be at least two independently varying things: {model, color} does not contain an MVDA by itself. {model, color, trim} does, because color and trim vary independently based upon model. The key is that there has to be something to take the cross product of.

35 Example Thursday, February 19, :13 PM A hat company makes hats that come in several colors and sizes. Each particular hat comes in a fixed number of sizes and colors, but other hats can vary in the range of sizes and colors. Let's model this via the MVDs hat name size hat name color And consider the relation { hat name, size, color, price } with additional FD { hat name price } The solution is to split the relation on one MVD (say hat name size) to create { hat name, size } { hat name, color, price } Is the result in 4NF? No! We need {hat name, size} {hat name, price} {hat name, color} Normalization Page 35

36 MVD algebra Thursday, February 19, :32 PM It is not surprising that MVDs have an algebra similar to that of FDs. It is surprising that several of the things we like about the algebra of FDs are not true for FDs. What is even more subtle is that some of the rules come with qualifications. Some rules to remember: Transitivity: A B and B C implies A C - A Promotion: A B implies A B Complementation: A B implies A R - B (where R is the set of all attributes of the relation) Trivial MVDs: B A implies A B, but there is a new kind of triviality. If A B=R and A B=, then A B Some rules that do not work for MVDs: Cannot split or combine MVDs. In general A B, C does not imply A B A B, A C does not imply A B, C Normalization Page 36

37 A very evocative table Thursday, February 19, :43 PM See page 113: Property Eliminates redundancy due to FDs Eliminates redundancy due to MVDs 3NF BCNF 4NF No Yes Yes No No Yes Preserves FDs Yes No No Preserves MVDs No No No Normalization Page 37

38 End of lecture on 2/10 Wednesday, February 10, :59 PM Normalization Page 38

39 Some common mistakes Thursday, February 19, :51 PM Whether a table is in 3NF, BCNF, 4NF is not a property of the data. It is solely a property of table columns and their FDs and MVDs. (It is always possible that the instance of the table does not portray the particular MVDA you are seeking to stamp out. This does not mean that it won't appear in the future.) Normalization Page 39

40 Normalization Page 40 5NF Wednesday, February 10, :38 PM A table is in 5NF (also known as Project-Join Normal Form (PJNF) if a) it is in 4NF b) no further split of any kind can result in a lossless join. In practice, this is an impractical definition: a) Most tables in 4NF are in 5NF. b) The ones that aren't have a rather subtle structure.

41 Normalization Page 41 A super-subtle 5NF from Wikipedia Wednesday, February 10, :53 PM Traveling Brand Product Type Salesman Jack Schneider Acme Vacuum Jack Schneider Acme Cleaner Breadbox Mary Jones Robust Pruning Shears Mary Jones orobust Vacuum Mary Jones orobust Cleaner Breadbox Mary Jones orobust Umbrella Stand Louis Ferguson orobust Vacuum Louis Ferguson orobust Cleaner Telescope Louis Ferguson oacme Vacuum Louis Ferguson Acme Cleaner Lava Lamp Louis Ferguson Nimbus Tie Rack From < This cannot be split via the normal FD rules. But it can be split by another kind of rule: A Traveling Salesman has certain Brands and certain Product Types in his repertoire. If Brand B1 and Brand B2 are in his repertoire, and Product Type P is in his repertoire, then (assuming Brand B1 and Brand B2 both make Product Type P), the Traveling Salesman must offer products of

42 Normalization Page 42 Traveling Salesman must offer products of Product Type P those made by Brand B1 and those made by Brand B2. From < This is not an FD or an MVD rule. But it does give rise to a decomposition: {Traveling Salesman, Brand} and {Traveling Salesman, Product Type} whose join just happens to be lossless because of the (rather strange) rule!

43 A basic caveat Wednesday, February 10, :00 PM The effectiveness of a normalization depends upon how one writes into a database. So far, we have been studying normalizations that are based upon errors one can make with INSERT. But, in other kinds of databases, these normalizations fail to be useful because there is no INSERT available! Example: SOLR Key/value store A key determines a document. There is no concept of a partial change to a document. I.e., no INSERT. Three primitives set(key, document) get(key) # provides document search(phrases) # provides a set of documents matching the phrases No concept of a join. One must manually compute joins by fetching documents, getting keys from them, and then fetching sub-documents. In SOLR, thus Relational normalization is irrelevant. One wants documents to be large. Normalization Page 43

44 One wants documents to be large. One wants -- to the extent possible -- to avoid joins. Thus everything we learned so far won't help us! Normalization Page 44

CS 377 Database Systems. Database Design Theory and Normalization. Li Xiong Department of Mathematics and Computer Science Emory University

CS 377 Database Systems. Database Design Theory and Normalization. Li Xiong Department of Mathematics and Computer Science Emory University CS 377 Database Systems Database Design Theory and Normalization Li Xiong Department of Mathematics and Computer Science Emory University 1 Relational database design So far Conceptual database design

More information

COSC344 Database Theory and Applications. Lecture 9 Normalisation. COSC344 Lecture 9 1

COSC344 Database Theory and Applications. Lecture 9 Normalisation. COSC344 Lecture 9 1 COSC344 Database Theory and Applications Lecture 9 Normalisation COSC344 Lecture 9 1 Overview Last Lecture Functional Dependencies This Lecture Normalisation Introduction 1NF 2NF 3NF BCNF Source: Section

More information

Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases

Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Outline Informal Design Guidelines

More information

CS143 Notes: Normalization Theory

CS143 Notes: Normalization Theory CS143 Notes: Normalization Theory Book Chapters (4th) Chapters 7.1-6, 7.8, 7.10 (5th) Chapters 7.1-6, 7.8 (6th) Chapters 8.1-6, 8.8 INTRODUCTION Main question How do we design good tables for a relational

More information

Database Design and Normalization

Database Design and Normalization Database Design and Normalization CPS352: Database Systems Simon Miner Gordon College Last Revised: 9/27/12 Agenda Check-in Functional Dependencies (continued) Design Project E-R Diagram Presentations

More information

Theory of Relational Database Design and Normalization

Theory of Relational Database Design and Normalization Theory of Relational Database Design and Normalization (Based on Chapter 14 and some part of Chapter 15 in Fundamentals of Database Systems by Elmasri and Navathe) 1 Informal Design Guidelines for Relational

More information

Why Is This Important? Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) Example (Contd.)

Why Is This Important? Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) Example (Contd.) Why Is This Important? Schema Refinement and Normal Forms Chapter 19 Many ways to model a given scenario in a database How do we find the best one? We will discuss objective criteria for evaluating database

More information

Announcements. SQL is hot! Facebook. Goal. Database Design Process. IT420: Database Management and Organization. Normalization (Chapter 3)

Announcements. SQL is hot! Facebook. Goal. Database Design Process. IT420: Database Management and Organization. Normalization (Chapter 3) Announcements IT0: Database Management and Organization Normalization (Chapter 3) Department coin design contest deadline - February -week exam Monday, February 1 Lab SQL SQL Server: ALTER TABLE tname

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

normalisation Goals: Suppose we have a db scheme: is it good? define precise notions of the qualities of a relational database scheme

normalisation Goals: Suppose we have a db scheme: is it good? define precise notions of the qualities of a relational database scheme Goals: Suppose we have a db scheme: is it good? Suppose we have a db scheme derived from an ER diagram: is it good? define precise notions of the qualities of a relational database scheme define algorithms

More information

MCQs~Databases~Relational Model and Normalization http://en.wikipedia.org/wiki/database_normalization

MCQs~Databases~Relational Model and Normalization http://en.wikipedia.org/wiki/database_normalization http://en.wikipedia.org/wiki/database_normalization Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy. Normalization usually involves

More information

Chapter 10 Functional Dependencies and Normalization for Relational Databases

Chapter 10 Functional Dependencies and Normalization for Relational Databases Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright 2004 Pearson Education, Inc. Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of

More information

Database Design and Normal Forms

Database Design and Normal Forms Database Design and Normal Forms Database Design coming up with a good schema is very important How do we characterize the goodness of a schema? If two or more alternative schemas are available how do

More information

Schema Design and Normal Forms Sid Name Level Rating Wage Hours

Schema Design and Normal Forms Sid Name Level Rating Wage Hours Entity-Relationship Diagram Schema Design and Sid Name Level Rating Wage Hours Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke 1 Database Management Systems, 2 nd Edition. R. Ramakrishnan

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

DATABASE NORMALIZATION

DATABASE NORMALIZATION DATABASE NORMALIZATION Normalization: process of efficiently organizing data in the DB. RELATIONS (attributes grouped together) Accurate representation of data, relationships and constraints. Goal: - Eliminate

More information

Chapter 5: FUNCTIONAL DEPENDENCIES AND NORMALIZATION FOR RELATIONAL DATABASES

Chapter 5: FUNCTIONAL DEPENDENCIES AND NORMALIZATION FOR RELATIONAL DATABASES 1 Chapter 5: FUNCTIONAL DEPENDENCIES AND NORMALIZATION FOR RELATIONAL DATABASES INFORMAL DESIGN GUIDELINES FOR RELATION SCHEMAS We discuss four informal measures of quality for relation schema design in

More information

Limitations of E-R Designs. Relational Normalization Theory. Redundancy and Other Problems. Redundancy. Anomalies. Example

Limitations of E-R Designs. Relational Normalization Theory. Redundancy and Other Problems. Redundancy. Anomalies. Example Limitations of E-R Designs Relational Normalization Theory Chapter 6 Provides a set of guidelines, does not result in a unique database schema Does not provide a way of evaluating alternative schemas Normalization

More information

Chapter 5: Logical Database Design and the Relational Model Part 2: Normalization. Introduction to Normalization. Normal Forms.

Chapter 5: Logical Database Design and the Relational Model Part 2: Normalization. Introduction to Normalization. Normal Forms. Chapter 5: Logical Database Design and the Relational Model Part 2: Normalization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden Robert C. Nickerson ISYS

More information

Relational Database Design: FD s & BCNF

Relational Database Design: FD s & BCNF CS145 Lecture Notes #5 Relational Database Design: FD s & BCNF Motivation Automatic translation from E/R or ODL may not produce the best relational design possible Sometimes database designers like to

More information

Normalization in OODB Design

Normalization in OODB Design Normalization in OODB Design Byung S. Lee Graduate Programs in Software University of St. Thomas St. Paul, Minnesota bslee@stthomas.edu Abstract When we design an object-oriented database schema, we need

More information

Carnegie Mellon Univ. Dept. of Computer Science 15-415 - Database Applications. Overview - detailed. Goal. Faloutsos CMU SCS 15-415

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

More information

Theory of Relational Database Design and Normalization

Theory of Relational Database Design and Normalization Theory of Relational Database Design and Normalization (Based on Chapter 14 and some part of Chapter 15 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3) 1 Informal Design Guidelines for

More information

Functional Dependency and Normalization for Relational Databases

Functional Dependency and Normalization for Relational Databases Functional Dependency and Normalization for Relational Databases Introduction: Relational database design ultimately produces a set of relations. The implicit goals of the design activity are: information

More information

Chapter 10. Functional Dependencies and Normalization for Relational Databases. Copyright 2007 Ramez Elmasri and Shamkant B.

Chapter 10. Functional Dependencies and Normalization for Relational Databases. Copyright 2007 Ramez Elmasri and Shamkant B. Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Chapter Outline 1 Informal Design Guidelines for Relational Databases

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

Functional Dependencies

Functional Dependencies BCNF and 3NF Functional Dependencies Functional dependencies: modeling constraints on attributes stud-id name address course-id session-id classroom instructor Functional dependencies should be obtained

More information

Databases -Normalization III. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 1 / 31

Databases -Normalization III. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 1 / 31 Databases -Normalization III (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 1 / 31 This lecture This lecture describes 3rd normal form. (N Spadaccini 2010 and W Liu 2012) Databases -

More information

Normalization of Database

Normalization of Database Normalization of Database UNIT-4 Database Normalisation is a technique of organizing the data in the database. Normalization is a systematic approach of decomposing tables to eliminate data redundancy

More information

Relational Database Design

Relational Database Design Relational Database Design To generate a set of relation schemas that allows - to store information without unnecessary redundancy - to retrieve desired information easily Approach - design schema in appropriate

More information

Chapter 10. Functional Dependencies and Normalization for Relational Databases

Chapter 10. 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

Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 5: Normalization II; Database design case studies. September 26, 2005

Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 5: Normalization II; Database design case studies. September 26, 2005 Introduction to Databases, Fall 2005 IT University of Copenhagen Lecture 5: Normalization II; Database design case studies September 26, 2005 Lecturer: Rasmus Pagh Today s lecture Normalization II: 3rd

More information

Basic Components of an LP:

Basic Components of an LP: 1 Linear Programming Optimization is an important and fascinating area of management science and operations research. It helps to do less work, but gain more. Linear programming (LP) is a central topic

More information

Lecture 2 Normalization

Lecture 2 Normalization MIT 533 ระบบฐานข อม ล 2 Lecture 2 Normalization Walailuk University Lecture 2: Normalization 1 Objectives The purpose of normalization The identification of various types of update anomalies The concept

More information

CSCI-GA.2433-001 Database Systems Lecture 7: Schema Refinement and Normalization

CSCI-GA.2433-001 Database Systems Lecture 7: Schema Refinement and Normalization CSCI-GA.2433-001 Database Systems Lecture 7: Schema Refinement and Normalization Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com View 1 View 2 View 3 Conceptual Schema At that point we

More information

Design of Relational Database Schemas

Design of Relational Database Schemas Design of Relational Database Schemas T. M. Murali October 27, November 1, 2010 Plan Till Thanksgiving What are the typical problems or anomalies in relational designs? Introduce the idea of decomposing

More information

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ:

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ: Review Quiz will contain very similar question as below. Some questions may even be repeated. The order of the questions are random and are not in order of

More information

Chapter 8. Database Design II: Relational Normalization Theory

Chapter 8. Database Design II: Relational Normalization Theory Chapter 8 Database Design II: Relational Normalization Theory The E-R approach is a good way to start dealing with the complexity of modeling a real-world enterprise. However, it is only a set of guidelines

More information

Part 6. Normalization

Part 6. Normalization Part 6 Normalization Normal Form Overview Universe of All Data Relations (normalized / unnormalized 1st Normal Form 2nd Normal Form 3rd Normal Form Boyce-Codd Normal Form (BCNF) 4th Normal Form 5th Normal

More information

Normalisation to 3NF. Database Systems Lecture 11 Natasha Alechina

Normalisation to 3NF. Database Systems Lecture 11 Natasha Alechina Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third Normal Forms For more

More information

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen 2007-05-24

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen 2007-05-24 LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen 2007-05-24 1. A database schema is a. the state of the db b. a description of the db using a

More information

Schema Refinement and Normalization

Schema Refinement and Normalization Schema Refinement and Normalization Module 5, Lectures 3 and 4 Database Management Systems, R. Ramakrishnan 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational

More information

Database Systems Concepts, Languages and Architectures

Database Systems Concepts, Languages and Architectures These slides are for use with Database Systems Concepts, Languages and Architectures Paolo Atzeni Stefano Ceri Stefano Paraboschi Riccardo Torlone To view these slides on-screen or with a projector use

More information

Lecture Notes on Database Normalization

Lecture Notes on Database Normalization Lecture Notes on Database Normalization Chengkai Li Department of Computer Science and Engineering The University of Texas at Arlington April 15, 2012 I decided to write this document, because many students

More information

RELATIONAL DATABASE DESIGN

RELATIONAL DATABASE DESIGN RELATIONAL DATABASE DESIGN g Good database design - Avoiding anomalies g Functional Dependencies g Normalization & Decomposition Using Functional Dependencies g 1NF - Atomic Domains and First Normal Form

More information

Schema Refinement, Functional Dependencies, Normalization

Schema Refinement, Functional Dependencies, Normalization Schema Refinement, Functional Dependencies, Normalization MSCI 346: Database Systems Güneş Aluç, University of Waterloo Spring 2015 MSCI 346: Database Systems Chapter 19 1 / 42 Outline 1 Introduction Design

More information

Normal forms and normalization

Normal forms and normalization Normal forms and normalization An example of normalization using normal forms We assume we have an enterprise that buys products from different supplying companies, and we would like to keep track of our

More information

Database Management System

Database Management System UNIT -6 Database Design Informal Design Guidelines for Relation Schemas; Functional Dependencies; Normal Forms Based on Primary Keys; General Definitions of Second and Third Normal Forms; Boyce-Codd Normal

More information

Introduction Decomposition Simple Synthesis Bernstein Synthesis and Beyond. 6. Normalization. Stéphane Bressan. January 28, 2015

Introduction Decomposition Simple Synthesis Bernstein Synthesis and Beyond. 6. Normalization. Stéphane Bressan. January 28, 2015 6. Normalization Stéphane Bressan January 28, 2015 1 / 42 This lecture is based on material by Professor Ling Tok Wang. CS 4221: Database Design The Relational Model Ling Tok Wang National University of

More information

Chapter 9: Normalization

Chapter 9: Normalization Chapter 9: Normalization Part 1: A Simple Example Part 2: Another Example & The Formal Stuff A Problem: Keeping Track of Invoices (cont d) Suppose we have some invoices that we may or may not want to refer

More information

Normalization. CIS 331: Introduction to Database Systems

Normalization. CIS 331: Introduction to Database Systems Normalization CIS 331: Introduction to Database Systems Normalization: Reminder Why do we need to normalize? To avoid redundancy (less storage space needed, and data is consistent) To avoid update/delete

More information

6.830 Lecture 3 9.16.2015 PS1 Due Next Time (Tuesday!) Lab 1 Out today start early! Relational Model Continued, and Schema Design and Normalization

6.830 Lecture 3 9.16.2015 PS1 Due Next Time (Tuesday!) Lab 1 Out today start early! Relational Model Continued, and Schema Design and Normalization 6.830 Lecture 3 9.16.2015 PS1 Due Next Time (Tuesday!) Lab 1 Out today start early! Relational Model Continued, and Schema Design and Normalization Animals(name,age,species,cageno,keptby,feedtime) Keeper(id,name)

More information

BCA. Database Management System

BCA. Database Management System BCA IV Sem Database Management System Multiple choice questions 1. A Database Management System (DBMS) is A. Collection of interrelated data B. Collection of programs to access data C. Collection of data

More information

C# Cname Ccity.. P1# Date1 Qnt1 P2# Date2 P9# Date9 1 Codd London.. 1 21.01 20 2 23.01 2 Martin Paris.. 1 26.10 25 3 Deen London.. 2 29.

C# Cname Ccity.. P1# Date1 Qnt1 P2# Date2 P9# Date9 1 Codd London.. 1 21.01 20 2 23.01 2 Martin Paris.. 1 26.10 25 3 Deen London.. 2 29. 4. Normalisation 4.1 Introduction Suppose we are now given the task of designing and creating a database. How do we produce a good design? What relations should we have in the database? What attributes

More information

DATABASE MANAGEMENT SYSTEMS. Question Bank:

DATABASE MANAGEMENT SYSTEMS. Question Bank: DATABASE MANAGEMENT SYSTEMS Question Bank: UNIT 1 1. Define Database? 2. What is a DBMS? 3. What is the need for database systems? 4. Define tupule? 5. What are the responsibilities of DBA? 6. Define schema?

More information

DATABASE SYSTEMS. Chapter 7 Normalisation

DATABASE SYSTEMS. Chapter 7 Normalisation DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation 1 (Rob, Coronel & Crockett 978184480731) In this chapter, you will learn: What normalization

More information

Chapter 7: Relational Database Design

Chapter 7: Relational Database Design Chapter 7: Relational Database Design Pitfalls in Relational Database Design Decomposition Normalization Using Functional Dependencies Normalization Using Multivalued Dependencies Normalization Using Join

More information

Advanced Relational Database Design

Advanced Relational Database Design APPENDIX B Advanced Relational Database Design In this appendix we cover advanced topics in relational database design. We first present the theory of multivalued dependencies, including a set of sound

More information

Determination of the normalization level of database schemas through equivalence classes of attributes

Determination of the normalization level of database schemas through equivalence classes of attributes Computer Science Journal of Moldova, vol.17, no.2(50), 2009 Determination of the normalization level of database schemas through equivalence classes of attributes Cotelea Vitalie Abstract In this paper,

More information

Week 11: Normal Forms. Logical Database Design. Normal Forms and Normalization. Examples of Redundancy

Week 11: Normal Forms. Logical Database Design. Normal Forms and Normalization. Examples of Redundancy Week 11: Normal Forms Database Design Database Redundancies and Anomalies Functional Dependencies Entailment, Closure and Equivalence Lossless Decompositions The Third Normal Form (3NF) The Boyce-Codd

More information

Introduction to normalization. Introduction to normalization

Introduction to normalization. Introduction to normalization Introduction to normalization Lecture 4 Instructor Anna Sidorova Agenda Presentation Review of relational models, in class exersise Introduction to normalization In-class exercises Discussion of HW2 1

More information

Normalization in Database Design

Normalization in Database Design in Database Design Marek Rychly mrychly@strathmore.edu Strathmore University, @ilabafrica & Brno University of Technology, Faculty of Information Technology Advanced Databases and Enterprise Systems 14

More information

SQL Server. 1. What is RDBMS?

SQL Server. 1. What is RDBMS? SQL Server 1. What is RDBMS? Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained

More information

Normalization. Functional Dependence. Normalization. Normalization. GIS Applications. Spring 2011

Normalization. Functional Dependence. Normalization. Normalization. GIS Applications. Spring 2011 Normalization Normalization Normalization is a foundation for relational database design Systematic approach to efficiently organize data in a database GIS Applications Spring 2011 Objectives Minimize

More information

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model CS2Bh: Current Technologies Introduction to XML and Relational Databases Spring 2005 The Relational Model CS2 Spring 2005 (LN6) 1 The relational model Proposed by Codd in 1970. It is the dominant data

More information

Limitations of DB Design Processes

Limitations of DB Design Processes Normalization CS 317/387 1 Limitations of DB Design Processes Provides a set of guidelines, does not result in a unique database schema Does not provide a way of evaluating alternative schemas Pitfalls:

More information

Database Normalization. Mohua Sarkar, Ph.D Software Engineer California Pacific Medical Center 415-600-7003 sarkarm@sutterhealth.

Database Normalization. Mohua Sarkar, Ph.D Software Engineer California Pacific Medical Center 415-600-7003 sarkarm@sutterhealth. Database Normalization Mohua Sarkar, Ph.D Software Engineer California Pacific Medical Center 415-600-7003 sarkarm@sutterhealth.org Definition A database is an organized collection of data whose content

More information

Functional Dependencies and Normalization

Functional Dependencies and Normalization Functional Dependencies and Normalization 5DV119 Introduction to Database Management Umeå University Department of Computing Science Stephen J. Hegner hegner@cs.umu.se http://www.cs.umu.se/~hegner Functional

More information

Database Management Systems. Redundancy and Other Problems. Redundancy

Database Management Systems. Redundancy and Other Problems. Redundancy Database Management Systems Winter 2004 CMPUT 391: Database Design Theory or Relational Normalization Theory Dr. Osmar R. Zaïane Lecture 2 Limitations of Relational Database Designs Provides a set of guidelines,

More information

2. Basic Relational Data Model

2. Basic Relational Data Model 2. Basic Relational Data Model 2.1 Introduction Basic concepts of information models, their realisation in databases comprising data objects and object relationships, and their management by DBMS s that

More information

The Relational Data Model and Relational Database Constraints

The Relational Data Model and Relational Database Constraints The Relational Data Model and Relational Database Constraints Chapter Outline Relational Model Concepts Relational Model Constraints and Relational Database Schemas Update Operations and Dealing with Constraint

More information

Jordan University of Science & Technology Computer Science Department CS 728: Advanced Database Systems Midterm Exam First 2009/2010

Jordan University of Science & Technology Computer Science Department CS 728: Advanced Database Systems Midterm Exam First 2009/2010 Jordan University of Science & Technology Computer Science Department CS 728: Advanced Database Systems Midterm Exam First 2009/2010 Student Name: ID: Part 1: Multiple-Choice Questions (17 questions, 1

More information

Boyce-Codd Normal Form

Boyce-Codd Normal Form 4NF Boyce-Codd Normal Form A relation schema R is in BCNF if for all functional dependencies in F + of the form α β at least one of the following holds α β is trivial (i.e., β α) α is a superkey for R

More information

Current California Math Standards Balanced Equations

Current California Math Standards Balanced Equations Balanced Equations Current California Math Standards Balanced Equations Grade Three Number Sense 1.0 Students understand the place value of whole numbers: 1.1 Count, read, and write whole numbers to 10,000.

More information

c 2008 Je rey A. Miron We have described the constraints that a consumer faces, i.e., discussed the budget constraint.

c 2008 Je rey A. Miron We have described the constraints that a consumer faces, i.e., discussed the budget constraint. Lecture 2b: Utility c 2008 Je rey A. Miron Outline: 1. Introduction 2. Utility: A De nition 3. Monotonic Transformations 4. Cardinal Utility 5. Constructing a Utility Function 6. Examples of Utility Functions

More information

Unit 3.1. Normalisation 1 - V2.0 1. Normalisation 1. Dr Gordon Russell, Copyright @ Napier University

Unit 3.1. Normalisation 1 - V2.0 1. Normalisation 1. Dr Gordon Russell, Copyright @ Napier University Normalisation 1 Unit 3.1 Normalisation 1 - V2.0 1 Normalisation Overview discuss entity integrity and referential integrity describe functional dependency normalise a relation to first formal form (1NF)

More information

Introduction to Database Systems. Normalization

Introduction to Database Systems. Normalization Introduction to Database Systems Normalization Werner Nutt 1 Normalization 1. Anomalies 1. Anomalies 2. Boyce-Codd Normal Form 3. 3 rd Normal Form 2 Anomalies The goal of relational schema design is to

More information

DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF)

DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF) DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF) Tables that contain redundant data can suffer from update anomalies, which can introduce inconsistencies into a database. The rules associated

More information

How To Find Out What A Key Is In A Database Engine

How To Find Out What A Key Is In A Database Engine Database design theory, Part I Functional dependencies Introduction As we saw in the last segment, designing a good database is a non trivial matter. The E/R model gives a useful rapid prototyping tool,

More information

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

More information

Theory behind Normalization & DB Design. Satisfiability: Does an FD hold? Lecture 12

Theory behind Normalization & DB Design. Satisfiability: Does an FD hold? Lecture 12 Theory behind Normalization & DB Design Lecture 12 Satisfiability: Does an FD hold? Satisfiability of FDs Given: FD X Y and relation R Output: Does R satisfy X Y? Algorithm: a.sort R on X b.do all the

More information

Financial Mathematics

Financial Mathematics Financial Mathematics For the next few weeks we will study the mathematics of finance. Apart from basic arithmetic, financial mathematics is probably the most practical math you will learn. practical in

More information

Relational Database Design Theory

Relational Database Design Theory Relational Database Design Theory Informal guidelines for good relational designs Functional dependencies Normal forms and normalization 1NF, 2NF, 3NF BCNF, 4NF, 5NF Inference rules on functional dependencies

More information

Relational Normalization Theory (supplemental material)

Relational Normalization Theory (supplemental material) Relational Normalization Theory (supplemental material) CSE 532, Theory of Database Systems Stony Brook University http://www.cs.stonybrook.edu/~cse532 2 Quiz 8 Consider a schema S with functional dependencies:

More information

Normalisation 1. Chapter 4.1 V4.0. Copyright @ Napier University

Normalisation 1. Chapter 4.1 V4.0. Copyright @ Napier University Normalisation 1 Chapter 4.1 V4.0 Copyright @ Napier University Normalisation Overview discuss entity integrity and referential integrity describe functional dependency normalise a relation to first formal

More information

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB Outline Database concepts Conceptual Design Logical Design Communicating with the RDBMS 2 Some concepts Database: an

More information

Topic 5.1: Database Tables and Normalization

Topic 5.1: Database Tables and Normalization Topic 5.1: Database Tables and Normalization What is Normalization? Normalization is a process for evaluating and correcting table structures to minimize data redundancies, thereby helping to eliminate

More information

Common sense, and the model that we have used, suggest that an increase in p means a decrease in demand, but this is not the only possibility.

Common sense, and the model that we have used, suggest that an increase in p means a decrease in demand, but this is not the only possibility. Lecture 6: Income and Substitution E ects c 2009 Je rey A. Miron Outline 1. Introduction 2. The Substitution E ect 3. The Income E ect 4. The Sign of the Substitution E ect 5. The Total Change in Demand

More information

Regions in a circle. 7 points 57 regions

Regions in a circle. 7 points 57 regions Regions in a circle 1 point 1 region points regions 3 points 4 regions 4 points 8 regions 5 points 16 regions The question is, what is the next picture? How many regions will 6 points give? There's an

More information

XV. The Entity-Relationship Model

XV. The Entity-Relationship Model XV. The Entity-Relationship Model The Entity-Relationship Model Entities, Relationships and Attributes Cardinalities, Identifiers and Generalization Documentation of E-R Diagrams and Business Rules The

More information

A Simple Guide to Five Normal Forms in Relational Database Theory

A Simple Guide to Five Normal Forms in Relational Database Theory William Kent, "A Simple Guide to Five Normal Forms in Relational Database Theory", Communications of the ACM 26(2), Feb. 1983, 120-125. Also IBM Technical Report TR03.159, Aug. 1981. Also presented at

More information

Chapter 6. Database Tables & Normalization. The Need for Normalization. Database Tables & Normalization

Chapter 6. Database Tables & Normalization. The Need for Normalization. Database Tables & Normalization Chapter 6 Database Tables & Normalization Objectives: to learn What normalization is and what role it plays in the database design process About the normal forms 1NF, 2NF, 3NF, BCNF, and 4NF How normal

More information

Module 5: Normalization of database tables

Module 5: Normalization of database tables Module 5: Normalization of database tables Normalization is a process for evaluating and correcting table structures to minimize data redundancies, thereby reducing the likelihood of data anomalies. The

More information

B2.2-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

B2.2-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS B2.2-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

DIVISIBILITY AND GREATEST COMMON DIVISORS

DIVISIBILITY AND GREATEST COMMON DIVISORS DIVISIBILITY AND GREATEST COMMON DIVISORS KEITH CONRAD 1 Introduction We will begin with a review of divisibility among integers, mostly to set some notation and to indicate its properties Then we will

More information

UNDERSTANDING NORMALIZATION

UNDERSTANDING NORMALIZATION UNDERSTANDING NORMALIZATION A solid database structure is the foundation of any successful database application, and you will inevitably encounter problems if your database is poorly designed. Regardless

More information

Pigeonhole Principle Solutions

Pigeonhole Principle Solutions Pigeonhole Principle Solutions 1. Show that if we take n + 1 numbers from the set {1, 2,..., 2n}, then some pair of numbers will have no factors in common. Solution: Note that consecutive numbers (such

More information

Introduction to Database Systems. Chapter 4 Normal Forms in the Relational Model. Chapter 4 Normal Forms

Introduction to Database Systems. Chapter 4 Normal Forms in the Relational Model. Chapter 4 Normal Forms Introduction to Database Systems Winter term 2013/2014 Melanie Herschel melanie.herschel@lri.fr Université Paris Sud, LRI 1 Chapter 4 Normal Forms in the Relational Model After completing this chapter,

More information

The 3 Normal Forms: Copyright Fred Coulson 2007 (last revised February 1, 2009)

The 3 Normal Forms: Copyright Fred Coulson 2007 (last revised February 1, 2009) The 3 Normal Forms: A Tutorial by Fred Coulson Copyright Fred Coulson 2007 (last revised February 1, 2009) This tutorial may be freely copied and distributed, providing appropriate attribution to the author

More information

RELATIONAL DATABASE DESIGN. Basic Concepts

RELATIONAL DATABASE DESIGN. Basic Concepts Basic Concepts a database is an collection of logically related records a relational database stores its data in 2-dimensional tables a table is a two-dimensional structure made up of rows (tuples, records)

More information