Database Systems. Basics of the Relational Data Model

Size: px
Start display at page:

Download "Database Systems. Basics of the Relational Data Model"

Transcription

1 Database Systems Relational Design Theory Jens Otten University of Oslo Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 1 / 30 Basics of the Relational Data Model title year length genre Star Wars SciFi Gone With the Wind drama Wayne s World comedy relation: a two-dimensional table representing data attributes: first line describing the meaning of entries tuples: rows of a relation (other than header row) containing the attribute names; one component for each attribute schema: name of a relation together with a set of attributes; e.g. Movies(title,year,length,genre), in general: R(A,B,C) domains: determine the set of values the components of a tuple can belong to; each attribute has an associated domain key: set of attributes such that no two tuples have the same value in all the attributes of the key relational database (DB): consists of one or more relations Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 2 / 30

2 Relational Algebra Query language SQL incorporates relational algebra at its core. set operations: union, intersection, difference \ projection: π A1,...,A n (Relation-Name) results in a relation hat has only the attributes A 1,..., A n selection: σ C (Relation-Name) with condition C results in a relation that has only those tuples satisfying C cartesian product (R S): pair tuples to form a new relation natural join (R S): pair only those tuples that agree on the common attributes of R and S theta-join (R C S): product considers only tuples satisfying C Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 3 / 30 Design Theory for Relational DBs Goal: designing good relations without flaws identify dependencies between entries in a relation define functional dependency: generalization of idea of a key anomalies: problems that occur because of dependencies use notion of functional dependencies to define normal forms (that do not have these anomalies) normalization: decompose relations into two or more relations (in order to remove anomalies) Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 4 / 30

3 Functional Dependencies Definition (Functional Dependency (FD)). Let A 1,..., A n, B 1,..., B m be attributes (n, m 1) of a relation R. Then A 1,..., A n functionally determine B 1,..., B m, written A 1 A 2...A n B 1 B 2...B m iff the following condition holds: if two tuples of R have the same values on all attributes A 1,..., A n, then they also have the same values on all attributes B 1,..., B m. t A 1... A n B 1... B m u if t and u agree here then they must agree here resembles regular functions f : x 1 = x 2 f (x 1 ) = f (x 2 ) relation R satisfies a FD, if FD is true for every instance of R A 1 A 2...A n B 1 B 2...B m is equivalent to A 1 A 2...A n B 1, A 1 A 2...A n B 2,..., A 1 A 2...A n B m Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 5 / 30 Example: Functional Dependencies Relation: Movies1(title,year,length,genre,studioName,starName) title year length genre studioname starname Star Wars SciFi Fox Carrie Fisher Star Wars SciFi Fox Harrison Ford Gone With the Wind drama MGM Vivien Leigh Wayne s World comedy Paramount Dana Carvey Wayne s World comedy Paramount Mike Meyers the following is a FD: title year length genre studioname (assumption: no two movies in the same year with same title) the following is not a FD: title year starname (there might be more than one star in a movie) Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 6 / 30

4 Keys of Relations Goal: Use key as an identifier for an entry in a relation R. Definition (Key). A set of attributes A = {A 1, A 2,..., A n } is a key for a relation R iff: 1. A functionally determines all other attributes B i of R, i.e. A 1 A 2...A n B i for all other attributes B i of R (two distinct tuples do not agree on all A 1...A n ). 2. No proper subset of A functionally determines all other attributes of R, i.e. a key must be minimal. sometimes a key is also called a candidate key there might be more than one key (in this case it is common to designate one of the keys as primary key) Example: {title,year,starname} is a key for Movies1; but {title,year}, {year,starname}, and {title,starname} are not keys for Movies1 Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 7 / 30 Superkey Definition (Superkey). A set of attributes A = {A 1, A 2,..., A n } is a superkey iff it is a superset of a key A, i.e. A A for some key A. every key is a superkey, but not vice versa, as a superkey satisfies the first condition, but not necessary the second: minimality Example: Any superset of attributes of {title,year,starname} is a superkey, e.g. {title,year,starname,length,studioname} is a superkey. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 8 / 30

