Week 11: Normal Forms. Logical Database Design. Normal Forms and Normalization. Examples of Redundancy
|
|
|
- Ira May
- 10 years ago
- Views:
Transcription
1 Week 11: Normal Forms Database Design Database Redundancies and Anomalies Functional Dependencies Entailment, Closure and Equivalence Lossless Decompositions The Third Normal Form (3NF) The Boyce-Codd Normal Form (BCNF) Normal Forms and Database Design Logical Database Design We have seen how to design a relational schema by first designing an ER schema and then transforming it into a relational one. Now we focus on how to transform the generated relational schema into a "better" one. Goodness of relational schemas is defined in terms of the notion of normal form. Normal Forms 1 Normal Forms 2 Normal Forms and Normalization A normal form is a property of a database schema. When a database schema is un-normalized (that is, does not satisfy the normal form), it allows redundancies of various types which can lead to anomalies and inconsistencies. Normal forms can serve as basis for evaluating the quality of a database schema and constitutes a useful tool for database design. Normalization is a procedure that transforms an unnormalized schema into a normalized one. Examples of Redundancy Employee Salary Project Budget Function Brown 20 Mars 2 technician Green 35 Jupiter 15 designer Green 35 Venus 15 designer Hoskins 55 Venus 15 manager Hoskins 55 Jupiter 15 consultant Hoskins 55 Mars 2 consultant Moore 48 Mars 2 manager Moore 48 Venus 15 designer Kemp 48 Venus 15 designer Kemp 48 Jupiter 15 manager Normal Forms 3 Normal Forms 4 1
2 Anomalies The value of the salary of an employee is repeated in every tuple where the employee is mentioned, leading to a redundancy. Redundancies lead to anomalies: If salary of an employee changes, we have to modify the value in all corresponding tuples (update anomaly) If an employee ceases to work in projects, but stays with company, all corresponding tuples are deleted, leading to loss of information (deletion anomaly) A new employee cannot be inserted in the relation until the employee is assigned to a project (insertion anomaly) What s Wrong??? We are using a single relation to represent data of very different types. In particular, we are using a single relation to store the following types of entities, relationships and attributes: Employees and their salaries; Projects and their budgets; Participation of employees in projects, along with their functions. To set the problem on a formal footing, we introduce the notion of functional dependency (FD). Normal Forms 5 Normal Forms 6 Functional Dependencies (FDs) in the Example Each employee has a unique salary. We represent this dependency as Employee Salary and say "Salary functionally depends on Employee". Meaning: if two tuples have the same Employee attribute value, they must also have the same Salary attribute value Likewise, Project Budget i.e., each project has a unique budget Functional Dependencies Given schema R(X) and non-empty subsets Y and Z of the attributes X, we say that there is a functional dependency between Y and Z (Y Z), iff for every relation instance r of R(X) and every pair of tuples t 1, t 2 of r, if t 1.Y = t 2.Y, then t 1.Z = t 2.Z. A functional dependency is a statement about all allowable relations for a given schema. Functional dependencies have to be identified by understanding the semantics of the application. Given a particular relation r 0 of R(X), we can tell if a dependency holds or not; but just because it holds for r 0, doesn t mean that it also holds for R(X)! Normal Forms 7 Normal Forms 8 2
3 Looking for FDs Employee Salary Project Budget Function Brown 20 Mars 2 technician Green 35 Jupiter 15 designer Green 35 Venus 15 designer Hoskins 55 Venus 15 manager Hoskins 55 Jupiter 15 consultant Hoskins 55 Mars 2 consultant Moore 48 Mars 2 manager Moore 48 Venus 15 designer Kemp 48 Venus 15 designer Kemp 48 Jupiter 15 manager Non-Trivial Dependencies A functional dependency Y Z is non-trivial if no attribute in Z appears among attributes of Y, e.g., Employee Salary is non-trivial; Employee,Project Project is trivial. Anomalies arise precisely for the attributes which are involved in (non-trivial) functional dependencies: Employee Salary; Project Budget. Moreover, note that our example includes another functional dependency: Employee,Project Function. Normal Forms 9 Normal Forms 10 Dependencies Cause Anomalies,...Sometimes! The first two dependencies cause undesirable redundancies and anomalies. The third dependency, however, does not cause redundancies because {Employee,Project} constitutes a key of the relation (...and a relation cannot contain two tuples with the same values for the key attributes.) Dependencies on keys are OK, other dependencies are not! Normal Forms 11 ER Model Another Example SI# Name Address Hobbies 1111 Joe 123 Main {biking, hiking} SI# Name Address Hobby 1111 Joe 123 Main biking 1111 Joe 123 Main hiking. Relational Model Redundancy (0.N) This is NOT a relation Normal Forms 12 3
4 How Do We Eliminate Redundancy? Decomposition: Use two relations to store Person information: Person1 (SI#, Name, Address) Hobbies (SI#, Hobby) The decomposition is more general: people with hobbies can now be described independently of their name and address. No update anomalies: Name and address stored once; A hobby can be separately supplied or deleted; We can represent persons with no hobbies. Superkey Constraints A superkey constraint is a special functional dependency: Let K be a set of attributes of R, and U the set of all attributes of R. Then K is a superkey iff the functional dependency K U is satisfied in R. E.g., SI# SI#,Name,Address (for a Person relation) A key is a minimal superkey, I.e., for each X K, X is not a superkey SI#, Hobby SI#, Name, Address, Hobby but SI# SI#, Name, Address, Hobby Hobby SI#, Name, Address, Hobby A key attribute is an attribute that is part of a key. Normal Forms 13 Normal Forms 14 Address PostalCode More Examples DCS s postal code is M5S 3H5 Author, Title, Edition PublicationDate Ramakrishnan, et al., Database Management Systems, 3 rd publication date is 2003 CourseID ExamDate, ExamTime CSC343 s exam date is December 18, starting at 7pm When are FDs "Equivalent"? Sometimes functional dependencies (FDs) seem to be saying the same thing, e.g., Addr PostalCode,Str# vs Addr PostalCode, Addr Str# Another example Addr PostalCode, PostalCode Province vs Addr PostalCode, PostalCode Province vs Addr Province When are two sets of FDs equivalent? How do we "infer" new FDs from given FDs? Normal Forms 15 Normal Forms 16 4
5 Entailment, Closure, Equivalence If F is a set of FDs on schema R and f is another FD on R, then F entails f (written F = f) if every instance r of R that satisfies every FD in F also satisfies f. Example: F = {A B, B C} and f is A C If Phone# Address and Address ZipCode, then Phone# ZipCode The closure of F, denoted F +, is the set of all FDs entailed by F. F and G are equivalent if F entails G and G entails F. How Do We Compute Entailment? Satisfaction, entailment, and equivalence are semantic concepts defined in terms of the "meaning" of relations in the real world. How to check if F entails f, F and G are equivalent? Apply the respective definitions for all possible relation instances for a schema R Find algorithmic, syntactic ways to compute these notions. Note: The syntactic solution must be "correct with respect to the semantic definitions. Correctness has two aspects: soundness and completeness see later. Normal Forms 17 Normal Forms 18 Armstrong s Axioms for FDs This is the syntactic way of computing/testing semantic properties of FDs Reflexivity: Y X - X Y (trivial FD) e.g., - Name, Address Name Augmentation: X Y - XZ YZ e.g., Address ZipCode - Address,Name ZipCode, Name Transitivity: X Y, Y Z - X Z e.g., Phone# Address, Address ZipCode - Phone# ZipCode Soundness Theorem: F - f implies F = f In words: If FD f: X Y can be derived from a set of FDs F using the axioms, then f holds in every relation that satisfies every FD in F. Example: Given X Y and X Z then X XY Augmentation by X YX YZ Augmentation by Y X YZ Transitivity Thus, X YZ is satisfied in every relation where both X Y and X Z are satisfied. We have derived the union rule for FDs. Normal Forms 19 Normal Forms 20 5
6 Completeness Theorem: F = f implies F - f In words: If F entails f, then f can be derived from F using Armstrong's axioms. A consequence of completeness is the following (naïve) algorithm to determining if F entails f: Algorithm: Use the axioms in all possible ways to generate F + (the set of possible FD s is finite so this can be done) and see if f is in F + Correctness The notions of soundness and completeness link the syntax (Armstrong s axioms) with semantics, i.e., entailment defined in terms of relational instances. This is a precise way of saying that the algorithm for entailment based on the axioms is ``correct with respect to the definitions. Normal Forms 21 Normal Forms 22 Decomposition Rule Another example of a derivation rule we can use in generating F + : X AB, AB A (refl), X A (trans) So, whenever we have X AB, we can "decompose" this functional dependency to two functional dependencies X A, X B Generating F + F AB C union AB BCD decomp aug A D AB BD trans AB BCDE AB E aug D E BCD BCDE Thus, AB BD, AB BCD, AB BCDE, and AB E are all elements of F +. Normal Forms 23 Normal Forms 24 6
7 Attribute Closure Calculating attribute closure leads to a more efficient way of checking entailment. The attribute closure of a set of attributes X with respect to a set of FDs F, denoted X + F, is the set of all attributes A such that X A X + F is not necessarily same as X + G if F G Attribute closure and entailment: Algorithm: Given a set of FDs, F, then X Y if and only if Y X + F Computing the Attribute Closure X + F closure := X; // since X X + F repeat old := closure; if there is an FD Z V in F such that Z closure and V closure then closure := closure V until old = closure If T closure then X T is entailed by F Normal Forms 25 Normal Forms 26 Computing Attribute Closure: An Example F: AB C A D D E AC B Is AB E entailed by F? Yes Is D C entailed by F? No X X F + A {A, D, E} AB {A, B, C, D, E} AC {A, C, B, D, E} B {B} D {D, E} Result: X F + allows us to determine all FDs of the form X Y entailed by F Normal Forms Each normal form is a set of conditions on a schema that together guarantee certain properties (relating to redundancy and update anomalies). First normal form (1NF) is the same as the definition of relational model (relations = sets of tuples; each tuple = sequence of atomic values). Second normal form (2NF) 1NF plus every attribute that is not part of a candidate key (that is, a non-prime attribute) must depend on an entire candidate key (not part of it). The two most used are third normal form (3NF) and Boyce-Codd normal form (BCNF). We will discuss in detail the 3NF. Normal Forms 27 Normal Forms 28 7
8 The Third Normal Form A relation R(X) is in third normal form (3NF) if, for each (non-trivial) functional dependency Y Z, at least one of the following is true: Y contains a key K of R(X); Each attribute in Z is contained in at least one (candidate) key of R(X). That is, each attribute in Z is a prime attribute. 3NF does not remove all redundancies. 3NF decompositions founded on the notion of minimal cover. Decomposition into 3NF: Basic Idea Decomposition into 3NF can proceed as follows. For each functional dependency of the form Y Z, where Y contains a subset of a key K of R(X), create a projection on all the attributes Y, Z (2NF). For each dependency of the form Y Z, where Y, doesn t contain any key, and not all attributes of Z are key attributes, create a projection on all the attributes Y, Z (3NF). The new relations only include dependencies Y Z, where Y contains a key K of R(X), or Z contains only key attributes. Normal Forms 29 Normal Forms 30 R(ABCD), A D Projection: R1(AD), A D R2(ABC) Basic Idea Normalization Through Decomposition A relation that is not in 3NF, can be replaced with one or more normalized relations using normalization. We can eliminate redundancies and anomalies for the example relation Emp(Employee,Salary,Project,Budget,Function) if we replace it with the three relations obtained by projections on the sets of attributes corresponding to the three functional dependencies: Employee Salary; Project Budget. Employee,Project Function. Normal Forms 31 Normal Forms 32 8
9 Start with Result of Normalization Employee Salary Project Budget Function Brown 20 Mars 2 technician Green 35 Jupiter 15 designer Green 35 Venus 15 designer Hoskins 55 Venus 15 manager Hoskins 55 Jupiter 15 consultant Hoskins 55 Mars 2 consultant Moore 48 Mars 2 manager Moore 48 Venus 15 designer Kemp 48 Venus 15 designer Kemp 48 Jupiter 15 manager Employee Salary Brown 20 Green 35 Hoskins 55 Moore 48 Kemp 48 Employee Project Function Brown Mars technician Green Jupiter designer Green Venus designer Hoskins Venus manager Hoskins Jupiter consultant Hoskins Mars consultant Moore Mars manager Moore Venus designer Kemp Venus designer Kemp Jupiter manager Project Budget Mars 2 Jupiter 15 Venus 15 The keys of new relations are lefthand sides of functional dependencies; satisfaction of 3NF is therefore guaranteed for the new relations. Normal Forms 33 Normal Forms 34 Another Example A Possible Decomposition Employee Project Branch Brown Mars Chicago Green Jupiter Birmingham Green Venus Birmingham Hoskins Saturn Birmingham Hoskins Venus Birmingham This relation satisfies the functional dependencies: Employee Branch Project Branch Employee Brown Green Hoskins Branch Chicago Birmingham Birmingham Project Mars Jupiter Saturn Venus...but now we don t know each employee s projects! Branch Chicago Birmingham Birmingham Birmingham Normal Forms 35 Normal Forms 36 9
10 The Join of the Projections Lossless Decomposition Employee Project Branch Brown Mars Chicago Green Jupiter Birmingham Green Venus Birmingham Hoskins Saturn Birmingham Hoskins Venus Birmingham Green Saturn Birmingham Hoskins Jupiter Birmingham The result of the join is different from the original relation. We lost some information during the decomposition! The decomposition of a relation R(X) on X 1 and X 2 is lossless if for every instance r of R(X) the join of the projections of R on X 1 and X 2 is equal to r itself (that is, does not contain spurious tuples). Of course, it is clearly desirable to allow only lossless decompositions during normalization. Normal Forms 37 Normal Forms 38 A Condition for Lossless Decomposition Let R(X) be a relation schema and let X 1 and X 2 be two subsets of X such that X 1 X 2 = X. Also, let X 0 = X 1 X 2. If R(X) satisfies the functional dependency X 0 X 1 or X 0 X 2, then the decomposition of R(X) on X 1 and X 2 is lossless. In other words, R(X) has a lossless decomposition on two relations if the set of attributes common to the relations is a superkey for at least one of the decomposed relations. Normal Forms 39 Intuition Behind the Test for Losslessness Suppose R 1 R 2 R 2. Then a row of r 1 can combine with exactly one row of r 2 in the natural join (since in r 2 a particular set of values for the attributes in R 1 R 2 defines a unique row) R 1 R 2 R 1 R 2. a a... a b. b c. c r 1 r 2 Normal Forms 40 10
11 A Lossless Decomposition Employee Project Employee Branch Brown Mars Brown Chicago Green Jupiter Green Birmingham Green Venus Hoskins Birmingham Hoskins Saturn Hoskins Venus Notation Instead of saying that we have relation schema R(X) with functional dependencies F, we will say that we have schema R = (R, F) where R is a set of attributes and F is a set of functional dependencies. The 3NF normalization problem is then to generate a set of relation schemas R 1 =(R 1,F 1 ),, R n =(R n,f n ), such that R i is in 3NF. Normal Forms 41 Normal Forms 42 Another Example Schema (R, F) where R = {SI#, Name, Address, Hobby} F = {SI# Name, Address} can be decomposed into R 1 = {SI#, Name, Address} F 1 = {SI# Name, Address} and R 2 = {SI#, Hobby} F 2 = { } since R 1 R 2 = SI#, SI# R 1 the decomposition is lossless. Another Problem... Assume we wish to insert a new tuple that specifies that employee Armstrong works in the Birmingham branch and participates in project Mars. In the original relation, this update would be identified as illegal, because it would cause a violation of the Project Branch dependency. For the decomposed relations, however, this is not possible because the two attributes Project and Branch have been moved to different relations. Normal Forms 43 Normal Forms 44 11
12 Preserving Dependencies (Intuition) A decomposition preserves dependencies if each of the functional dependencies of the original relation schema involves attributes that appear together in one of the decomposed relation schemas. It is clearly desirable that a decomposition preserves dependencies because then it is possible to (efficiently) ensure that the decomposed schema satisfies the same constraints as the original schema. Example Schema (R, F) where R = {SI#,Name,Address,Hobby} F = {SI# Name,Address} can be decomposed into R 1 = {SI#, Name,Address} F 1 = {SI# Name,Address} and R 2 = {SI#, Hobby} F 2 = { } Since F = F 1 F 2 the decomposition is dependency preserving. Normal Forms 45 Normal Forms 46 Another Example Schema: (ABC; F), F = {A B, B C, C B} Decomposition: (AC, F 1 ), F 1 = {A C} [Note: A C F, but in F + ] (BC, F 2 ), F 2 = {B C, C B} A B (F 1 F 2 ), but A B (F 1 F 2 ) +. So F + = (F 1 F 2 ) + and thus the decomposition is still dependency preserving Dependency Preservation If f is a FD in F, but f is not in F 1 F 2, there are two possibilities: f (F 1 F 2 ) + If the constraints in F 1 and F 2 are maintained, f will be maintained automatically. f (F 1 F 2 ) + f can be checked only by first taking the join of r 1 and r 2. This is costly Normal Forms 47 Normal Forms 48 12
13 Desirable Qualities for Decompositions Decompositions should always satisfy the properties of lossless decomposition and dependency preservation: Lossless decomposition ensures that the information in the original relation can be accurately reconstructed based on the information represented in the decomposed relations. Dependency preservation ensures that the decomposed relations have the same capacity to represent the integrity constraints as the original relations and therefore to reveal illegal updates. Minimal Cover A minimal cover for a set of dependencies F is a set of dependencies U such that: U is equivalent to F (I.e., F + = U + ) All FDs in U have the form X A where A is a single attribute It is not possible to make U smaller (while preserving equivalence) by Deleting an FD Deleting an attribute from an FD (its LHS) FDs and attributes that can be deleted in this way are called redundant. Normal Forms 49 Normal Forms 50 Computing the Minimal Cover Example: F = {ABH CK, A D, C E, BGH L, L AD, E L, BH E} Step 1: Make RHS of each FD into a single attribute: Use decomposition rule for FDs. Example: L AD replaced by L A, L D ; ABH CK by ABH C, ABH K Step 2: Eliminate redundant attributes from LHS: If B is a single attribute and FD XB A F, X A is entailed by F, then B is unnecessary. e.g., Can an attribute be deleted from ABH C? Compute AB + F, AH+ F, BH+ F ; Since C (BH)+ F, BH C is entailed by F and A is redundant in ABH C. Computing the Minimal Cover (cont d) Step 3: Delete redundant FDs from F: If F {f} entails f, then f is redundant; if f is X A then check if A X + F- {f} e.g., BGH L is entailed by E L, BH E, so it is redundant Note: The order of steps 2, 3 can't be interchanged!! See textbook for a counterexample. F 1 = {ABH C, ABH K, A D, C E, BGH L, L A, L D, E L, BH E} F 2 = {BH C, BH K, A D, C E, BH L, L A, L D, E L, BH E} F 3 = {BH C, BH K, A D, C E, L A, E L} Normal Forms 51 Normal Forms 52 13
14 Synthesizing a 3NF Schema Starting with a schema R = (R, F): Step 1: Compute minimal cover U of F. The decomposition is based on U, but since U + = F + the same functional dependencies will hold. A minimal cover for F = {ABH CK, A D, C E, BGH L, L AD, E L, BH E} is U = {BH C, BH K, A D, C E, L A, E L} Synthesizing Step 2 Step 2: Partition U into sets U 1, U 2, U n such that the LHS of all elements of U i are the same: U 1 = {BH C, BH K}, U 2 = {A D}, U 3 = {C E}, U 4 = {L A}, U 5 = {E L} Normal Forms 53 Normal Forms 54 Synthesizing Step 3 Synthesizing Step 4 Step 3: For each U i form schema R i = (R i, U i ), where R i is the set of all attributes mentioned in U i Each FD of U will be in some R i. Hence the decomposition is dependency preserving: R 1 = (BHCK; BH C, BH K), R 2 = (AD; A D), R 3 = (CE; C E), R 4 = (AL; L A), R 5 = (EL; E L) Step 4: If no R i is a superkey of R, add schema R 0 = (R 0,{}) where R 0 is a key of R. R 0 = (BGH, {}); R 0 might be needed when not all attributes are contained in R 1 R 2 R n ; A missing attribute A must be part of all keys (since it s not in any FD of U, deriving a key constraint from U involves the augmentation axiom); R 0 might be needed even if all attributes are accounted for in R 1 R 2 R n Normal Forms 55 Normal Forms 56 14
15 Synthesizing Step 4 (cont'd) Example: (ABCD; {A B,C D}), with step 3 decomposition: R 1 = (AB; {A B}),R 2 = (CD; {C D}). Lossy! Need to add (AC; { }), for losslessness Step 4 guarantees lossless decomposition: ABCD --decomp--> AB,ACD --decomp-->ab,ac,cd Boyce Codd Normal Form (BCNF) A relation R(X) is in Boyce Codd Normal Form if for every non-trivial functional dependency Y Z defined on it, Y contains a key K of R(X). That is, Y is a superkey for R(X). Example: Person1(SI#, Name, Address) The only FD is SI# Name, Address Since SI# is a key, Person1 is in BCNF Anomalies and redundancies, as discussed earlier, do not occur in databases with relations in BCNF. Normal Forms 57 Normal Forms 58 Non-BCNF Examples A Relation not in BCNF Person(SI#, Name, Address, Hobby) The FD SI# Name, Address does not satisfy conditions for BCNF since the key is (SSN, Hobby) HasAccount(AcctNum, ClientId, OfficeId) The FD AcctNum OfficeId does not satisfy BCNF conditions if we assume that keys for HasAccount are (ClientId, OfficeId) and (AcctNum, ClientId); rather than AcctNum. Manager Project Branch Brown Mars Chicago Green Jupiter Birmingham Green Mars Birmingham Hoskins Saturn Birmingham Hoskins Venus Birmingham Assume the following dependencies: Manager Branch each manager works in a particular branch; Project,Branch Manager each project has several managers, and runs on several branches; however, a project has a unique manager for each branch. Normal Forms 59 Normal Forms 60 15
16 A Problematic Decomposition The relation is not in BCNF because the left hand side of the first dependency is not a superkey. At the same time, no decomposition of this relation will work: Project,Branch Manager involves all the attributes and thus no decomposition is possible. Sometimes BCNF cannot be achieved for a particular relation and set of functional dependencies without violating the principles of lossless decomposition and dependency preservation. Normal Forms 61 Normalization Drawbacks By limiting redundancy, normalization helps maintain consistency and saves space. But performance of querying can suffer because related information that was stored in a single relation is now distributed among several Example: A join is required to get the names and grades of all students taking CS343 in 2006F. Student(Id,Name) Transcript(StudId,CrsCode,Sem,Grade) SELECT S.Name, T.Grade FROM Student S, Transcript T WHERE S.Id = T.StudId AND T.CrsCode = CS343 AND T.Semester = 2006F Normal Forms 62 Denormalization Tradeoff: Judiciously introduce redundancy to improve performance of certain queries Example: Add attribute Name to Transcript Transcript' SELECT T.Name, T.Grade FROM Transcript T WHERE T.CrsCode = CS305 AND T.Semester = S2002 Join is avoided; If queries are asked more frequently than Transcript is modified, added redundancy might improve average performance; But, Transcript is no longer in BCNF since key is (StudId,CrsCode,Semester) and StudId Name. BCNF and 3NF The Project-Branch-Manager schema is not in BCNF, but it is in 3NF. In particular, the Project,Branch Manager dependency has as its left hand side a key, while Manager Branch has a unique attribute for the right hand side, which is part of the {Project,Branch} key. The 3NF is less restrictive than the BCNF and for this reason does not offer the same guarantees of quality for a relation; it has the advantage however, of always being achievable. Normal Forms 63 Normal Forms 64 16
17 !! 3NF Tolerates Some Redundancies! Manager Project Branch Brown Mars Chicago Green Jupiter Birmingham Green Mars Birmingham Hoskins Saturn Birmingham Hoskins Venus Birmingham A Revised Example Manager Project Branch Division Brown Mars Chicago 1 Green Jupiter Birmingham 1 Green Mars Birmingham 1 Hoskins Saturn Birmingham 2 Hoskins Venus Birmingham 2 Functional dependencies: Manager Branch,Division -- each manager works at one branch and manages one division; Branch,Division Manager -- for each branch and division there is a single manager; Project,Branch Division,Manager -- for each branch, a project is allocated to a single division and has a sole manager responsible. Normal Forms 65 Normal Forms 66 BCNF Normalization (Partial) Given: R = (R; F) where R = ABCDEGHK and F = {ABH C, A DE, BGH K, K ADH, BH GE} Step 1: Find a FD that violates BCNF Note ABH C, (ABH) + includes all attributes (BH is a key) A DE violates BCNF since A is not a superkey (A + = ADE) Step 2: Split R into: R 1 = (ADE; F 1 = {A DE }) Remove DE - A R 2 = (ABCGHK; F 1 = {ABH C, BGH K, K AH, BH G}) Note 1: R 1 is in BCNF Note 2: Decomposition is lossless since A is a key of R 1. Note 3: FDs K D and BH E are not in F 1 or F 2. But both can be derived from F 1 F 2 (E.g., K A and A D implies K D) Hence, decomposition is dependency preserving. BCNF Decomposition Algorithm Input: R = (R; F) Decomp := R while there is S = (S; F ) Decomp and S not in BCNF do Find X Y F that violates BCNF // X isn t a superkey in S Replace S in Decomp with S 1 = (XY; F 1 ), S 2 = (S - (Y - X); F 2 ) // F 1 = all FDs of F involving only attributes of XY // F 2 = all FDs of F involving only attributes of S - (Y - X) end return Decomp Normal Forms 67 Normal Forms 68 17
18 A Good Decomposition Database Design and Normalization Manager Branch Division Brown Chicago 1 Green Birmingham 1 Hoskins Birmingham 2 Project Branch Division Mars Chicago 1 Jupiter Birmingham 1 Mars Birmingham 1 Saturn Birmingham 2 Venus Birmingham 2 Note: The first relation has a second key {Branch,Division}. The decomposition is in 3NF but not in BCNF; moreover, it is lossless and dependencies are preserved. This example demonstrates that BCNF may be too strong a condition to impose on a relational schema. The theory of normalization can be used as a basis for quality control operations on schemas, during both conceptual and logical design. Analysis of the relations obtained during the logical design phase can identify places where the conceptual design was inaccurate: such a validation of the design is usually relatively easy. Normalization can also be used during conceptual design for quality control of each element of a conceptual schema (entity or relationship). Normal Forms 69 Normal Forms 70 Analysis of an Entity The functional dependency SupplierCode Supplier,Address holds here: all properties of a supplier are identified by its SupplierCode. The entity violates 3NF since this dependency has a left-hand-side that does not contain the identifier and a right-hand-side made up of attributes that are not part of the key. Decomposing Product Supplier is (or should be) an independent entity, with its own attributes (code, surname and address) If Product and Supplier are distinct entities, they should be linked through a relationship. Since there is a functional dependency from Code to SupplierCode, we are sure that each product has at most one supplier (maximum cardinality 1). Since there is no dependency from SupplierCode to Code, we have an unrestricted maximum cardinality (N) for Supplier in the relationship. Normal Forms 71 Normal Forms 72 18
19 Decomposing Product This decomposition satisfies fundamental properties: It is a lossless decomposition, because of one-to-many relationship that allows us to recostruct the values of the attributes of the original entity; Moreover, it preserves dependencies because each dependency is embedded in one of the entities or can be reconstructed from them. Analysis of a Relationship Now we show how to analyze n-ary relationships for n 3, in order to determine whether they should be decomposed. Consider Normal Forms 73 Normal Forms 74 Some Functional Dependencies Student DegreeProgramme (each student is enrolled in one degree programme) Student Professor (each student writes a thesis under the supervision of a single professor) Professor Department (each professor is associated with a single department and the students under her supervision are students in that department) The (unique) key of the relationship is Student (given a student, the degree programme, the professor and the department are identified uniquely) The third FD causes a violation of 3NF. Decomposing Thesis The following is a decomposition of Thesis where the two decomposed relationships are both in 3NF(also in BCNF) Normal Forms 75 Normal Forms 76 19
20 More Observations... The relationship Thesis is in 3NF, because its key is made up of the Student entity, and its dependencies all have this entity on the left hand side. However, not all students write theses, therefore not all students have supervisors. From a normal form point of view, this is not a problem. However, our conceptual schema should reflect the fact that being in a degree programme and having a supervisor are independent facts. Another Decomposition Normal Forms 77 Normal Forms 78 20
Limitations of E-R Designs. Relational Normalization Theory. Redundancy and Other Problems. Redundancy. Anomalies. Example
Limitations of E-R Designs Relational Normalization Theory Chapter 6 Provides a set of guidelines, does not result in a unique database schema Does not provide a way of evaluating alternative schemas Normalization
Database Management Systems. Redundancy and Other Problems. Redundancy
Database Management Systems Winter 2004 CMPUT 391: Database Design Theory or Relational Normalization Theory Dr. Osmar R. Zaïane Lecture 2 Limitations of Relational Database Designs Provides a set of guidelines,
Database Systems Concepts, Languages and Architectures
These slides are for use with Database Systems Concepts, Languages and Architectures Paolo Atzeni Stefano Ceri Stefano Paraboschi Riccardo Torlone To view these slides on-screen or with a projector use
Limitations of DB Design Processes
Normalization CS 317/387 1 Limitations of DB Design Processes Provides a set of guidelines, does not result in a unique database schema Does not provide a way of evaluating alternative schemas Pitfalls:
Relational Database Design
Relational Database Design To generate a set of relation schemas that allows - to store information without unnecessary redundancy - to retrieve desired information easily Approach - design schema in appropriate
Schema Design and Normal Forms Sid Name Level Rating Wage Hours
Entity-Relationship Diagram Schema Design and Sid Name Level Rating Wage Hours Database Management Systems, 2 nd Edition. R. Ramakrishnan and J. Gehrke 1 Database Management Systems, 2 nd Edition. R. Ramakrishnan
Lecture Notes on Database Normalization
Lecture Notes on Database Normalization Chengkai Li Department of Computer Science and Engineering The University of Texas at Arlington April 15, 2012 I decided to write this document, because many students
Schema Refinement and Normalization
Schema Refinement and Normalization Module 5, Lectures 3 and 4 Database Management Systems, R. Ramakrishnan 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational
Database Design and Normalization
Database Design and Normalization CPS352: Database Systems Simon Miner Gordon College Last Revised: 9/27/12 Agenda Check-in Functional Dependencies (continued) Design Project E-R Diagram Presentations
Database Design and Normal Forms
Database Design and Normal Forms Database Design coming up with a good schema is very important How do we characterize the goodness of a schema? If two or more alternative schemas are available how do
Schema Refinement, Functional Dependencies, Normalization
Schema Refinement, Functional Dependencies, Normalization MSCI 346: Database Systems Güneş Aluç, University of Waterloo Spring 2015 MSCI 346: Database Systems Chapter 19 1 / 42 Outline 1 Introduction Design
Functional Dependencies and 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
Databases -Normalization III. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 1 / 31
Databases -Normalization III (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 1 / 31 This lecture This lecture describes 3rd normal form. (N Spadaccini 2010 and W Liu 2012) Databases -
Functional Dependencies and Normalization
Functional Dependencies and Normalization 5DV119 Introduction to Database Management Umeå University Department of Computing Science Stephen J. Hegner [email protected] http://www.cs.umu.se/~hegner Functional
normalisation Goals: Suppose we have a db scheme: is it good? define precise notions of the qualities of a relational database scheme
Goals: Suppose we have a db scheme: is it good? Suppose we have a db scheme derived from an ER diagram: is it good? define precise notions of the qualities of a relational database scheme define algorithms
Chapter 8. Database Design II: Relational Normalization Theory
Chapter 8 Database Design II: Relational Normalization Theory The E-R approach is a good way to start dealing with the complexity of modeling a real-world enterprise. However, it is only a set of guidelines
Relational Database Design: FD s & BCNF
CS145 Lecture Notes #5 Relational Database Design: FD s & BCNF Motivation Automatic translation from E/R or ODL may not produce the best relational design possible Sometimes database designers like to
Chapter 10. Functional Dependencies and Normalization for Relational Databases
Chapter 10 Functional Dependencies and Normalization for Relational Databases Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant
Design of Relational Database Schemas
Design of Relational Database Schemas T. M. Murali October 27, November 1, 2010 Plan Till Thanksgiving What are the typical problems or anomalies in relational designs? Introduce the idea of decomposing
Theory of Relational Database Design and Normalization
Theory of Relational Database Design and Normalization (Based on Chapter 14 and some part of Chapter 15 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3) 1 Informal Design Guidelines for
Why Is This Important? Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) Example (Contd.)
Why Is This Important? Schema Refinement and Normal Forms Chapter 19 Many ways to model a given scenario in a database How do we find the best one? We will discuss objective criteria for evaluating database
COSC344 Database Theory and Applications. Lecture 9 Normalisation. COSC344 Lecture 9 1
COSC344 Database Theory and Applications Lecture 9 Normalisation COSC344 Lecture 9 1 Overview Last Lecture Functional Dependencies This Lecture Normalisation Introduction 1NF 2NF 3NF BCNF Source: Section
Database Design and Normalization
Database Design and Normalization Chapter 10 (Week 11) EE562 Slides and Modified Slides from Database Management Systems, R. Ramakrishnan 1 Computing Closure F + Example: List all FDs with: - a single
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
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Outline Informal Design Guidelines
Theory behind Normalization & DB Design. Satisfiability: Does an FD hold? Lecture 12
Theory behind Normalization & DB Design Lecture 12 Satisfiability: Does an FD hold? Satisfiability of FDs Given: FD X Y and relation R Output: Does R satisfy X Y? Algorithm: a.sort R on X b.do all the
Functional Dependency and Normalization for Relational Databases
Functional Dependency and Normalization for Relational Databases Introduction: Relational database design ultimately produces a set of relations. The implicit goals of the design activity are: information
Chapter 10. Functional Dependencies and Normalization for Relational Databases. Copyright 2007 Ramez Elmasri and Shamkant B.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Chapter Outline 1 Informal Design Guidelines for Relational Databases
Normalisation. Why normalise? To improve (simplify) database design in order to. Avoid update problems Avoid redundancy Simplify update operations
Normalisation Why normalise? To improve (simplify) database design in order to Avoid update problems Avoid redundancy Simplify update operations 1 Example ( the practical difference between a first normal
CS143 Notes: Normalization Theory
CS143 Notes: Normalization Theory Book Chapters (4th) Chapters 7.1-6, 7.8, 7.10 (5th) Chapters 7.1-6, 7.8 (6th) Chapters 8.1-6, 8.8 INTRODUCTION Main question How do we design good tables for a relational
CS 377 Database Systems. Database Design Theory and Normalization. Li Xiong Department of Mathematics and Computer Science Emory University
CS 377 Database Systems Database Design Theory and Normalization Li Xiong Department of Mathematics and Computer Science Emory University 1 Relational database design So far Conceptual database design
Normalization in Database Design
in Database Design Marek Rychly [email protected] Strathmore University, @ilabafrica & Brno University of Technology, Faculty of Information Technology Advanced Databases and Enterprise Systems 14
Relational Database Design Theory
Relational Database Design Theory Informal guidelines for good relational designs Functional dependencies Normal forms and normalization 1NF, 2NF, 3NF BCNF, 4NF, 5NF Inference rules on functional dependencies
Introduction to Database Systems. Normalization
Introduction to Database Systems Normalization Werner Nutt 1 Normalization 1. Anomalies 1. Anomalies 2. Boyce-Codd Normal Form 3. 3 rd Normal Form 2 Anomalies The goal of relational schema design is to
Chapter 10 Functional Dependencies and Normalization for Relational Databases
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright 2004 Pearson Education, Inc. Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of
6.830 Lecture 3 9.16.2015 PS1 Due Next Time (Tuesday!) Lab 1 Out today start early! Relational Model Continued, and Schema Design and Normalization
6.830 Lecture 3 9.16.2015 PS1 Due Next Time (Tuesday!) Lab 1 Out today start early! Relational Model Continued, and Schema Design and Normalization Animals(name,age,species,cageno,keptby,feedtime) Keeper(id,name)
Database Management System
UNIT -6 Database Design Informal Design Guidelines for Relation Schemas; Functional Dependencies; Normal Forms Based on Primary Keys; General Definitions of Second and Third Normal Forms; Boyce-Codd Normal
Chapter 5: FUNCTIONAL DEPENDENCIES AND NORMALIZATION FOR RELATIONAL DATABASES
1 Chapter 5: FUNCTIONAL DEPENDENCIES AND NORMALIZATION FOR RELATIONAL DATABASES INFORMAL DESIGN GUIDELINES FOR RELATION SCHEMAS We discuss four informal measures of quality for relation schema design in
Determination of the normalization level of database schemas through equivalence classes of attributes
Computer Science Journal of Moldova, vol.17, no.2(50), 2009 Determination of the normalization level of database schemas through equivalence classes of attributes Cotelea Vitalie Abstract In this paper,
Normalisation to 3NF. Database Systems Lecture 11 Natasha Alechina
Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third Normal Forms For more
Relational Normalization Theory (supplemental material)
Relational Normalization Theory (supplemental material) CSE 532, Theory of Database Systems Stony Brook University http://www.cs.stonybrook.edu/~cse532 2 Quiz 8 Consider a schema S with functional dependencies:
RELATIONAL DATABASE DESIGN
RELATIONAL DATABASE DESIGN g Good database design - Avoiding anomalies g Functional Dependencies g Normalization & Decomposition Using Functional Dependencies g 1NF - Atomic Domains and First Normal Form
How To Find Out What A Key Is In A Database Engine
Database design theory, Part I Functional dependencies Introduction As we saw in the last segment, designing a good database is a non trivial matter. The E/R model gives a useful rapid prototyping tool,
Functional Dependencies
BCNF and 3NF Functional Dependencies Functional dependencies: modeling constraints on attributes stud-id name address course-id session-id classroom instructor Functional dependencies should be obtained
CSCI-GA.2433-001 Database Systems Lecture 7: Schema Refinement and Normalization
CSCI-GA.2433-001 Database Systems Lecture 7: Schema Refinement and Normalization Mohamed Zahran (aka Z) [email protected] http://www.mzahran.com View 1 View 2 View 3 Conceptual Schema At that point we
Theory of Relational Database Design and Normalization
Theory of Relational Database Design and Normalization (Based on Chapter 14 and some part of Chapter 15 in Fundamentals of Database Systems by Elmasri and Navathe) 1 Informal Design Guidelines for Relational
Jordan University of Science & Technology Computer Science Department CS 728: Advanced Database Systems Midterm Exam First 2009/2010
Jordan University of Science & Technology Computer Science Department CS 728: Advanced Database Systems Midterm Exam First 2009/2010 Student Name: ID: Part 1: Multiple-Choice Questions (17 questions, 1
Database Constraints and Design
Database Constraints and Design We know that databases are often required to satisfy some integrity constraints. The most common ones are functional and inclusion dependencies. We ll study properties of
Introduction Decomposition Simple Synthesis Bernstein Synthesis and Beyond. 6. Normalization. Stéphane Bressan. January 28, 2015
6. Normalization Stéphane Bressan January 28, 2015 1 / 42 This lecture is based on material by Professor Ling Tok Wang. CS 4221: Database Design The Relational Model Ling Tok Wang National University of
DATABASE NORMALIZATION
DATABASE NORMALIZATION Normalization: process of efficiently organizing data in the DB. RELATIONS (attributes grouped together) Accurate representation of data, relationships and constraints. Goal: - Eliminate
An Algorithmic Approach to Database Normalization
An Algorithmic Approach to Database Normalization M. Demba College of Computer Science and Information Aljouf University, Kingdom of Saudi Arabia [email protected] ABSTRACT When an attempt is made to
Normalization of Database
Normalization of Database UNIT-4 Database Normalisation is a technique of organizing the data in the database. Normalization is a systematic approach of decomposing tables to eliminate data redundancy
Relational Normalization: Contents. Relational Database Design: Rationale. Relational Database Design. Motivation
Relational Normalization: Contents Motivation Functional Dependencies First Normal Form Second Normal Form Third Normal Form Boyce-Codd Normal Form Decomposition Algorithms Multivalued Dependencies and
Design Theory for Relational Databases: Functional Dependencies and Normalization
Design Theory for Relational Databases: Functional Dependencies and Normalization Juliana Freire Some slides adapted from L. Delcambre, R. Ramakrishnan, G. Lindstrom, J. Ullman and Silberschatz, Korth
SQL DDL. DBS Database Systems Designing Relational Databases. Inclusion Constraints. Key Constraints
DBS Database Systems Designing Relational Databases Peter Buneman 12 October 2010 SQL DDL In its simplest use, SQL s Data Definition Language (DDL) provides a name and a type for each column of a table.
Chapter 5: Logical Database Design and the Relational Model Part 2: Normalization. Introduction to Normalization. Normal Forms.
Chapter 5: Logical Database Design and the Relational Model Part 2: Normalization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden Robert C. Nickerson ISYS
Lecture 2 Normalization
MIT 533 ระบบฐานข อม ล 2 Lecture 2 Normalization Walailuk University Lecture 2: Normalization 1 Objectives The purpose of normalization The identification of various types of update anomalies The concept
Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 5: Normalization II; Database design case studies. September 26, 2005
Introduction to Databases, Fall 2005 IT University of Copenhagen Lecture 5: Normalization II; Database design case studies September 26, 2005 Lecturer: Rasmus Pagh Today s lecture Normalization II: 3rd
Normalization. CIS 331: Introduction to Database Systems
Normalization CIS 331: Introduction to Database Systems Normalization: Reminder Why do we need to normalize? To avoid redundancy (less storage space needed, and data is consistent) To avoid update/delete
Chapter 9: Normalization
Chapter 9: Normalization Part 1: A Simple Example Part 2: Another Example & The Formal Stuff A Problem: Keeping Track of Invoices (cont d) Suppose we have some invoices that we may or may not want to refer
Objectives of Database Design Functional Dependencies 1st Normal Form Decomposition Boyce-Codd Normal Form 3rd Normal Form Multivalue Dependencies
Objectives of Database Design Functional Dependencies 1st Normal Form Decomposition Boyce-Codd Normal Form 3rd Normal Form Multivalue Dependencies 4th Normal Form General view over the design process 1
Advanced Relational Database Design
APPENDIX B Advanced Relational Database Design In this appendix we cover advanced topics in relational database design. We first present the theory of multivalued dependencies, including a set of sound
Normalization of database model. Pazmany Peter Catholic University 2005 Zoltan Fodroczi
Normalization of database model Pazmany Peter Catholic University 2005 Zoltan Fodroczi Closure of an attribute set Given a set of attributes α define the closure of attribute set α under F (denoted as
Introduction to normalization. Introduction to normalization
Introduction to normalization Lecture 4 Instructor Anna Sidorova Agenda Presentation Review of relational models, in class exersise Introduction to normalization In-class exercises Discussion of HW2 1
LOGICAL DATABASE DESIGN
MODULE 8 LOGICAL DATABASE DESIGN OBJECTIVE QUESTIONS There are 4 alternative answers to each question. One of them is correct. Pick the correct answer. Do not guess. A key is given at the end of the module
A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ:
GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ: Review Quiz will contain very similar question as below. Some questions may even be repeated. The order of the questions are random and are not in order of
Graham Kemp (telephone 772 54 11, room 6475 EDIT) The examiner will visit the exam room at 15:00 and 17:00.
CHALMERS UNIVERSITY OF TECHNOLOGY Department of Computer Science and Engineering Examination in Databases, TDA357/DIT620 Tuesday 17 December 2013, 14:00-18:00 Examiner: Results: Exam review: Grades: Graham
Normalization in OODB Design
Normalization in OODB Design Byung S. Lee Graduate Programs in Software University of St. Thomas St. Paul, Minnesota [email protected] Abstract When we design an object-oriented database schema, we need
Normalization. Normalization. Normalization. Data Redundancy
Normalization Normalization o Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data, its relationships, and constraints.
Introduction to Database Systems. Chapter 4 Normal Forms in the Relational Model. Chapter 4 Normal Forms
Introduction to Database Systems Winter term 2013/2014 Melanie Herschel [email protected] Université Paris Sud, LRI 1 Chapter 4 Normal Forms in the Relational Model After completing this chapter,
DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF)
DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF) Tables that contain redundant data can suffer from update anomalies, which can introduce inconsistencies into a database. The rules associated
Normalisation in the Presence of Lists
1 Normalisation in the Presence of Lists Sven Hartmann, Sebastian Link Information Science Research Centre, Massey University, Palmerston North, New Zealand 1. Motivation & Revision of the RDM 2. The Brouwerian
C# Cname Ccity.. P1# Date1 Qnt1 P2# Date2 P9# Date9 1 Codd London.. 1 21.01 20 2 23.01 2 Martin Paris.. 1 26.10 25 3 Deen London.. 2 29.
4. Normalisation 4.1 Introduction Suppose we are now given the task of designing and creating a database. How do we produce a good design? What relations should we have in the database? What attributes
Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB
Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB Outline Database concepts Conceptual Design Logical Design Communicating with the RDBMS 2 Some concepts Database: an
Teaching Database Modeling and Design: Areas of Confusion and Helpful Hints
Journal of Information Technology Education Volume 6, 2007 Teaching Database Modeling and Design: Areas of Confusion and Helpful Hints George C. Philip, Ph. D. College of Business, The University of Wisconsin
Chapter 7: Relational Database Design
Chapter 7: Relational Database Design Pitfalls in Relational Database Design Decomposition Normalization Using Functional Dependencies Normalization Using Multivalued Dependencies Normalization Using Join
Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations
1 Topics for this week: 1. Good Design 2. Functional Dependencies 3. Normalization Readings for this week: 1. E&N, Ch. 10.1-10.6; 12.2 2. Quickstart, Ch. 3 3. Complete the tutorial at http://sqlcourse2.com/
Normalisation 1. Chapter 4.1 V4.0. Copyright @ Napier University
Normalisation 1 Chapter 4.1 V4.0 Copyright @ Napier University Normalisation Overview discuss entity integrity and referential integrity describe functional dependency normalise a relation to first formal
Conceptual Design Using the Entity-Relationship (ER) Model
Conceptual Design Using the Entity-Relationship (ER) Model Module 5, Lectures 1 and 2 Database Management Systems, R. Ramakrishnan 1 Overview of Database Design Conceptual design: (ER Model is used at
Normalization. Functional Dependence. Normalization. Normalization. GIS Applications. Spring 2011
Normalization Normalization Normalization is a foundation for relational database design Systematic approach to efficiently organize data in a database GIS Applications Spring 2011 Objectives Minimize
Normalization. CIS 3730 Designing and Managing Data. J.G. Zheng Fall 2010
Normalization CIS 3730 Designing and Managing Data J.G. Zheng Fall 2010 1 Overview What is normalization? What are the normal forms? How to normalize relations? 2 Two Basic Ways To Design Tables Bottom-up:
Part 6. Normalization
Part 6 Normalization Normal Form Overview Universe of All Data Relations (normalized / unnormalized 1st Normal Form 2nd Normal Form 3rd Normal Form Boyce-Codd Normal Form (BCNF) 4th Normal Form 5th Normal
Quiz 3: Database Systems I Instructor: Hassan Khosravi Spring 2012 CMPT 354
Quiz 3: Database Systems I Instructor: Hassan Khosravi Spring 2012 CMPT 354 1. [10] Show that each of the following are not valid rules about FD s by giving a small example relations that satisfy the given
3. Database Design. 3.1. Functional Dependency. 3.1.01. Introduction. 3.1.02. Value in design. 3.1.03. Initial state. 3.1.05. Aims
of 18 05/03/2007 07:37 3. Database Design This is the Database Design course theme. [Complete set of notes PDF 295Kb]. 3.1. Functional Dependency In this lecture we look at... [Section notes PDF 64Kb]
Normalization for Relational DBs
Chapter 7 Functional Dependencies & Normalization for Relational DBs Truong Quynh Chi [email protected] Spring- 2013 Top-Down Database Design Mini-world Requirements E1 R Relation schemas Conceptual
TYPICAL QUESTIONS & ANSWERS
TYPICAL QUESTIONS & ANSWERS PART -I OBJECTIVE TYPE QUESTIONS Each Question carries 2 marks. Choosethe correct or the best alternative in the following: Q.1 Which of the following relational algebra operations
Normal forms and normalization
Normal forms and normalization An example of normalization using normal forms We assume we have an enterprise that buys products from different supplying companies, and we would like to keep track of our
Announcements. SQL is hot! Facebook. Goal. Database Design Process. IT420: Database Management and Organization. Normalization (Chapter 3)
Announcements IT0: Database Management and Organization Normalization (Chapter 3) Department coin design contest deadline - February -week exam Monday, February 1 Lab SQL SQL Server: ALTER TABLE tname
MCQs~Databases~Relational Model and Normalization http://en.wikipedia.org/wiki/database_normalization
http://en.wikipedia.org/wiki/database_normalization Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy. Normalization usually involves
Database Sample Examination
Part 1: SQL Database Sample Examination (Spring 2007) Question 1: Draw a simple ER diagram that results in a primary key/foreign key constraint to be created between the tables: CREATE TABLE Salespersons
Boyce-Codd Normal Form
4NF Boyce-Codd Normal Form A relation schema R is in BCNF if for all functional dependencies in F + of the form α β at least one of the following holds α β is trivial (i.e., β α) α is a superkey for R
The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1
The Relational Model Ramakrishnan&Gehrke, Chapter 3 CS4320 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. Legacy systems in older models
A Web-Based Environment for Learning Normalization of Relational Database Schemata
A Web-Based Environment for Learning Normalization of Relational Database Schemata Nikolay Georgiev September 2008 Master s Thesis in Computing Science, 30 ECTS credits Supervisor at CS-UmU: Stephen J.
Unit 3.1. Normalisation 1 - V2.0 1. Normalisation 1. Dr Gordon Russell, Copyright @ Napier University
Normalisation 1 Unit 3.1 Normalisation 1 - V2.0 1 Normalisation Overview discuss entity integrity and referential integrity describe functional dependency normalise a relation to first formal form (1NF)
The Entity-Relationship Model
The Entity-Relationship Model Chapter 2 Slides modified by Rasmus Pagh for Database Systems, Fall 2006 IT University of Copenhagen Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Today
Lecture 6. SQL, Logical DB Design
Lecture 6 SQL, Logical DB Design Relational Query Languages A major strength of the relational model: supports simple, powerful querying of data. Queries can be written intuitively, and the DBMS is responsible
Answer Key. UNIVERSITY OF CALIFORNIA College of Engineering Department of EECS, Computer Science Division
Answer Key UNIVERSITY OF CALIFORNIA College of Engineering Department of EECS, Computer Science Division CS186 Fall 2003 Eben Haber Midterm Midterm Exam: Introduction to Database Systems This exam has
