Functional Dependencies

Size: px
Start display at page:

Download "Functional Dependencies"

Transcription

1 Cleveland State University CIS 611 Relational Databases Prepared by Victor Matos Functional Dependencies Source: The Theory of Relational Databases D. Maier, Ed. Computer Science Press Available at: 1

2 Functional Dependencies Two primary purposes of databases are to attenuate data redundancy and enhance data reliability. Any a priori knowledge of restrictions or constraints on permissible sets of data has considerable usefulness in reaching these goals. Data dependencies are one way to formulate such advance knowledge. 2

3 Example1 Consider the relation assign (Pilot, Flight, Date, Departs) PILOT FLIGHT DATE DEPARTS Cushing Cushing Clark Clark Clark Chin Chin Copely Copely Copely Aug IO Aug 8 Aug 12 Aug 11 Aug 13 Aug 12 Aug 9 Aug 13 Aug 15 Aug 10: 15a 1:25p 5:50a 6:35p 10: 15a 10: 15a 1:25p 5:50a 5:50a 1:25p 3

4 Example1 - Observations The relation assign tells which pilot flies a given flight on a given day, and what time the flight leaves. Not every combination of pilots, flights, dates, and times is allowable in assign. The following restrictions apply, among others: 1. For each flight there is exactly one time. 2. For any given pilot, date, and time, there is only one flight. 3. For a given flight and date, there is only one pilot. These restrictions are examples of functional dependencies. Informally, a functional dependency occurs when the values of a tuple on one set of attributes uniquely determine the values on another set of attributes. Our restrictions can be phrased as 1. TIME functionally depends on FLIGHT, 2. FLIGHT functionally depends on {PILOT, DATE, TIME}, and 3. PILOT functionally depends on {FLIGHT, DATE}. 4

5 FD Definition Def. Let r be a relation on scheme R, with X and Y subsets of R. Relation r satisfies the functional dependency (FD) X Y if for every X-value x, y( X=x (r)) has at most one tuple. One way to interpret this expression is to look at pairs of tuples, t1 and t2, in r. If t1(x) = t2(x), then t1(y) = t2(y). In the FD X Y the portion X is called the left side and Y is called the right side. 5

6 Algorithm 4.1 SATISFIES FD Satisfies Input: A relation r and an FD X Y. Output: true if T satisfies X Y, false otherwise. SATISFIES(r, X Y); 1. Sort the relation r on its X columns to bring tuples with equal X-values together. 2. If each set of tuples with equal X-values has equal Y- values, return true. Otherwise, return false. SATISFIES tests if a relation r satisfies an FD X Y. 6

7 Algorithm: Satisfies Using algorithm satisfies to test if FLIGHT DEPARTS PILOT FLIGHT DATE DEPART Cushing 83 9-Aug 10: 15a Clark Aug 10: 15a Chin Aug 10: 15a Cushing 116 IO Aug 1:25p Chin Aug 1:25p Clark Aug 5:50a Copely Aug 5:50a Copely Aug 5:50a Clark Aug 6:35p Copely Aug 1:25p Question: DEPARTS FLIGHT??? 7

8 Inference Axioms The number of FDs that can apply to a relation r(r) is finite, since there is only a finite number of subsets of R. Thus it is always possible to find all the FDs that r satisfies, by trying all possibilities using the algorithm SATISFIES. This brute-force approach is time-consuming. 8

9 Inference Axioms Finding F requires semantic knowledge of the relation r. After knowing some members of F, it is often possible to infer other members of F. A set F of FDs implies the FD X Y, written F X Y, if every relation that satisfies all the FDs in F also satisfies X Y. An inference axiom is a rule that states if a relation satisfies certain FDs, it must satisfy certain other FDs. 9

10 Inference Axioms F = {... } Set of functional dependencies X Y Set of all relations r(r) satisfying FDs in F A set F of FDs implies the FD X Y, written F X Y, if every relation that satisfies all the FDs in F also satisfies X Y. 10

11 Example - Inference Axioms F = { A B, B C } Set of functional dependencies A C Set of all relations r(r) satisfying FDs in F A set F of FDs implies the FD X Y, written F X Y, if every relation that satisfies all the FDs in F also satisfies X Y. 11

12 Inference Axioms The Armstrong-Set of Inference Axioms Axioms will implement the intelligence needed to prove (or disprove) a sequence of derivations. Inference Machines are used to determine whether or not the application of the axioms on some basic knowledge produces a new valid piece of knowledge not there in the basic set. The first set we will consider is called the A-set proposed by W. Armstrong 1. 1 William Armstrong: Dependency Structures of Data Base Relationships, page IFIP Congress,

13 A1. Reflexivity X X A-Axioms A2. Augmentation If (Z W; X Y) then XW YZ A3. Additivity If { (X Y) and (X Z)} then X YZ A4. Projectivity If (X YZ) then X Y A5. Transitivity If (X Y) and (Y Z) then (X Z) A6. Pseudotransitivity If (X Y) and (YZ W) then XZ W 13

14 Inference Machine INPUT: Relation schema R Set F of FDs on R YES A-Axioms A1 A2... A6 INFERENCE MACHINE Output Is the new rule X Y derived from what is known (R, F) by using the intelligence provided by the A-Axioms? NO INPUT: A new rule of the form X Y With X and Y in schema(r) If NO we must conclude that (F X Y) is not true 14

15 Example1 - Using the A-Axioms Consider R = (Street, Zip, City) ; and the dependencies F = { City Street Zip, Zip City } We want to show: Street Zip Street Zip City Proof: 15

16 Example1 - Using the A-Axioms Consider R = (Street, Zip, City) ; and the dependencies F = { City Street Zip, Zip City } We want to show: Street Zip Street Zip City Proof: 1. Zip City Given 2. Street Zip Street City Augmentation of (1) by Street 3. City Street Zip Given 4. City Street City Street Zip Augmentation of (3) by City Street 5. Street Zip City Street Zip Transitivity of (2) and (4) 16

17 Example2 Using A-Axioms Consider the relation schema <R,F> where R = (ABCDEGHI) and dependencies F = { AB E AG J BE I E G GI H } Show that AB GH is derived by F. If YES give a proof If NO provide a counter-example 17

18 Example2A Using A-Axioms Consider the relation schema <R,F> where R = (ABCDEGHI) and dependencies F = { AB E AG J BE I E G GI H } Show that AB GH is derived by F. Step Statement Explanation 1 AB E Given 2 E G Given 3 AB G Transitivity on (1) and (2) 4 AB BE Augmentation (1) by B 5 BE I Given 6 AB I Transitivity on (4) and (5) 7 AB GI Additivity on (6) and (3) 8 GI H Given 9 AB H Transitivity on (7) and (8) Q.E.D. 10 AB GH Additivity on (3) and (11) quod erat demonstrandum 18