5 Rules about Functional Dependencies how to reason about FDs, e.g. assume that a relation satisfies a set of FDs, can we deduce other FDs the relation must satisfy? discovering additional FDs is essential when designing good schemas Example: Relation R(A, B, C) satisfies A B and B C. Then we can deduce that R also satisfies A C. Proof: Given tuples (a, b 1, c 1 ) and (a, b 2, c 2 ) that agree on attribute A. They also agree on B, i.e. b 1 = b 2, hence, they also agree on C, i.e. c 1 = c 2. Definition (S Follows From T ). A set of FDs S follows from a set of FDs T, if every relation instance that satisfies all FDs in T also satisfies all FDs in S. in general: s follows from t, t(x) s(x), if every element x that has property t also has property s Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 9 / 30 Equivalence, Splitting, Combining Definition (Equivalence of FDs). Two sets of FDs S and T are equivalent iff the sets of relation instances satisfying S and T are exactly the same, i.e. S follows from T and T follows from S. Theorem (Splitting/Combining Rule). The FD A 1 A 2...A n B 1 B 2...B m is equivalent to the set of FDs A 1 A 2...A n B i for i = 1,.., m. we can replace the FD A 1...A n B 1...B m by the set of FDs A 1...A n B i for 1 i m ( splitting ), and vice versa ( combining ) Example: title year length, title year genre, and title year studioname is equivalent to title year length genre studioname. But splitting title year -> length into title -> length and year -> length is not allowed. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

6 Trivial FDs Definition (Trivial FD). A FD A 1 A 2...A n B 1 B 2...B m is trivial iff {B 1,...B m } {A 1,...A n }. Example: title year title is trivial. Theorem (Trivial-Dependency Rule). Let a A 1 A 2...A n B 1 B 2...B m C 1 C 2...C k be a FD with {B 1, B 2,...B m } {A 1, A 2,..., A n } and {A 1, A 2,...A n } {C 1, C 2,..., C k } = {}. Then, this FD is equivalent to the non-trivial FD A 1 A 2...A n C 1 C 2...C k. we can replace FDs by appropriate non-trivial FDs Example: Replace title year title length by title year length. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 Closure of Attributes The closure of attributes is an important property when dealing with keys. Definition (Closure of Attributes). Given a set of attributes A = {A 1, A 2,..., A n } and a set S of FDs. The closure of A is the set B of all attributes, such that A 1 A 2...A n B follows from the set S. The closure of {A 1, A 2,..., A n } is denoted by {A 1, A 2,..., A n } +. it is {A 1, A 2,..., A n } {A 1, A 2,..., A n } + as A 1 A 2...A n A i for i = 1,..., n Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

7 Algorithm to Compute Closure of Attributes Idea: Start with given set of attributes and repeatedly expand it by adding right sides of FDs when all their left attributes are included. INPUT: Set of attributes A = {A 1, A 2,..., A n } and set S of FDs (such that all FDs contain only one attribute on the right side) OUTPUT: {A 1, A 2,..., A n } + 1. Set X = {A 1, A 2,..., A n }. 2. Select FD B 1...B m C from S with {B 1,..., B m } X and C X. 3. Add C to set X and go to step If there is no such FD, then X is the set {A 1, A 2,..., A n } +. Example: Relation with FDs AB C, BC A, BC D, D E, CF B. What is the closure {A, B} + of {A, B}? a. X = {A, B}, b. X = {A, B, C} (because of AB C), c. X = {A, B, C, D} (because of BC D), d. X = {A, B, C, D, E} (because of D E). Thus, {A, B} + = {A, B, C, D, E}. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 Consequences of FDs By computing the closure of any set of attributes, we can test whether any given FD A 1 A 2...A n B follows from a set of FDs S. Theorem (Consequences of FDs). A FD A 1 A 2...A n B follows from a set S of FDs iff B {A 1, A 2,..., A n } +. An FD A 1 A 2...A n B 1...B m follows from a set S of FDs iff {B 1,..., B m } {A 1 A 2...A n } +. Proof: We need to prove that the algorithm neither computes too few nor too many FDs; it computes exactly those FDs that follow from S (induction on the number of times we extend the set X ). Example (continued from previous slide): 1. Does AB D follow from the given FDs? Yes, since {A, B} + = {A, B, C, D, E} includes D. 2. Does AB F follow from the given FDs? No, since {A, B} + = {A, B, C, D, E} does not include F. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

