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

Save this PDF as:
Size: px
Start display at page:

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

## Transcription

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

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

3 Normal Forms BCNF - recap The BCNF decomposition of a relation is derived by a recursive algorithm. A lossless-join decomposition is derived which may not be dependency preserving. The decomposition is too restrictive. To make the decomposition in the previous example dependency preserving we can cover the FD JP C by adding its attributes as a relation R 1 = CSJDQV R 2 = SDP R 3 = JPC We have added the required FD involving key attributes that were prohibited by BCNF. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 3 / 31

4 Normal Forms 3NF A relational schema is in 3NF if for every functional dependency X A (where X is a subset of the attributes and A is a single attribute) either A X (that is, X A is a trivial FD), or X is a superkey, or A is part of some key for R. Thus the definition of 3NF permits a few additional FDs involving key attributes that are prohibited by BCNF. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 4 / 31

5 Normal Forms The contracts example The contracts example was not in BCNF because of the FD SD P However as P is part of a key (JP), this FD does not violate the conditions for 3NF. Therefore neither of the two given FDs violate the conditions for 3NF. Checking all the other (implied) FDs shows that contracts is already in 3NF and thus need not be decomposed further. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 5 / 31

6 Normal Forms Properties of 3NF The most important property of 3NF is the result that there is always a lossless-join and dependency-preserving decomposition of any relational schema into 3NF. While not conceptually difficult, the algorithm to decompose a relation schema into 3NF is quite fiddly and much more complicated than the simple algorithm for decomposition into BCNF. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 6 / 31

7 Normal Forms 3NF Synthesis The BCNF algorithm is from the perspective of deriving a lossless-join decomposition, and dependency preservation was addressed by adding extra relation schemas. An alternative approach involves synthesis that takes the attributes of the original relation R and the minimal cover F of the FDs and adds a relation schema XA for each FD X A in F. The resulting collection of relations is 3NF and preserves all FDs. If it is not lossless-join, it is made so by adding a relation that contains those attributes that appear in some key. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 7 / 31

8 Normal Forms The two approaches The decomposition algorithm derives the relations while maintaining the keys, thus emphasizing the lossless-join property, and deals with dependency preservation by adding the necessary relations. The synthesis algorithm build the relations from the set of FDs, emphasizing the dependencies, and then deals with lossless-join issues after the fact by adding the necessary relation. The latter is an algorithm that has polynomial complexity. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 8 / 31

9 3NF synthesis The Synthesis Algorithm Given a relation R and a set of functional dependencies X Y where X and Y are subsets of the attributes of R. 1 Compute the closures of the FDs. 2 Use ➀ to find all the candidate keys of the relation R. 3 Find the minimal cover of the relation R. 4 Use ➂ to produce R i decompositions in 3NF. 5 If no R i is a super key of R, add a relation containing the key. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 9 / 31

10 3NF synthesis FD closures 1 Compute the closures of the FDs. For each X Y, derive (X) + the set of attributes of R covered by X Y. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 10 / 31

11 3NF synthesis Candidate keys 2 Use ➀ to find all the candidate keys of the relation R. If any (X) + covers all the attributes of R then X is a key. It is possibly a super key with redundant attributes contained within X (these will be obvious). Otherwise find the (X) + that maximally covers R and add to X attributes of R missing from the closure. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 11 / 31

12 3NF synthesis Minimal cover 3 Find the minimal cover of the relation R. ALGORITHM: Step 1 Decompose all the FDs to the form X A, where A is a single attribute. Step 2 Eliminate redundant attributes from the LHS. If XB A, where B is a single attribute and X A is entailed within the set, then B was unnecessary. If LHS has more than one attribute, compute closure of each set that leaves out one attribute. If it includes the right side, remove the extra attribute in the functional dependency. Step 3 Delete the redundant FDs. For each dependency, compute the closure of the determinant attributes against all the other dependencies except the one you re testing. If you find the attribute on the right side in the closure, you can leave that dependency out. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 12 / 31

13 3NF synthesis 3NF relations 4 Use ➂ to produce R i decompositions in 3NF. ALGORITHM: Step 1 Combine all FDs with the same LHS For each X such that X A, X B... X AB... Step 2 Form a relation R i of all attributes in each FD. For each X ABC, form {X, A, B, C}. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 13 / 31

14 3NF synthesis 3NF relations 5 If no R i is a super key of R, add a relation containing the key. If UVW is a key for R, and no relation R i formed in the 3NF decomposition contains a super key of R, then add {U, V, W} as a relation. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 14 / 31