19 Example2B Using A-Axioms Consider the relation schema <R,F> where R = (ABCDEGHI) and dependencies F = { AB E AG J BE I E G GI H } Show that AB GH is derived by F. again! Step Statement Explanation 1 AB E Given 2 AB AB Reflexivity 3 AB B Projectivity on (2) 4 AB BE Additivity on (1) and (3) 5 BE I Given quod erat demonstrandum Q.E.D. 6 AB I Transitivity on (4) and (5) 7 E G Given 8 AB G Transitivity on (1) and (7) 9 AB GI Additivity on (6) and (8) 10 GI H Given 11 AB H Transitivity on (9) and (10) 12 AB GH Additivity on (8) and (11) 19

20 Example3 Using A-Axioms Consider the relation schema <R,F> where R = (ABCDEGHI) and dependencies F = { AB E AG J BE I E G GI H } Show that AEI H is derived by F. Your turn! Step Statement Explanation

21 Reducing the A-Axioms The set of A-Axioms is not minimal, therefore some of its rules could be eliminated. Observations Rule A5 (transitivity) is a special case of rule A6 (pseudo-transitivity). Rules A3 (additivity) and A4 (projectivity) can be derived from A1 (reflexivity), A2 (augmentation), A6 (pseudo-transitivity). Proof (a) First observation is trivial (just make Z= Ø) (b) Axiom A3 (Additivity) states that two rules, say X Y and X Z, can be combined in one X YZ. Lets use A2 on X Y to produce XZ YZ. Repeat A2 this time on X Z to produce X XZ. Now apply A5 on X XZ and XZ YZ; we get X YZ. Therefore, we conclude that X YZ without using the rule A3 itself (see next page) 21

22 Reducing the A-Axioms The set of A-Axioms is not minimal, therefore some of its rules could be eliminated. Statement Axiom A3 is redundant. Rule A3 (Additivity) states that two rules, say X and X Z, can be combined in one X YZ. Proof We can prove that this fact is true without using A3 1. X Y Given 2. XZ YZ (A2) Augmenting (1) by Z 3. X Z Given 4. X XZ (A2) Augmenting (3) by Z 5. X YZ (A5) Transitivity on (4) and (2) Y 22

23 Characterizing the A-Axioms The set of A-Axioms is complete Therefore every FD that is implied by a set F of FDs can be derived from the FDs in F and one or more applications of the A-Axioms ( F A X Y ) A-Axioms are correct Applying the axioms to FDs in a set F can only produce FDs that are implied by F. The set of A-axioms is not minimal Some rules are added for convenience but they can be removed without diminishing the expressive power of the A-axioms 23

24 Correctness of the A-Axioms The axioms can not be used to prove a false derivation. In such a case showing a counter-example is sufficient to establish the falsity of a statement. Example Assume schema R(XYZW). Does ( XY ZW ) A X Z? The correct answer is NO. To show support for our argument we produce a counter-example. For instance: X Y Z W On the example table there are no violations to the fact that XY implies a unique ZW (12 34 and 15 67). However X=1 determines two different Z values, 3 and 6. Therefore X Z is not a valid dependency as shown in the counter-example. 24

25 Closure F + Let F be a set of FDs for a relation r(r). The closure of F, denoted F +, is the smallest set containing F such that the A-axioms cannot be applied to the set to produce a new rule not included in the set already Since F + must be finite, we can compute it by starting with F, applying A1, A2, and A6, and adding the derived FDs to F until no new FDs can be derived. The closure of F depends on the scheme R. F + F If R = (A B) then F + will always contain B B, but if R = (A C), F + never contains B B. 25

26 Closure F + The set F derives an FD X Y if X Y is in F +. Since our inference axioms are correct, if F derives X Y, then F implies X Y ( F A X Y ) Note that F + = (F + ) + It is desirable to determine whether F A X Y without computing F + Computing the entire set F + is time-consuming and tedious 26

27 Closure F + Example: Consider the relation schema <R,F> where R = (A B C) and F = { AB C, C B }. By the use of brute-force we produce all rules out of F. F + is the set of rules listed below A A B B C C C B AB AB AC AC BC BC AB C AB A AB B BC C ABC ABC ABC A ABC B ABC C ABC AB ABC BC F + F = { AB C, C B } 27

28 Closure F + Example: Consider the relation schema <R,F> where R = (ABC) and F = { AB C, C B }. Question: Does F B C? Answer: F + is the set of rules listed below and B C is not in the set; therefore the rule B C is not implied by F. A A B B C C C B AB AB AC AC BC BC AB C AB A AB B BC C ABC ABC ABC A ABC B ABC C ABC AB ABC BC This rule is NOT reachable from F F + F = { AB C, C B } B C 28

29 Closure F + Aside: How many FDs are there in <R,F> An upper bound is r n n r n 1 r 1 n r n (2 1) 2 Each sum term represents the possible combinations of r attributes made out of the total n domains for each of the m X Y rule in F. for n=3 there are (2 3-1) 2 = 49 possibilities, however for R holding 10 attributes there are over a million possible FDs 29

30 Closure F + Definition. An FD X Y is trivial if X Y. If F is a set of FDs over R and X is a subset of R, then there is a FD X Y in F + such that Y is maximal: for any other FD X Z in F +, Y Z. This result follows from additivity. The right side Y is called the closure of X and is denoted by X +. The closure of X always contains X, by reflexivity. 30

31 Derivations and DDAGs If F X Y, then either X Y is in F, or a series of applications of the inference A-axioms to F will yield X Y. This sequence of axiom applications and resulting FDs is called a derivation of X Y from F. More formally, let F be a set of FDs over scheme R. A sequence P of FDs over R is a derivation sequence on F if every FD in P either is a member of F, or follows from previous FDs in P by an application of one of the inference axioms A1 to A6. P is a derivation sequence for X Y if X Y is one of the FDs in P. Definition Let P be a derivation sequence on F. The use set of P is the collection of all FDs (originally) in F that appear in P. 31

32 EXAMPLE Derivations and DDAGs Consider schema r(abcdeg) and functional dependencies F = { A BC, BD G, C ED } A derivation sequence for A E is Step Explanation Try 32

33 EXAMPLE Derivations and DDAGs Consider schema r(abcdeg) and functional dependencies F = { A BC, BD G, C ED } A derivation sequence for A Step A A C C A BC C ED E E E is Explanation (given) (Projectivity [A4] on 1) (given) (Projectivity[A4] on 3) (Transitivity[A5] on 2 and 4) The set P for A E (five rules written above) is a derivation sequence on F. The Use_Set_Of_P is = {A BC, C ED } 33