8 Transitivity Theorem (Transitivity Rule). If A 1...A n B 1...B m and B 1...B m C 1...C k hold in relation R, then A 1...A n C 1...C k holds in R as well. Proof: Compute closure of {A 1,..., A n }. Then B 1...B m are in {A 1,..., A n } + (1st FD); then C 1...C k are in {A 1,..., A n } + (2nd FD). Example: title year length genre studioname studioaddr Star Wars SciFi Fox Hollywood Eight Below drama Disney Buena Vista Wayne s World comedy Paramount Hollywood It is title year studioname and studioname studioaddr. Hence title year studioaddr holds as well. Fact: {A 1, A 2,..., A n } + is the set of all attributes of a relation if and only if {A 1, A 2,..., A n } is a superkey for the relation. Test if A={A 1,..., A n } is a key for relation R by checking that A + is set of all attributes and there is no real subset X of A such that X + is set of all attributes. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 A Complete Set of Inference Rules If we want to know whether one FD follows from some given set of FDs, the closure algorithm can be used. An alternative way is through Armstrong s Axioms from which any FD that follows from a given set of FDs can be derived. Definition (Armstrong s Axioms). 1. Reflexivity (trival FDs): If {B 1,..., B m } {A 1 A 2...A n } then A 1 A 2...A n B 1...B m. 2. Augmentation: If A 1 A 2...A n B 1 B 2...B m then A 1 A 2...A n C 1...C k B 1 B 2...B m C 1...C k for any set of attributes {C 1,..., C k }. 3. Transitivity: If A 1 A 2...A n B 1...B m and B 1...B m C 1...C k then A 1 A 2...A n C 1...C k. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

9 Anomalies in Relation Schemas Goal: Avoid redundancy and anomalies in database schemas. Anomalies in relation schemas: 1. Redundancy: Information may be repeated in several tuples (e.g. length or genre) 2. Update Anomalies: Changing information in one tuple but not in another one (e.g. changing length of Star Wars) 3. Deletion Anomalies: If a value of a tuple becomes empty, we may loose other information as a side effect (e.g. delete Vivien Leigh from Gone With the Wind) Example: Relation Movies1 title year length genre studioname starname Star Wars SciFi Fox Carrie Fisher Star Wars SciFi Fox Harrison Ford Gone With the Wind drama MGM Vivien Leigh Wayne s World comedy Paramount Dana Carvey Wayne s World comedy Paramount Mike Meyers Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 Decomposing Relations Decomposition: breaking a relation schema (set of attributes) into smaller schemas in order to eliminate anomalies. Definition (Decomposing Relations). Given a relation R(A 1,..., A n ), we may decompose R into two relations S(B 1,..., B m ) und T (C 1,..., C k ) such that: 1. {A 1,..., A n } = {B 1,..., B m } {C 1,..., C k } 2. S = π B1,...,B m (R) 3. T = π C1,...,C k (R) Example: Decompose relation Movies1 into 1. a relation called Movies2, whose schema consists of all the attributes except starname, and 2. a relation called Movies3, whose schema consists of the attributes title, year, and starname. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