15 3NF synthesis Exercise Consider R = {A, B, C, D, E, G} and the following FDs 1 AB C 2 C A 3 BC D 4 ACD B 5 D EG 6 BE C 7 CG BD 8 CE AG (AB) + = ABCDEG (C) + = AC (BC) + = ABCDEG (ACD) + = ABCDEG (D) + = DEG (BE) + = ABCDEG (CG) + = ABCDEG (CE) + = ABCDEG AB is a key BC is a key ACD is a super key BE is a key CG is a key CE is a key Applying Armstrong s Axioms gives BD and CD are also keys. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 15 / 31

16 3NF synthesis Generate minimal cover - Working Original FDs 1 AB C 2 C A 3 BC D 4 ACD B 5 D EG 6 BE C 7 CG BD 8 CE AG single RHS 1 AB C 2 C A 3 BC D 4 ACD B 5 D E 6 D G 7 BE C 8 CG B 9 CG D 10 CE A 11 CE G redundant LHS 1 AB C 2 C A 3 BC D 4 ACD B 5 D E 6 D G 7 BE C 8 CG B 9 CG D 10 CE A 11 CE G minimal FDs (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 16 / 31

17 3NF synthesis Generate minimal cover single RHS 1 AB C 2 C A 3 BC D 4 ACD B 5 D E 6 D G 7 BE C 8 CG B 9 CG D 10 CE A 11 CE G redundant LHS 1 AB C 2 C A 3 BC D 4 ACD B 5 D E 6 D G 7 BE C 8 CG B 9 CG D 10 CE A 11 CE G duplications delete ➇ = ➈ + ➃ delete ➉ = ➁ minimal FDs 1 AB C 2 C A 3 BC D 4 CD B 5 D E 6 D G 7 BE C 8 9 CG D CE G (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 17 / 31

18 3NF Synthesis The synthesis process Combine same LHS 1 AB C 2 C A 3 BC D 4 CD B 5 D E, D G 6 BE C 7 CG D 8 CE G Form relations 1 {A, B, C} 2 {C, A} 3 {B, C, D} 4 {C, D, B} 5 {D, E, G} 6 {B, E, C} 7 {C, G, D} 8 {C, E, G} The 3NF decomposition 1 {A, B, C} 2 ➁ is a proper subset of ➀ 3 {B, C, D} 4 ➃ is a subset of ➂ 5 {D, E, G} 6 {B, E, C} 7 {C, G, D} 8 {C, E, G} (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 18 / 31

19 3NF Synthesis Final 3NF decomposition {A, B, C}{B, C, D}{D, E, G}{B, E, C}{C, G, D}{C, E, G}. Super key is contained in at least one relation. We have looked at how to confirm the decomposition is a lossless-join when an original relation R is decomposed into two R 1 and R 2. Simply check the shared attribute(s) of R 1 and R 2 to see if it is a superkey for either R 1 or R 2. However when decomposed into more than two relations, we will need to use the algorithm described in the next three slides to check for lossless decomposition. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 19 / 31

20 3NF Synthesis Definition - Lossless Join Property Definition: A decomposition D = {R 1, R 2,..., R m } of R has the lossless (nonadditive) join property with respect to the set of dependencies F on R if, for every relation state R i of R that satisfies F, the natural join of all the relations in D: R 1 R 2... R m = R Note: The word loss in lossless refers to loss of information, not to loss of tuples. In fact, for loss of information a better term is addition of spurious information. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 20 / 31

21 3NF Synthesis Algorithm for Testing Lossless Join Property Step 1 Create an initial matrix with one row for each decomposed relation R i, and one column for each attribute A j in the original relation R. Step 2 For the ith row, if the jth attribute is in R i, cell (i, j) should contain value a j, otherwise, b ij. A B C D E G R 1 {A, B, C} a 1 a 2 a 3 b 14 b 15 b 16 R 2 {B, C, D} b 21 a 2 a 3 a 4 b 25 b 26 R 3 {D, E, G} b 31 b 32 b 33 a 4 a 5 a 6 R 4 {B, E, C} b 41 a 2 a 3 b 44 a 5 b 46 R 5 {C, G, D} b 51 b 52 a 3 a 4 b 55 a 6 R 6 {C, E, G} b 61 b 62 a 3 b 64 a 5 a 6 (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 21 / 31

22 3NF Synthesis Algorithm for Testing Lossless Join Property (contd.) Step 3 Apply functional dependencies to replace the b ij s with a j s. Step 4 If there is a row contains all a j s, the decomposition is lossless. A B C D E G R 1 {A, B, C} a 1 a 2 a 3 R 2 {B, C, D} a 2 a 3 a 4 R 3 {D, E, G} a 4 a 5 a 6 R 4 {B, E, C} a 2 a 3 a 5 R 5 {C, G, D} a 3 a 4 a 6 R 6 {C, E, G} a 3 a 5 a 6 1 AB C 2 C A 3 BC D 4 CD B 5 D E 6 D G 7 BE C 8 CG D 9 CE G (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 22 / 31

23 3NF Synthesis Manual normalization Data typically employed in a business is usually presented as below. However to be useful in a database the data needs to be normalized. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 23 / 31

24 3NF Synthesis First normal form 1NF First normal form (1NF) requires attribute values be atomic that is, individual values rather than lists or sets and that a primary key is defined. This table is in 1NF. The primary key is (Order ID, Product ID). (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 24 / 31

25 3NF Synthesis Second normal form 2NF A relation in first normal form (1NF) has the above functional dependencies. A relation is in Second normal for (2NF) if it is in 1NF and contains no partial dependencies. A partial functional dependency exists when a nonkey attribute is functionally dependent on part of, but not all of, the primary key. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 25 / 31

26 3NF Synthesis Second normal form 2NF 2NF is achieved by creating three (3) relations with the following attributes and keys. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 26 / 31

27 3NF Synthesis Third normal form 3NF A relation in second normal form (2NF) still has the above functional dependencies. A relation is in Third normal form (3NF) if it is in 2NF and contains no transitive dependencies. A transitive functional dependency in a relation is a functional dependency between two or more nonkey attributes. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 27 / 31

28 3NF Synthesis Third normal form 3NF 3NF is achieved by creating an additional relation with the following attributes and keys. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 28 / 31

29 3NF Synthesis Practical Use of Normalization In practice, the DBA should be guided by the theory of normalization, but not slavishly follow it. When the ER diagram is converted into tables, any functional dependencies should be identified and a decision made as to whether the tables should be normalized or not. Occasionally it will even be appropriate to de-normalize data if the most frequently occurring queries involve expensive joins of the normalized tables. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 29 / 31

30 Aside Multi-valued Attributes A Single-valued attribute of an entity instance has just one value. This has been the typical scenario we have discussed so far and know how this is handled in a schema definition. A Multi-valued attribute is an attribute that can take on more than one value for a given entity instance. Diagrammatically this is indicated in an ERD by a double edged ellipse. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 30 / 31

31 Aside Multi-valued Attributes The mapping of an entity with a multi-valued attribute is achieved by the following. The first relation contains all the attributes of the entity type except the multi-valued attribute. The second relation contains the attributes that form the primary key of the second relation. The first of these attributes is the primary key of the first relation, and hence it is a foreign key. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 31 / 31

### 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

### 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

### 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

### 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

### 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

### Database Design and Normalization

Database Design and Normalization Chapter 10 (Week 11) EE562 Slides and Modified Slides from Database Management Systems, R. Ramakrishnan 1 Computing Closure F + Example: List all FDs with: - a single

### 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

### 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:

### 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

### 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

### 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

### 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

### 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

### 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

### 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,

### 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

### 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

### 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

### 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

### Quiz 3: Database Systems I Instructor: Hassan Khosravi Spring 2012 CMPT 354

Quiz 3: Database Systems I Instructor: Hassan Khosravi Spring 2012 CMPT 354 1. [10] Show that each of the following are not valid rules about FD s by giving a small example relations that satisfy the given

### 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

### 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

### 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

### 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

### 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

### 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

### 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

### Objectives of Database Design Functional Dependencies 1st Normal Form Decomposition Boyce-Codd Normal Form 3rd Normal Form Multivalue Dependencies

Objectives of Database Design Functional Dependencies 1st Normal Form Decomposition Boyce-Codd Normal Form 3rd Normal Form Multivalue Dependencies 4th Normal Form General view over the design process 1

### 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

### 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

### 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

### 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

### 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

### 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

### 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

### 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

### Theory I: Database Foundations

Theory I: Database Foundations 19. 19. Theory I: Database Foundations 07.2012 1 Theory I: Database Foundations 20. Formal Design 20. 20: Formal Design We want to distinguish good from bad database design.

### 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

### 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

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

### Design Theory for Relational Databases: Functional Dependencies and Normalization

Design Theory for Relational Databases: Functional Dependencies and Normalization Juliana Freire Some slides adapted from L. Delcambre, R. Ramakrishnan, G. Lindstrom, J. Ullman and Silberschatz, Korth

### 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

### 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

### 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

### 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:

### 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)

### 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

### 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

### 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

### Normalisation. Why normalise? To improve (simplify) database design in order to. Avoid update problems Avoid redundancy Simplify update operations

Normalisation Why normalise? To improve (simplify) database design in order to Avoid update problems Avoid redundancy Simplify update operations 1 Example ( the practical difference between a first normal

### Database design theory, Part I

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,

### 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

### Relational Normalization: Contents. Relational Database Design: Rationale. Relational Database Design. Motivation

Relational Normalization: Contents Motivation Functional Dependencies First Normal Form Second Normal Form Third Normal Form Boyce-Codd Normal Form Decomposition Algorithms Multivalued Dependencies and

### 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

### 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

### 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

### 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

### An Algorithmic Approach to Database Normalization

An Algorithmic Approach to Database Normalization M. Demba College of Computer Science and Information Aljouf University, Kingdom of Saudi Arabia bah.demba@ju.edu.sa ABSTRACT When an attempt is made to

### 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

### 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)

### A Web-Based Environment for Learning Normalization of Relational Database Schemata

A Web-Based Environment for Learning Normalization of Relational Database Schemata Nikolay Georgiev September 2008 Master s Thesis in Computing Science, 30 ECTS credits Supervisor at CS-UmU: Stephen J.

### Fundamentals of Database System

Fundamentals of Database System Chapter 4 Normalization Fundamentals of Database Systems (Chapter 4) Page 1 Introduction To Normalization In general, the goal of a relational database design is to generate

### 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

### 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

### 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

### 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

### 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,

### Unique column combinations

Unique column combinations Arvid Heise Guest lecture in Data Profiling and Data Cleansing Prof. Dr. Felix Naumann Agenda 2 Introduction and problem statement Unique column combinations Exponential search

### 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

### 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

### 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

### 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

### Normalization of database model. Pazmany Peter Catholic University 2005 Zoltan Fodroczi

Normalization of database model Pazmany Peter Catholic University 2005 Zoltan Fodroczi Closure of an attribute set Given a set of attributes α define the closure of attribute set α under F (denoted as

### 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

### 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

### LOGICAL DATABASE DESIGN

MODULE 8 LOGICAL DATABASE DESIGN OBJECTIVE QUESTIONS There are 4 alternative answers to each question. One of them is correct. Pick the correct answer. Do not guess. A key is given at the end of the module

### 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

### 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

### SQL DDL. DBS Database Systems Designing Relational Databases. Inclusion Constraints. Key Constraints

DBS Database Systems Designing Relational Databases Peter Buneman 12 October 2010 SQL DDL In its simplest use, SQL s Data Definition Language (DDL) provides a name and a type for each column of a table.

### 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

### 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

### 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

### 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

### 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

### Teaching Database Modeling and Design: Areas of Confusion and Helpful Hints

Journal of Information Technology Education Volume 6, 2007 Teaching Database Modeling and Design: Areas of Confusion and Helpful Hints George C. Philip, Ph. D. College of Business, The University of Wisconsin

### 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

### Database Sample Examination

Part 1: SQL Database Sample Examination (Spring 2007) Question 1: Draw a simple ER diagram that results in a primary key/foreign key constraint to be created between the tables: CREATE TABLE Salespersons

### Normalization. Reduces the liklihood of anomolies

Normalization Normalization Tables are important, but properly designing them is even more important so the DBMS can do its job Normalization the process for evaluating and correcting table structures

### Graham Kemp (telephone 772 54 11, room 6475 EDIT) The examiner will visit the exam room at 15:00 and 17:00.

CHALMERS UNIVERSITY OF TECHNOLOGY Department of Computer Science and Engineering Examination in Databases, TDA357/DIT620 Tuesday 17 December 2013, 14:00-18:00 Examiner: Results: Exam review: Grades: Graham

Topic Normalisation 6 LEARNING OUTCOMES When you have completed this Topic you should be able to: 1. Discuss importance of the normalisation in the database design. 2. Discuss the problems related to data

### 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

### Conceptual Design Using the Entity-Relationship (ER) Model

Conceptual Design Using the Entity-Relationship (ER) Model Module 5, Lectures 1 and 2 Database Management Systems, R. Ramakrishnan 1 Overview of Database Design Conceptual design: (ER Model is used at

### 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?

### 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

### 14 Databases. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

14 Databases 14.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Define a database and a database management system (DBMS)

Database design 1 The Database Design Process: Before you build the tables and other objects that will make up your system, it is important to take time to design it. A good design is the keystone to creating

### 3. Database Design. 3.1. Functional Dependency. 3.1.01. Introduction. 3.1.02. Value in design. 3.1.03. Initial state. 3.1.05. Aims

of 18 05/03/2007 07:37 3. Database Design This is the Database Design course theme. [Complete set of notes PDF 295Kb]. 3.1. Functional Dependency In this lecture we look at... [Section notes PDF 64Kb]

### DBMS. Normalization. Module Title?

Normalization Database Normalization Database normalization is the process of removing redundant data from your tables in to improve storage efficiency, data integrity (accuracy and consistency), and scalability