34 Derivations and DDAGs Example. Consider schema <R, F> where R= { A B C D E G H I J } and F = { AB E, AG J, BE I, E G, GI H} The following sequence is a derivation sequence for A B G H. Step 1. AB E 2. AB AB 3. AB B 4. AB BE 5. BE I 6. AB I 7. E G 8. AB G 9. AB GI 10. GI H 11. AB H 12. GI GI 13. G I I 14. AB G H Explanation given) (reflexivity) (projectivity from 2) (additivity from 1 and 3) (given) (transitivity from 4 and 5) (given) (transitivity from 1 and 7) (additivity from 6 and 8) (given) (transitivity from 9 and 10) (reflexivity) (projectivity from 12) (additivity from 8 and 11) This P sequence contains unneeded FDs, such as 12 and 13, and is also a derivation sequence for other FDs, such as A B G I. The Use_Set_Of_P is {C ED, BE I, E G, GI H } 34

35 B-Axioms Definition: The B-Axioms set is a small and complete collection of inference rules. It is not a subset of A1 to A6, however it is equally expressive. For a relation (R), with W, X, Y, and Z subsets of R, and C an attribute in R then: B1. Reflexivity X X B2. Accumulation If (X YZ) and (Z CW) then X YZC B3. Projectivity If (X YZ) then X Y Motivation: This is another approach to the problem of finding a sequence of derivations using a smaller set of axioms. Significance: Since B-Axioms are complete, we can always find a derivation sequence using only the three B-axioms to assert whether or not F B X Y. 35

36 Example: Let R = (ABCDEGHI) and F = {AB E AG J BE I E G GI H} Problem Find a derivation sequence P showing F B AB GH using only B-axioms. Answer See P sequence on the right Comment (a) Use_Set_Of_P contains rules on lines 2, 5, 9, 11. (b) Too many steps! B-Axioms Step Explanation 36

37 B-Axioms Example: Let R = (ABCDEGHI) and F = {AB E AG J BE I E G GI H} Problem Find a derivation sequence P showing F B AB GH using only B-axioms. Answer See P sequence on the right Comment (a) Use_Set_Of_P contains rules on lines 2, 5, 9, 11. (b) Too many steps! Step Explanation 1 EI EI Reflexivity (B1) 2 E G Given 3 EI EIG Accumulation (B2) 4 EI GI Projectivity (B3) from (3) 5 GI H Given Ok, but useless 6 EI GHI Accumulation from (4) and (5) 7 EI GH Projectivity from (6) 8 AB AB Reflexivity 9 AB E Given 10 AB ABE Accumulation from (8) and (9) 11 BE I Given 12 AB ABEI Accumulation from (10) and (11) 13 AB ABEIG Accumulation from (4) and (12) 14 AB ABEGHI Accumulation from (7) and (13) 15 AB GH Projectivity from (14) 37

38 RAP-Derivation Sequence RAP: Stands for: Reflexivity, Augmentation, Projectivity Definition: Consider derivation sequences for X Y on a set F of FDs using the B-axioms that satisfy the following constraints: 1. The first FD is X X 2. The last FD is X Y 3. Every FD other than the first and last is either an FD in F (given) or and FD of the form X Z that was derived using axiom B2 (Accumulation). Such a derivation is called a RAP-derivation sequence 38

39 RAP-Derivation Sequence Example: Let R = (ABCDEGHI) and F = { AB E AG J BE I E G GI H } Find a RAP-sequence for AB GH Step Explanation 1 AB AB B1 Comments 1. The table contains a RAP sequence for AB GH. 2. Each rule in P is either given in F or the result of applying B2 on previous rules in P. 3. First and Last lines agree with the definition of RAP sequence. 4. Use_Set_Of_P contains rules in lines 2, 4, 6, 8. 2 AB E Given 3 AB ABE B2 4 BE I Given 5 AB ABEI B2 6 E G Given 7 AB ABEIG B2 8 GI H Given 9 AB ABIGH B2 10 AB GH B3 39

40 RAP-Derivation Sequence Example: Let R = (ABCDEGHI) and F = { AB E AG J BE I E G GI H } Find a RAP-sequence for BHE GI Step 1 Explanation Your turn

41 RAP-Derivation Sequence Example: Let R = (ABCDEG) and F = { A BC, BD G, C ED } Find a RAP-sequence for AD GE Your turn Step Explanation 41

42 RAP-Derivation Sequence Example: Let R = (ABCDEI) and F = { A D, AB E, BI E, CD I, E C} Find a RAP-sequence for AE DCI Step 1 Explanation Your turn

43 Derivation DAGs A directed acyclic graph (DAG) is a directed graph with no directed paths from any node to itself. A labeled DAG is a DAG with an element from some labeling set L associated with each node. Valid DAG (disconnected but OK) Not a Valid DAG (Path: A-D-A makes a cycle) 43

44 Derivation DAGs DAGS are a convenient way of graphically representing a derivation sequence of the form F B X Y Whenever there is a RAP derivation sequence there is an equivalent DDAG (and conversely) 44

45 Derivation DAGs EXAMPLE Consider schema r(abcdeg) and functional dependencies F = { A BC, BD G, C ED }. Show a DDAG for AD GE D G B A C E NOTE: The Use_Set of the derivation sequence is { A BC, BD G, C E } 45

46 Derivation DAGs Rules for Constructing a DDAG Rule 1. Any set of unconnected nodes with labels from r(r) is an F-based DDAG A 1 A 2 Rule 2. Let H be a DDAG including nodes labeled A 1 A k. Let rule A 1 A k B be part of F. Form graph H by adding a new node labeled B and new edges <A 1,B>,,<A K,B>. A 1 New edges B New node A K A N Rule 3. Nothing else is an F-based derivation DDAG. 46

47 Derivation DAGs Example Consider the relation schema r(abcdeghij) subject to the dependencies in F = { AB E, AG J, BE I, E G, GI H }. Draw a DDAG for rule AB GH A E G B I H Note: The Use_Set of the derivation sequence is { AB E, BE I, E G, GI H } 47

48 Derivation DAGs Example Consider the relation schema r(abcdeghij) subject to the dependencies in F = { AB E, AG J, BE I, E G, GI H }. Draw a DDAG for the new rule BIG JA B I H A J G NOTE: No path from source to destination is possible, therefore the new rule BIG AJ is not derivable from F. 48

49 Derivation DAGs Example Consider the relation schema R(ABCDEGHIJ) subject to the dependencies in F = { AB E, AG J, BE I, E G, GI H }. Draw a derivation DDAG for the new rule AB HC G A E C B I H NOTE: Node C is not reachable from the source. Therefore the rule AB be deduced from F. CH cannot 49

50 X + Closure of a Set of Attributes In order to simplify the asserting of whether or not a rule X Y follows from a set F of FDs, we will compute X + the closure of a set of attributes X The set X + is the maximal set of attributes which can be derived from X using a RAP derivation sequence starting on X We will say that X Y is in F + whenever Y is in X + 50