10 Decomposing Relations Example: The relation Movies2 and Movies3. title year length genre studioname Star Wars SciFi Fox Gone With the Wind drama MGM Wayne s World comedy Paramount title year starname Star Wars 1977 Carrie Fisher Star Wars 1977 Harrison Ford Gone With the Wind 1939 Vivien Leigh Wayne s World 1992 Dana Carvey Wayne s World 1992 Mike Meyers this decomposition eliminates the anomalies mentioned before, i.e. length and genre appear only once, the risk of an update anomaly (e.g. if we change length) and a deletion anomaly (e.g. if we delete the only star from Gone With the Wind) is gone Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 Boyce-Codd Normal Form Condition under which anomalies can be guaranteed not to exist. Definition (Boyce-Codd Normal Form (BCNF)). A relation R is in Boyce-Codd Normal Form (BCNF) iff the following condition holds: whenever there is a non-trivial FD A 1...A n B 1...B m for R, then {A 1,..., A n } is a superkey of R. Example: In Movies1 {title,year,starname} is the only key. Now, consider the FD title year length genre studioname for Movies1. {title,year} is not a superkey (as title and year do not determine starname); hence, Movies1 is not in BCNF. In Movies2 the only key is {title,year} and every non-trivial FD, e.g. title year length genre studioname, has at least title and year on its left side, hence, their left sides must be superkeys. Thus, Movies2 is in BCNF. Fact: Any two-attribute relation is in BCNF. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

11 Decomposition into BCNF We can break any relation schema into a collection of subsets of its attributes, such that 1. these subsets are schemas of relations in BCNF; 2. the data in the relations resulting of the decomposition faithfully represent the data in the original relation. Idea: 1. Identify non-trivial FD A 1 A 2...A n B 1...B m that violates BCNF, i.e. {A 1, A 2,..., A n } is not a superkey. 2. Break attributes into two overlapping relation schemas a. {A 1, A 2,..., A n, B 1,..., B m } and b. {A 1, A 2,..., A n, C 1,..., C k } where {C 1,..., C k } are all attributes not involved in the FD. Example: In Movies1 the following FD violates the BCNF condition title year length genre studioname; we decompose into 1. the schema {title,year,length,genre,studioname} and 2. the schema {title,year,starname}. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 The BCNF Decomposition Algorithm INPUT: A relation R 0 with a set of FDs S 0 OUPUT: A decomposition of R 0 into a collection of relations that are all in BCNF Apply the following steps recursively. Initially set R = R 0, S = S If R is in BCNF, then return {R}; otherwise Let X Y be a FD that violates the BCNF condition. Compute X +. Choose R 1 = X + as one relation schema and let R 2 = X {C i C i is attribute of R with C i X + } be the other. 3. Compute S 1 and S 2, the sets of FDs for R 1 and R Recursively decompose R 1 and R 2 and return the union of the results of these decompositions. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

12 Consequences of Decomposing decomposing a relation schema in to BCNF will avoid anomalies but decomposing can also have some negative consequences Requirements for decompositions: 1. Elimination of anomalies (as mentioned before) 2. Recoverability of information (can we recover the original relation?) 3. Preservation of dependencies (when reconstructing the original relation the result will satisfy the original FDs) The presented decomposition algorithm will guarantee 1. and 2., but not necessarily 3. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 Recovering Information from a Decomposition Definition (Lossless Join). A decomposition has a lossless join iff the original relation R can be reconstructed from the relations of the decomposition. Example: R(A, B, C) with FD B C that is a BCNF violation. The decomposition separates the attributes into the relations R 1 (A, B) and R 2 (B, C). Let t=(a, b, c) be a tuple of R. Then (a, b) is in R 1 (A, B) and (b, c) is in R 2 (B, C). When computing the natural join R 1 R 2, the result, again, contains the tuple t=(a, b, c). Now, consider the tuples t=(a, b, c) and v(d, b, e) of R. Then (a, b) is in R 1 (A, B) and (b, e) is in R 2 (B, C). In the natural join this leads to the tuple (a, b, e). Could this not be a tuple of R? Answer: no, as we assumed B C, i.e. if two tuples agree on B, they also agree on C, hence, c=e and (a, b, e) is indeed (a, b, c), which is in R. Fact 1: If we decompose a relation according to the algorithm, then the original relation can be recovered exactly by natural join. Fact 2: The natural join is associative and commutative. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