51 Computing X + The following algorithm to compute X + has poor performance but is easy to understand Algorithm: X-Closure Input: A set of attributes X and a set of FDs F Output: The closure of X under F denoted X + function X-CLOSURE (X, F) begin OldDep = ; NewDep = X; while ( NewDep OldDep ) do begin OldDep = NewDep for every FD A B in F do end while; return ( NewDep ) end function; if ( NewDep A ) then NewDep = NewDep B; 51

52 Computing X + EXAMPLES Consider the relation schema r(abcdeghij) subject to the dependencies in F = { AB E, AG J, BE I, E G, GI H }. Compute closure of AB (AB) + = A B reflexivity A B E using AB E A B E I BE I A B E I G E G A B E I G HJ GI H nothing else could be added to AB + Note: Observe that AB ABEIHG. This rule is a compact notation for the 2 7 FDs having AB as LHS. 52

53 Computing X + EXAMPLES Consider the relation schema r(abcdeghij) subject to the dependencies in F = { AB E, AG J, BE I, E G, GI H }. Compute closure DEC (DEC) + = D E C D E C G using E G nothing else could be added 53

54 Member Algorithm Checking Membership In order to verify whether or not a functional dependency X Y could be derived from a set F of FDs the following simple test could be applied F B X Y if Y is part of X + 54

55 Member Algorithm Member Algorithm Input: Rule X Y and functional dependencies F Output: TRUE whenever the rule is derived from F Method: begin if ( Xclosure (X, F) return( True ) else return( False ); end; Y ) then Example Question: Does rule AB EH follow from F = { AB E, AG J, BE I, E G, GI H } Answer: YES. Observe that (AB) + = ABEIGHJ EH. 55

56 Linear Closure X F + Input: A set of attributes X and a set of functional dependencies F Output: The closure of X under F demote X F + Procedure LINCLOSURE ( Attribute X, SetOfFDs F) BEGIN /* Initialization */ END for each FD W Z in F do begin COUNT[ W Z ] = lenghtof(w); for each attribute A in W do add rule W Z into LIST[ A ]; end; NEWDEP = X; UPDATE = X; /* Computation */ while ( UPDATE Ø) do begin Choose an attribute A in UPDATE; UPDATE = UPDATE - A; for each FD W Z in LIST[A] do begin COUNT[W Z] = COUNT[W Z] - 1; if ( COUNT[w Z] = 0 ) then ADD = Z - NEWDEP; NEWDEP = NEWDEP ADD; UPDATE = UPDATE ADD; end if; end for; end while; 56

57 Linear Closure X F + Example Consider the schema r(abcdei) subject to the dependencies F = { A D, AB E, BI E, CD I, E C} Find the closure of AE using the Linear Closure algorithm 57

58 Linear Closure X F + Example (continuation ) Tracing the execution of the linear time closure algorithm UPDATE= AE NEWDEP= AE UPDATE= ED NEWDEP= AED UPDATE= DC NEWDEP= AEDC UPDATE= C NEWDEP= AEDC UPDATE= I NEWDEP= AEDCI UPDATE= Ø NEWDEP= AEDCI List[A] Rule 1 A D Count[1] = 0 therefore add D to both strings Rule 2 AB E Count[2] = 1 List[E] Rule 5 E C Count[5] = 0 therefore add C to both strings List[D] Rule 4 CD I Count[5] = 1 List[C] Rule 4 CD I Count[4] = 0 therefore add I to both strings List[I] Rule 3 BI E Count[3] = 1 therefore (AE) + = AEDCI 58

59 Linear Closure X F + Homework You will create a CASE tool for designing good databases. The first step involves the implementation of the XLinearClosure() algorithm. 59

Functional. Dependencies. Functional Dependency. Definition. Motivation: Definition 11/12/2013

Functional. Dependencies. Functional Dependency. Definition. Motivation: Definition 11/12/2013 Functional Dependencies Functional Dependency Functional dependency describes the relationship between attributes in a relation. Eg. if A and B are attributes of relation R, B is functionally dependent

More information

UVA UVA UVA UVA. Database Design. Relational Database Design. Functional Dependency. Loss of Information

UVA UVA UVA UVA. Database Design. Relational Database Design. Functional Dependency. Loss of Information Relational Database Design Database Design To generate a set of relation schemas that allows - to store information without unnecessary redundancy - to retrieve desired information easily Approach - design

More information

Data Bases Data Mining Foundations of databases: from functional dependencies to normal forms

Data Bases Data Mining Foundations of databases: from functional dependencies to normal forms Data Bases Data Mining Foundations of databases: from functional dependencies to normal forms Database Group http://liris.cnrs.fr/ecoquery/dokuwiki/doku.php?id=enseignement: dbdm:start March 1, 2017 Exemple

More information

Chapter DEFINITIONS

Chapter DEFINITIONS Chapter 4 FUNCTIONAL DEPENDENCIES Two primary purposes of databases are to attenuate data redundancy and enhance data reliability. Any a priorz knowledge of restrictions or constraints on permissible sets

More information

LOGICAL DATABASE DESIGN Part #1/2

LOGICAL DATABASE DESIGN Part #1/2 LOGICAL DATABASE DESIGN Part #1/2 Functional Dependencies Informally, a FD appears when the values of a set of attributes uniquely determines the values of another set of attributes. Example: schedule

More information

Design Theory: Functional Dependencies and Normal Forms, Part I Instructor: Shel Finkelstein

Design Theory: Functional Dependencies and Normal Forms, Part I Instructor: Shel Finkelstein Design Theory: Functional Dependencies and Normal Forms, Part I Instructor: Shel Finkelstein Reference: A First Course in Database Systems, 3 rd edition, Chapter 3 Important Notices CMPS 180 Final Exam

More information

Functional Dependencies & Normalization. Dr. Bassam Hammo

Functional Dependencies & Normalization. Dr. Bassam Hammo Functional Dependencies & Normalization Dr. Bassam Hammo Redundancy and Normalisation Redundant Data Can be determined from other data in the database Leads to various problems INSERT anomalies UPDATE

More information

CSIT5300: Advanced Database Systems

CSIT5300: Advanced Database Systems CSIT5300: Advanced Database Systems L05: Functional Dependencies Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR, China

More information

Functional Dependencies. Getting a good DB design Lisa Ball November 2012

Functional Dependencies. Getting a good DB design Lisa Ball November 2012 Functional Dependencies Getting a good DB design Lisa Ball November 2012 Outline (2012) SEE NEXT SLIDE FOR ALL TOPICS (some for you to read) Normalization covered by Dr Sanchez Armstrong s Axioms other

More information

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 10. Logical consequence (implication) Implication problem for fds

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 10. Logical consequence (implication) Implication problem for fds Plan of the lecture G53RDB: Theory of Relational Databases Lecture 10 Natasha Alechina School of Computer Science & IT nza@cs.nott.ac.uk Logical implication for functional dependencies Armstrong closure.

More information

Relational Database Design

Relational Database Design Relational Database Design Jan Chomicki University at Buffalo Jan Chomicki () Relational database design 1 / 16 Outline 1 Functional dependencies 2 Normal forms 3 Multivalued dependencies Jan Chomicki

More information

CS54100: Database Systems

CS54100: Database Systems CS54100: Database Systems Keys and Dependencies 18 January 2012 Prof. Chris Clifton Functional Dependencies X A = assertion about a relation R that whenever two tuples agree on all the attributes of X,

More information

Functional Dependency and Algorithmic Decomposition

Functional Dependency and Algorithmic Decomposition Functional Dependency and Algorithmic Decomposition In this section we introduce some new mathematical concepts relating to functional dependency and, along the way, show their practical use in relational

More information

Functional Dependencies and Normalization

Functional Dependencies and Normalization Functional Dependencies and Normalization There are many forms of constraints on relational database schemata other than key dependencies. Undoubtedly most important is the functional dependency. A functional

More information

Design Theory for Relational Databases

Design Theory for Relational Databases Design Theory for Relational Databases FUNCTIONAL DEPENDENCIES DECOMPOSITIONS NORMAL FORMS 1 Functional Dependencies X ->Y is an assertion about a relation R that whenever two tuples of R agree on all

More information

Relational Design: Characteristics of Well-designed DB

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

More information

Relational Design Theory I. Functional Dependencies: why? Redundancy and Anomalies I. Functional Dependencies

Relational Design Theory I. Functional Dependencies: why? Redundancy and Anomalies I. Functional Dependencies Relational Design Theory I Functional Dependencies Functional Dependencies: why? Design methodologies: Bottom up (e.g. binary relational model) Top-down (e.g. ER leads to this) Needed: tools for analysis

More information

Relational-Database Design

Relational-Database Design C H A P T E R 7 Relational-Database Design Exercises 7.2 Answer: A decomposition {R 1, R 2 } is a lossless-join decomposition if R 1 R 2 R 1 or R 1 R 2 R 2. Let R 1 =(A, B, C), R 2 =(A, D, E), and R 1

More information

Detecting Functional Dependencies Felix Naumann

Detecting Functional Dependencies Felix Naumann Detecting Functional Dependencies 21.5.2013 Felix Naumann Overview 2 Functional Dependencies TANE Candidate sets Pruning Algorithm Dependency checking Approximate FDs FD_Mine Conditional FDs Definition

More information

Schema Refinement & Normalization Theory: Functional Dependencies INFS-614 INFS614, GMU 1

Schema Refinement & Normalization Theory: Functional Dependencies INFS-614 INFS614, GMU 1 Schema Refinement & Normalization Theory: Functional Dependencies INFS-614 INFS614, GMU 1 Background We started with schema design ER model translation into a relational schema Then we studied relational

More information

Schema Refinement and Normalization

Schema Refinement and Normalization Schema Refinement and Normalization Schema Refinements and FDs Redundancy is at the root of several problems associated with relational schemas. redundant storage, I/D/U anomalies Integrity constraints,

More information

Introduction to Data Management. Lecture #6 (Relational DB Design Theory)

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

More information

Normaliza)on and Func)onal Dependencies

Normaliza)on and Func)onal Dependencies Normaliza)on and Func)onal Dependencies 1NF and 2NF Redundancy and Anomalies Func)onal Dependencies A9ribute Closure Keys and Super keys 3NF BCNF Minimal Cover Algorithm 3NF Synthesis Algorithm Decomposi)on

More information

COSC 430 Advanced Database Topics. Lecture 2: Relational Theory Haibo Zhang Computer Science, University of Otago

COSC 430 Advanced Database Topics. Lecture 2: Relational Theory Haibo Zhang Computer Science, University of Otago COSC 430 Advanced Database Topics Lecture 2: Relational Theory Haibo Zhang Computer Science, University of Otago Learning objectives and references You should be able to: define the elements of the relational

More information

CMPS Advanced Database Systems. Dr. Chengwei Lei CEECS California State University, Bakersfield

CMPS Advanced Database Systems. Dr. Chengwei Lei CEECS California State University, Bakersfield CMPS 4420 Advanced Database Systems Dr. Chengwei Lei CEECS California State University, Bakersfield CHAPTER 15 Relational Database Design Algorithms and Further Dependencies Slide 15-2 Chapter Outline

More information

Homework 1/Solutions. Graded Exercises

Homework 1/Solutions. Graded Exercises MTH 310-3 Abstract Algebra I and Number Theory S18 Homework 1/Solutions Graded Exercises Exercise 1. Below are parts of the addition table and parts of the multiplication table of a ring. Complete both

More information

Chapter 3 Design Theory for Relational Databases

Chapter 3 Design Theory for Relational Databases 1 Chapter 3 Design Theory for Relational Databases Contents Functional Dependencies Decompositions Normal Forms (BCNF, 3NF) Multivalued Dependencies (and 4NF) Reasoning About FD s + MVD s 2 Our example

More information

Design Theory for Relational Databases

Design Theory for Relational Databases Design Theory for Relational Databases Keys: formal definition K is a superkey for relation R if K functionally determines all attributes of R K is a key for R if K is a superkey, but no proper subset