13 The Chase Test for Lossless Join Lossless join does not work for arbitrary decompositions. Question: Given a general decomposition of R into the relations with sets of attributes S 1,..., S k. Can we recover R by taking the natural join of all these relations, i.e. is it true that π S1 (R)... π Sk (R) = R? We need to show: 1. Any tuple t in R is in π S1 (R)... π Sk (R). 2. Any tuple t in π S1 (R)... π Sk (R) is in R. Answer: 1. Clear, as the projection of t onto S i is in π Si (R) for each i and therefore t is in the resulting relation of the join. 2. Use chase test and consider FDs that hold for R. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 The Chase Test Example: Suppose we have a relation R(A, B, C, D), which we have decomposed into relations with sets of attributes S 1 ={A, D}, S 2 ={A, C}, and S 3 ={B, C, D}. Then, the so-called tableau for this decomposition is A B C D a b 1 c 1 d a b 2 c d 2 a 3 b c d first row corresponds to set of attributes A and D; we use unsubscripted letters a and d, and add for the other attributes b and c the subscript 1 in order to indicate arbitrary values the tuple (a, b 1, c 1, d) represents a tuple that contributes to (a, b, c, d) but we know nothing about the values for the attributes b and c; similar procedure for the other rows we chase the tableau by applying the FDs to equate symbols in the tableau whenever we can; if one of the rows becomes the same as t (all symbols are unsubscripted), then we have proved that any tuple t in the join of projections was actually a tuple of R Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

14 The Chase Test Example: A B C D a b 1 c 1 d a b 2 c d 2 a 3 b c d A B C D a b 1 c 1 d a b 1 c d 2 a 3 b c d Suppose the given FDs are A B, B C and CD A. first two rows agree on A, hence, they must also agree on B first two rows agree on A, hence, they must also agree on C A B C D a b 1 c d a b 1 c d 2 a 3 b c d A B C D a b 1 c d a b 1 c d 2 a b c d first and third row agree on C and D, hence they must agree on A then, the last row is equal to t=(a, b, c, d) hence, if R satisfies the given FDs and we project R onto {A, D}, {A, C}, and {B, C, D} and rejoin, then we only get tuples that have been in R Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 Why the Chase Works? Questions: 1. When the chase results in a row that matches t, why must the join be lossless? 2. When, after applying FDs, there is no row of all unsubscripted variables, why must the join not be lossless? Proof: 1. The process itself provides the answer. 2. Think of the tableau as an instance of the relation R. It satisfies the given FDs, because none can be applied any more. When we project the relation onto the S i s and take the natural join we get a tuple with unsubscripted variables, which is not in R. Hence, the join is not lossless. Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

15 Example: Why the Chase Works? Consider R(A, B, C, D) with the FD B AD and the proposed decomposition {A, B}, {B, C}, and {C, D}. A B C D a b c 1 d 1 a 2 b c d 2 a 3 b 3 c d applying B AD, we deduce the final tableau A B C D a b c 1 d 1 a b c d 1 a 3 b 3 c d hence, this decomposition does not have a lossless join; the resulting natural join has two more tuples (a, b, c, d) and (a 3, b 3, c, d 1 ) not in R Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30 Summary functional dependencies (FDs) useful for defining appropriate keys several rules about FDs, e.g. transitivity, closure of attributes anomalies: redundancy, update anomalies, deletion anomalies eliminate anomalies by decomposing into smaller relation schemas the resulting relations should represent exactly the data in the original relation (after joining them) for relations that are decomposed into the Boyce-Codd Normal Form (BCNF) a lossless join is always possible use chase test (for arbitrary decompositions) to find out if a lossless join is possible Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring / 30