More information

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Section Summary. Relations and Functions Properties of Relations. Combining Relations Chapter 9 Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations Closures of Relations (not currently included

More information

Introduction to Kleene Algebras

Introduction to Kleene Algebras Introduction to Kleene Algebras Riccardo Pucella Basic Notions Seminar December 1, 2005 Introduction to Kleene Algebras p.1 Idempotent Semirings An idempotent semiring is a structure S = (S, +,, 1, 0)

More information

Information Systems (Informationssysteme)

Information Systems (Informationssysteme) Information Systems (Informationssysteme) Jens Teubner, TU Dortmund jens.teubner@cs.tu-dortmund.de Summer 2015 c Jens Teubner Information Systems Summer 2015 1 Part VII Schema Normalization c Jens Teubner

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

CHAPTER 3 BOOLEAN ALGEBRA

CHAPTER 3 BOOLEAN ALGEBRA CHAPTER 3 BOOLEAN ALGEBRA (continued) This chapter in the book includes: Objectives Study Guide 3.1 Multiplying Out and Factoring Expressions 3.2 Exclusive-OR and Equivalence Operations 3.3 The Consensus

More information

Functional Dependencies

Functional Dependencies Functional Dependencies Functional Dependencies Framework for systematic design and optimization of relational schemas Generalization over the notion of Keys Crucial in obtaining correct normalized schemas

More information

Schema Refinement & Normalization Theory

Schema Refinement & Normalization Theory Schema Refinement & Normalization Theory Functional Dependencies Week 13 1 What s the Problem Consider relation obtained (call it SNLRHW) Hourly_Emps(ssn, name, lot, rating, hrly_wage, hrs_worked) What

More information

Functional Dependencies. Chapter 3

Functional Dependencies. Chapter 3 Functional Dependencies Chapter 3 1 Halfway done! So far: Relational algebra (theory) SQL (practice) E/R modeling (theory) HTML/Flask/Python (practice) Midterm (super fun!) Next up: Database design theory

More information

Functional Dependencies. Applied Databases. Not all designs are equally good! An example of the bad design

Functional Dependencies. Applied Databases. Not all designs are equally good! An example of the bad design Applied Databases Handout 2a. Functional Dependencies and Normal Forms 20 Oct 2008 Functional Dependencies This is the most mathematical part of the course. Functional dependencies provide an alternative

More information

Design theory for relational databases

Design theory for relational databases Design theory for relational databases 1. Consider a relation with schema R(A,B,C,D) and FD s AB C, C D and D A. a. What are all the nontrivial FD s that follow from the given FD s? You should restrict

More information

Functional Dependencies

Functional Dependencies Functional Dependencies P.J. M c.brien Imperial College London P.J. M c.brien (Imperial College London) Functional Dependencies 1 / 41 Problems in Schemas What is wrong with this schema? bank data no sortcode

More information

SCHEMA NORMALIZATION. CS 564- Fall 2015

SCHEMA NORMALIZATION. CS 564- Fall 2015 SCHEMA NORMALIZATION CS 564- Fall 2015 HOW TO BUILD A DB APPLICATION Pick an application Figure out what to model (ER model) Output: ER diagram Transform the ER diagram to a relational schema Refine the

More information

Homework 3/ Solutions

Homework 3/ Solutions MTH 310-3 Abstract Algebra I and Number Theory S17 Homework 3/ Solutions Exercise 1. Prove the following Theorem: Theorem Let R and S be rings. Define an addition and multiplication on R S by for all r,

More information

INF1383 -Bancos de Dados

INF1383 -Bancos de Dados INF1383 -Bancos de Dados Prof. Sérgio Lifschitz DI PUC-Rio Eng. Computação, Sistemas de Informação e Ciência da Computação Projeto de BD e Formas Normais Alguns slides são baseados ou modificados dos originais

More information

Relational Database Design Theory Part II. Announcements (October 12) Review. CPS 116 Introduction to Database Systems

Relational Database Design Theory Part II. Announcements (October 12) Review. CPS 116 Introduction to Database Systems Relational Database Design Theory Part II CPS 116 Introduction to Database Systems Announcements (October 12) 2 Midterm graded; sample solution available Please verify your grades on Blackboard Project

More information

Jordan University of Science and Technology Faculty of Information Technology CS 728: Advanced Database Systems Midterm Exam 1 st Semester 2010/2011

Jordan University of Science and Technology Faculty of Information Technology CS 728: Advanced Database Systems Midterm Exam 1 st Semester 2010/2011 Jordan University of Science and Technology Faculty of Information Technology CS 728: Advanced Database Systems Midterm Exam 1 st Semester 2010/2011 Student name: Student Number: 1. If only 10% of students

More information

Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) CIS 330, Spring 2004 Lecture 11 March 2, 2004

Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) CIS 330, Spring 2004 Lecture 11 March 2, 2004 Schema Refinement and Normal Forms CIS 330, Spring 2004 Lecture 11 March 2, 2004 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational schemas: redundant storage,

More information

Handout #6 INTRODUCTION TO ALGEBRAIC STRUCTURES: Prof. Moseley AN ALGEBRAIC FIELD

Handout #6 INTRODUCTION TO ALGEBRAIC STRUCTURES: Prof. Moseley AN ALGEBRAIC FIELD Handout #6 INTRODUCTION TO ALGEBRAIC STRUCTURES: Prof. Moseley Chap. 2 AN ALGEBRAIC FIELD To introduce the notion of an abstract algebraic structure we consider (algebraic) fields. (These should not to

More information

Schema Refinement and Normal Forms

Schema Refinement and Normal Forms Schema Refinement and Normal Forms Chapter 19 Database Management Systems, 3ed, R. Ramakrishnan and J. Gehrke 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational

More information

Schema Refinement and Normal Forms Chapter 19

Schema Refinement and Normal Forms Chapter 19 Schema Refinement and Normal Forms Chapter 19 Instructor: Vladimir Zadorozhny vladimir@sis.pitt.edu Information Science Program School of Information Sciences, University of Pittsburgh Database Management

More information

Unit 3 - Functional Dependency and Decomposition

Unit 3 - Functional Dependency and Decomposition Functional Dependency Let R be a relation schema having n attributes A1, A2, A3,, An. Let attributes X and Y are two subsets of attributes of relation R. If the values of the X component of a tuple uniquely

More information

Database Design: Normal Forms as Quality Criteria. Functional Dependencies Normal Forms Design and Normal forms

Database Design: Normal Forms as Quality Criteria. Functional Dependencies Normal Forms Design and Normal forms Database Design: Normal Forms as Quality Criteria Functional Dependencies Normal Forms Design and Normal forms Design Quality: Introduction Good conceptual model: - Many alternatives - Informal guidelines

More information

Chapter 7: Relational Database Design

Chapter 7: Relational Database Design Chapter 7: Relational Database Design Chapter 7: Relational Database Design! First Normal Form! Pitfalls in Relational Database Design! Functional Dependencies! Decomposition! Boyce-Codd Normal Form! Third

More information