Concepts from

Concepts from 1 Concepts from 3.1-3.2 Functional dependencies Keys & superkeys of a relation Reasoning about FDs Closure of a set of attributes Closure of a set of FDs Minimal basis for a set of FDs 2 Plan How can we

More information

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

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

More information

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

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

More information

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

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

More information

Part II: Using FD Theory to do Database Design

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

More information

Desired properties of decompositions

Desired properties of decompositions Desired properties of decompositions We expect that after decomposition No anomalies and redundancies We can recover the original relation from the tuples in its decompositions We can ensure that after

More information

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

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

More information

High-Level Database Models. Spring 2011 Instructor: Hassan Khosravi

High-Level Database Models. Spring 2011 Instructor: Hassan Khosravi High-Level Database Models Spring 2011 Instructor: Hassan Khosravi Database Modeling and implemnation process Ideas High-Level Design Relational Database Schema Relational DBMS 4.2 The Entity/Relationship

More information

Relational Model and Relational Algebra A Short Review Class Notes - CS582-01

Relational Model and Relational Algebra A Short Review Class Notes - CS582-01 Relational Model and Relational Algebra A Short Review Class Notes - CS582-01 Tran Cao Son January 12, 2002 0.1 Basics The following definitions are from the book [1] Relational Model. Relations are tables

More information

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

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

More information

Introduction to Databases, Fall 2003 IT University of Copenhagen. Lecture 4: Normalization. September 16, Lecturer: Rasmus Pagh

Introduction to Databases, Fall 2003 IT University of Copenhagen. Lecture 4: Normalization. September 16, Lecturer: Rasmus Pagh Introduction to Databases, Fall 2003 IT University of Copenhagen Lecture 4: Normalization September 16, 2003 Lecturer: Rasmus Pagh Today s lecture What you should remember from previously. Anomalies in

More information

Theory of Normal Forms Decomposition of Relations. Overview

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

More information

UNIT 3 DATABASE DESIGN

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

More information

Relational Algebra. Spring 2012 Instructor: Hassan Khosravi

Relational Algebra. Spring 2012 Instructor: Hassan Khosravi Relational Algebra Spring 2012 Instructor: Hassan Khosravi Querying relational databases Lecture given by Dr. Widom on querying Relational Models 2.2 2.1 An Overview of Data Models 2.1.1 What is a Data

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

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

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

More information

Design Theory for Relational Databases

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

More information

CSE 562 Database Systems

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

More information

Case Study: Lufthansa Cargo Database

Case Study: Lufthansa Cargo Database Case Study: Lufthansa Cargo Database Carsten Schürmann 1 Today s lecture More on data modelling Introduction to Lufthansa Cargo Database Entity Relationship diagram Boyce-Codd normal form 2 From Lecture

More information

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

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

More information

Introduction to Database Design, fall 2011 IT University of Copenhagen. Normalization. Rasmus Pagh

Introduction to Database Design, fall 2011 IT University of Copenhagen. Normalization. Rasmus Pagh Introduction to Database Design, fall 2011 IT University of Copenhagen Normalization Rasmus Pagh Based on KBL sections 6.1-6.8 (except p. 203 207m), 6.9 (until Multivalued dependencies ), 6.11, and 6.12.

More information

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

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

More information

Functional dependency theory

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

More information

Lecture 6a Design Theory and Normalization 2/2

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

More information

Informal Design Guidelines for Relational Databases

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

More information

Schema Refinement: Dependencies and Normal Forms

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

More information

Relational Design: Characteristics of Well-designed DB

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

More information

Functional Dependencies CS 1270

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

More information

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

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

More information

FUNCTIONAL DEPENDENCIES

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

More information

Databases The theory of relational database design Lectures for m

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

More information

The Relational Data Model

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

More information

Chapter 8: Relational Database Design

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

More information

CSCI 403: Databases 13 - Functional Dependencies and Normalization

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

More information

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

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

More information