The Evils of Redundancy. Schema Refinement and Normal Forms. Functional Dependencies (FDs) Example: Constraints on Entity Set. Example (Contd.

The Evils of Redundancy. Schema Refinement and Normal Forms. Functional Dependencies (FDs) Example: Constraints on Entity Set. Example (Contd. The Evils of Redundancy Schema Refinement and Normal Forms INFO 330, Fall 2006 1 Redundancy is at the root of several problems associated with relational schemas: redundant storage, insert/delete/update

More information

Schema Refinement and Normal Forms. The Evils of Redundancy. Schema Refinement. Yanlei Diao UMass Amherst April 10, 2007

Schema Refinement and Normal Forms. The Evils of Redundancy. Schema Refinement. Yanlei Diao UMass Amherst April 10, 2007 Schema Refinement and Normal Forms Yanlei Diao UMass Amherst April 10, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke 1 The Evils of Redundancy Redundancy is at the root of several problems associated

More information

DESIGN THEORY FOR RELATIONAL DATABASES. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018

DESIGN THEORY FOR RELATIONAL DATABASES. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018 DESIGN THEORY FOR RELATIONAL DATABASES csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018 1 Introduction There are always many different schemas for a given

More information

Chapter 7: Relational Database Design. Chapter 7: Relational Database Design

Chapter 7: Relational Database Design. Chapter 7: Relational Database Design Chapter 7: Relational Database Design Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design Functional Dependencies Decomposition Boyce-Codd Normal Form Third Normal

More information

Constraints: Functional Dependencies

Constraints: Functional Dependencies Constraints: Functional Dependencies Spring 2018 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) Functional Dependencies 1 / 32 Schema Design When we get a relational

More information

Numbers, proof and all that jazz.

Numbers, proof and all that jazz. CHAPTER 1 Numbers, proof and all that jazz. There is a fundamental difference between mathematics and other sciences. In most sciences, one does experiments to determine laws. A law will remain a law,

More information

Kapitel 3: Formal Design

Kapitel 3: Formal Design Theory I: Database Foundations 3. Formal Design 3. Kapitel 3: Formal Design We want to distinguish good from bad database design. What kind of additional information do we need? Can we transform a bad

More information

The Evils of Redundancy. Schema Refinement and Normal Forms. Example: Constraints on Entity Set. Functional Dependencies (FDs) Example (Contd.

The Evils of Redundancy. Schema Refinement and Normal Forms. Example: Constraints on Entity Set. Functional Dependencies (FDs) Example (Contd. The Evils of Redundancy Schema Refinement and Normal Forms Chapter 19 Database Management Systems, 3ed, R. Ramakrishnan and J. Gehrke 1 Redundancy is at the root of several problems associated with relational

More information

The Evils of Redundancy. Schema Refinement and Normal Forms. Example: Constraints on Entity Set. Functional Dependencies (FDs) Refining an ER Diagram

The Evils of Redundancy. Schema Refinement and Normal Forms. Example: Constraints on Entity Set. Functional Dependencies (FDs) Refining an ER Diagram Schema Refinement and Normal Forms Chapter 19 Database Management Systems, R. Ramakrishnan and J. Gehrke 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational

More information

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Definition: A binary relation R from a set A to a set B is a subset R A B. Example: Section 9.1 Rela%onships Relationships between elements of sets occur in many contexts. Every day we deal with relationships such as those between a business and its telephone number, an employee and his

More information

MTH401A Theory of Computation. Lecture 17

MTH401A Theory of Computation. Lecture 17 MTH401A Theory of Computation Lecture 17 Chomsky Normal Form for CFG s Chomsky Normal Form for CFG s For every context free language, L, the language L {ε} has a grammar in which every production looks

More information

Schema Refinement and Normal Forms

Schema Refinement and Normal Forms Schema Refinement and Normal Forms UMass Amherst Feb 14, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke, Dan Suciu 1 Relational Schema Design Conceptual Design name Product buys Person price name

More information

Introduction to Data Management. Lecture #6 (Relational Design Theory)

Introduction to Data Management. Lecture #6 (Relational Design Theory) Introduction to Data Management Lecture #6 (Relational Design Theory) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v HW#2 is

More information

Chapter 3 Design Theory for Relational Databases

Chapter 3 Design Theory for Relational Databases 1 Chapter 3 Design Theory for Relational Databases Contents Functional Dependencies Decompositions Normal Forms (BCNF, 3NF) Multivalued Dependencies (and 4NF) Reasoning About FD s + MVD s 2 Remember our

More information

Schema Refinement and Normal Forms. Chapter 19

Schema Refinement and Normal Forms. Chapter 19 Schema Refinement and Normal Forms Chapter 19 1 Review: Database Design Requirements Analysis user needs; what must the database do? Conceptual Design high level descr. (often done w/er model) Logical

More information

Schema Refinement. Feb 4, 2010

Schema Refinement. Feb 4, 2010 Schema Refinement Feb 4, 2010 1 Relational Schema Design Conceptual Design name Product buys Person price name ssn ER Model Logical design Relational Schema plus Integrity Constraints Schema Refinement

More information

Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) [R&G] Chapter 19

Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) [R&G] Chapter 19 Schema Refinement and Normal Forms [R&G] Chapter 19 CS432 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational schemas: redundant storage, insert/delete/update

More information

Schema Refinement and Normal Forms

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

More information

Schema Refinement and Normal Forms. Case Study: The Internet Shop. Redundant Storage! Yanlei Diao UMass Amherst November 1 & 6, 2007

Schema Refinement and Normal Forms. Case Study: The Internet Shop. Redundant Storage! Yanlei Diao UMass Amherst November 1 & 6, 2007 Schema Refinement and Normal Forms Yanlei Diao UMass Amherst November 1 & 6, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke 1 Case Study: The Internet Shop DBDudes Inc.: a well-known database consulting

More information

Schema Refinement and Normal Forms. Why schema refinement?

Schema Refinement and Normal Forms. Why schema refinement? Schema Refinement and Normal Forms Why schema refinement? Consider relation obtained from Hourly_Emps: Hourly_Emps (sin,rating,hourly_wages,hourly_worked) Problems: Update Anomaly: Can we change the wages

More information

Schema Refinement and Normal Forms

Schema Refinement and Normal Forms Schema Refinement and Normal Forms Yanlei Diao UMass Amherst April 10 & 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke 1 Case Study: The Internet Shop DBDudes Inc.: a well-known database consulting

More information

CSE 132B Database Systems Applications

CSE 132B Database Systems Applications CSE 132B Database Systems Applications Alin Deutsch Database Design and Normal Forms Some slides are based or modified from originals by Sergio Lifschitz @ PUC Rio, Brazil and Victor Vianu @ CSE UCSD and

More information

Propositional Logic: Part II - Syntax & Proofs 0-0

Propositional Logic: Part II - Syntax & Proofs 0-0 Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems

More information

CS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen

CS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen CS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen LECTURE 4: DESIGN THEORIES (FUNCTIONAL DEPENDENCIES) Design theory E/R diagrams are high-level design Formal theory for

More information

LESSON 7.1 FACTORING POLYNOMIALS I

LESSON 7.1 FACTORING POLYNOMIALS I LESSON 7.1 FACTORING POLYNOMIALS I LESSON 7.1 FACTORING POLYNOMIALS I 293 OVERVIEW Here s what you ll learn in this lesson: Greatest Common Factor a. Finding the greatest common factor (GCF) of a set of

More information

11/1/12. Relational Schema Design. Relational Schema Design. Relational Schema Design. Relational Schema Design (or Logical Design)

11/1/12. Relational Schema Design. Relational Schema Design. Relational Schema Design. Relational Schema Design (or Logical Design) Relational Schema Design Introduction to Management CSE 344 Lectures 16: Database Design Conceptual Model: Relational Model: plus FD s name Product buys Person price name ssn Normalization: Eliminates

More information

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic Mathematics 114L Spring 2018 D.A. Martin Mathematical Logic 1 First-Order Languages. Symbols. All first-order languages we consider will have the following symbols: (i) variables v 1, v 2, v 3,... ; (ii)

More information

Database Design and Implementation

Database Design and Implementation Database Design and Implementation CS 645 Schema Refinement First Normal Form (1NF) A schema is in 1NF if all tables are flat Student Name GPA Course Student Name GPA Alice 3.8 Bob 3.7 Carol 3.9 Alice

More information

CSC 261/461 Database Systems Lecture 10 (part 2) Spring 2018

CSC 261/461 Database Systems Lecture 10 (part 2) Spring 2018 CSC 261/461 Database Systems Lecture 10 (part 2) Spring 2018 Announcement Read Chapter 14 and 15 You must self-study these chapters Too huge to cover in Lectures Project 2 Part 1 due tonight Agenda 1.

More information

Lectures 6. Lecture 6: Design Theory

Lectures 6. Lecture 6: Design Theory Lectures 6 Lecture 6: Design Theory Lecture 6 Announcements Solutions to PS1 are posted online. Grades coming soon! Project part 1 is out. Check your groups and let us know if you have any issues. We have

More information

HKBU: Tutorial 4

HKBU: Tutorial 4 COMP7640 @ HKBU: Tutorial 4 Functional Dependency and Database Normalization Wei Wang weiw AT cse.unsw.edu.au School of Computer Science & Engineering University of New South Wales October 17, 2014 Wei

More information

11/6/11. Relational Schema Design. Relational Schema Design. Relational Schema Design. Relational Schema Design (or Logical Design)

11/6/11. Relational Schema Design. Relational Schema Design. Relational Schema Design. Relational Schema Design (or Logical Design) Relational Schema Design Introduction to Management CSE 344 Lectures 16: Database Design Conceptual Model: Relational Model: plus FD s name Product buys Person price name ssn Normalization: Eliminates

More information

5-5 The Triangle Inequality

5-5 The Triangle Inequality Is it possible to form a triangle with the given side lengths? If not, explain why not. 1. 5 cm, 7 cm, 10 cm Yes; 5 + 7 > 10, 5 + 10 > 7, and 7 + 10 > 5 3. 6 m, 14 m, 10 m Yes; 6 + 14 > 10, 6 + 10 > 14,

More information

Functional Dependencies and Normalization

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

More information

FUNCTIONAL DEPENDENCY THEORY. CS121: Relational Databases Fall 2017 Lecture 19

FUNCTIONAL DEPENDENCY THEORY. CS121: Relational Databases Fall 2017 Lecture 19 FUNCTIONAL DEPENDENCY THEORY CS121: Relational Databases Fall 2017 Lecture 19 Last Lecture 2 Normal forms specify good schema patterns First normal form (1NF): All attributes must be atomic Easy in relational

More information

Constraints: Functional Dependencies

Constraints: Functional Dependencies Constraints: Functional Dependencies Fall 2017 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) Functional Dependencies 1 / 42 Schema Design When we get a relational