Database Design Principles

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

More information

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

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

More information

Schema Refinement: Dependencies and Normal Forms

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

More information

Schema Refinement and Normal Forms

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

More information

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

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

More information

Database Design Theory and Normalization. CS 377: Database Systems

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

More information

Databases - Relations in Databases. (N Spadaccini 2010) Relations in Databases 1 / 16

Databases - Relations in Databases. (N Spadaccini 2010) Relations in Databases 1 / 16 Databases - Relations in Databases (N Spadaccini 2010) Relations in Databases 1 / 16 Re-capping - data model A data model is a precise, conceptual description of the data stored in a database. The relational

More information

Relational Model, Relational Algebra, and SQL

Relational Model, Relational Algebra, and SQL Relational Model, Relational Algebra, and SQL August 29, 2007 1 Relational Model Data model. constraints. Set of conceptual tools for describing of data, data semantics, data relationships, and data integrity

More information

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

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

More information

Functional Dependencies

Functional Dependencies Functional Dependencies Meaning of FD s Keys and Superkeys Inferring FD s 1 Motivation Consider the relation: Students(Id, Name, AdvisorId, AdvisorName, FavouriteAdvisorId) 2 1 Motivation (2) If you know

More information

Unit 3 : Relational Database Design

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

More information

Normalisation. Normalisation. Normalisation

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

More information

Relational Database design. Slides By: Shree Jaswal

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

More information

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

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

More information

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

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

More information

MODULE: 3 FUNCTIONAL DEPENDENCIES

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

More information

CSIT5300: Advanced Database Systems

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

More information

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

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

More information

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

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

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

More information

18. Relational Database Design

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

More information

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS INTRODUCTION TO RELATIONAL DATABASE SYSTEMS DATENBANKSYSTEME 1 (INF 3131) Torsten Grust Universität Tübingen Winter 2015/16 1 LEGO BUILDING INSTRUCTIONS Each LEGO set comes with building instructions,

More information

Schema Refinement: Dependencies and Normal Forms

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

More information

COSC Dr. Ramon Lawrence. Emp Relation

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

More information

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

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

More information

Relational Database Design (II)

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

More information

Database Management Systems Paper Solution

Database Management Systems Paper Solution Database Management Systems Paper Solution Following questions have been asked in GATE CS exam. 1. Given the relations employee (name, salary, deptno) and department (deptno, deptname, address) Which of

More information

Functional Dependencies & Normalization for Relational DBs. Truong Tuan Anh CSE-HCMUT

Functional Dependencies & Normalization for Relational DBs. Truong Tuan Anh CSE-HCMUT Functional Dependencies & Normalization for Relational DBs Truong Tuan Anh CSE-HCMUT 1 2 Contents 1 Introduction 2 Functional dependencies (FDs) 3 Normalization 4 Relational database schema design algorithms

More information

Final Review. Zaki Malik November 20, 2008

Final Review. Zaki Malik November 20, 2008 Final Review Zaki Malik November 20, 2008 Basic Operators Covered Renaming If two relations have the same attribute, disambiguate the attributes by prefixing the attribute with the name of the relation

More information

5 Normalization:Quality of relational designs

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

More information

Lecture 11 - Chapter 8 Relational Database Design Part 1

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

More information

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

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

More information

SCHEMA REFINEMENT AND NORMAL FORMS

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

More information

Lecture 5 Design Theory and Normalization

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

More information

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

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

More information

Functional Dependency: Design and Implementation of a Minimal Cover Algorithm

Functional Dependency: Design and Implementation of a Minimal Cover Algorithm IOSR Journal of Computer Engineering (IOSR-JCE) e-issn: 2278-0661,p-ISSN: 2278-8727, Volume 19, Issue 5, Ver. I (Sep.- Oct. 2017), PP 77-81 www.iosrjournals.org Functional Dependency: Design and Implementation

More information

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

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

More information

CS352 Lecture - Conceptual Relational Database Design

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