More information

CH 37 DOUBLE DISTRIBUTING

CH 37 DOUBLE DISTRIBUTING CH 37 DOUBLE DISTRIBUTING 343 The Double Distributive Property W hat we need now is a way to multiply two binomials together, a skill absolutely necessary for success in this class. For example, how do

More information

The Evils of Redundancy. Schema Refinement and Normalization. Functional Dependencies (FDs) Example: Constraints on Entity Set. Refining an ER Diagram

The Evils of Redundancy. Schema Refinement and Normalization. Functional Dependencies (FDs) Example: Constraints on Entity Set. Refining an ER Diagram The Evils of Redundancy Schema Refinement and Normalization Chapter 1 Nobody realizes that some people expend tremendous energy merely to be normal. Albert Camus Redundancy is at the root of several problems

More information

Background: Functional Dependencies. æ We are always talking about a relation R, with a æxed schema èset of attributesè and a

Background: Functional Dependencies. æ We are always talking about a relation R, with a æxed schema èset of attributesè and a Background: Functional Dependencies We are always talking about a relation R, with a xed schema èset of attributesè and a varying instance èset of tuplesè. Conventions: A;B;:::are attributes; :::;Y;Z are

More information

10/12/10. Outline. Schema Refinements = Normal Forms. First Normal Form (1NF) Data Anomalies. Relational Schema Design

10/12/10. Outline. Schema Refinements = Normal Forms. First Normal Form (1NF) Data Anomalies. Relational Schema Design Outline Introduction to Database Systems CSE 444 Design theory: 3.1-3.4 [Old edition: 3.4-3.6] Lectures 6-7: Database Design 1 2 Schema Refinements = Normal Forms 1st Normal Form = all tables are flat

More information

Limitations of Algorithm Power

Limitations of Algorithm Power Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying

More information

Database Tutorial 2: Functional Dependencies and Normal Forms

Database Tutorial 2: Functional Dependencies and Normal Forms Database Tutorial 2: Functional Dependencies and Normal Forms 2015-02-10 1. (9 points) Modeling and Design flight airline prime operating departure departure destination destination aircraft seats code

More information

Data Dependencies in the Presence of Difference

Data Dependencies in the Presence of Difference Data Dependencies in the Presence of Difference Tsinghua University sxsong@tsinghua.edu.cn Outline Introduction Application Foundation Discovery Conclusion and Future Work Data Dependencies in the Presence

More information

CAS CS 460/660 Introduction to Database Systems. Functional Dependencies and Normal Forms 1.1

CAS CS 460/660 Introduction to Database Systems. Functional Dependencies and Normal Forms 1.1 CAS CS 460/660 Introduction to Database Systems Functional Dependencies and Normal Forms 1.1 Review: Database Design Requirements Analysis user needs; what must database do? Conceptual Design high level

More information

Functional Dependencies and Normalization. Instructor: Mohamed Eltabakh

Functional Dependencies and Normalization. Instructor: Mohamed Eltabakh Functional Dependencies and Normalization Instructor: Mohamed Eltabakh meltabakh@cs.wpi.edu 1 Goal Given a database schema, how do you judge whether or not the design is good? How do you ensure it does

More information

Review: Keys. What is a Functional Dependency? Why use Functional Dependencies? Functional Dependency Properties

Review: Keys. What is a Functional Dependency? Why use Functional Dependencies? Functional Dependency Properties Review: Keys Superkey: set of attributes whose values are unique for each tuple Note: a superkey isn t necessarily minimal. For example, for any relation, the entire set of attributes is always a superkey.

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

D B M G Data Base and Data Mining Group of Politecnico di Torino

D B M G Data Base and Data Mining Group of Politecnico di Torino Data Base and Data Mining Group of Politecnico di Torino Politecnico di Torino Association rules Objective extraction of frequent correlations or pattern from a transactional database Tickets at a supermarket

More information

Consider a relation R with attributes ABCDEF GH and functional dependencies S:

Consider a relation R with attributes ABCDEF GH and functional dependencies S: University of Toronto CSC343 Sample 3NF Problem Questions Consider a relation R with attributes ABCDEF GH and functional dependencies S: 1. Compute all keys for R. S = {A CD, ACF G, AD BEF, BCG D, CF AH,

More information