More information

Relational Database: The Relational Data Model; Operations on Database Relations

Relational Database: The Relational Data Model; Operations on Database Relations Relational Database: The Relational Data Model; Operations on Database Relations Greg Plaxton Theory in Programming Practice, Spring 2005 Department of Computer Science University of Texas at Austin Overview

More information

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

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

More information

Information Systems Engineering. SQL Structured Query Language DML Data Manipulation (sub)language

Information Systems Engineering. SQL Structured Query Language DML Data Manipulation (sub)language Information Systems Engineering SQL Structured Query Language DML Data Manipulation (sub)language 1 DML SQL subset for data manipulation (DML) includes four main operations SELECT - used for querying a

More information

Review: Attribute closure

Review: Attribute closure CS445 - Introduction to Database Management Systems Fall Semester 2015 LECTURE 10 Functional Dependencies, Normalization Part II TEXTBOOK REFERENCE: CHAPTER 19 CS445 DATABASES: LECTURE 10 1 Review: Attribute

More information

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

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

More information

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

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

More information

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

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

More information

Functional Dependencies

Functional Dependencies Functional Dependencies Redundancy in Database Design A table Students-take-courses (stud-id, name, address, phone, crs-id, instructor-name, office) Students(stud-id, name, address, phone, ) Instructors(name,

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

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

More information

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

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

More information

Babu Banarasi Das National Institute of Technology and Management

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

More information

CS352 Lecture - Conceptual Relational Database Design

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

More information

Schema Refinement & Normalization Theory 2. Week 15

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

More information

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

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

More information

Database Management System

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

More information

Relational Design Theory

Relational Design Theory Chapter 5 Relational Design Theory Database Systems p. 211/569 Relational Design Theory A badly designed schema can cause a lot of trouble Database designers talk of anomalies and distinguish three different

More information

Programming and Database Fundamentals for Data Scientists

Programming and Database Fundamentals for Data Scientists Programming and Database Fundamentals for Data Scientists Database Fundamentals Varun Chandola School of Engineering and Applied Sciences State University of New York at Buffalo Buffalo, NY, USA chandola@buffalo.edu

More information

Schema Design for Uncertain Databases

Schema Design for Uncertain Databases Schema Design for Uncertain Databases Anish Das Sarma, Jeffrey Ullman, Jennifer Widom {anish,ullman,widom}@cs.stanford.edu Stanford University Abstract. We address schema design in uncertain databases.

More information

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

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

More information

5.2 E xtended Operators of R elational Algebra

5.2 E xtended Operators of R elational Algebra 5.2. EXTENDED OPERATORS OF RELATIONAL ALG EBRA 213 i)

More information

Chapter 6: Relational Database Design

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

More information

Fundamentals of Database Systems

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

More information

Ryan Marcotte CS 475 (Advanced Topics in Databases) March 14, 2011

Ryan Marcotte  CS 475 (Advanced Topics in Databases) March 14, 2011 Ryan Marcotte www.cs.uregina.ca/~marcottr CS 475 (Advanced Topics in Databases) March 14, 2011 Outline Introduction to XNF and motivation for its creation Analysis of XNF s link to BCNF Algorithm for converting

More information

Relational Database Systems 1

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

More information

Functional Dependencies and Normalization

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

More information

UNIT -III. Two Marks. The main goal of normalization is to reduce redundant data. Normalization is based on functional dependencies.

UNIT -III. Two Marks. The main goal of normalization is to reduce redundant data. Normalization is based on functional dependencies. UNIT -III Relational Database Design: Features of Good Relational Designs- Atomic Domains and First Normal Form- Second Normal Form-Decomposition Using Functional Dependencies- Functional-Dependency Theory-Algorithms

More information

Database Management System 15

Database Management System 15 Database Management System 15 Trivial and Non-Trivial Canonical /Minimal School of Computer Engineering, KIIT University 15.1 First characterize fully the data requirements of the prospective database

More information