1.Given the schema R= ( Name, ZipCode, AverageIncome) , where the AverageIncome represents the average income of the people living in the area of ZipCode. Assume the following dependencies:
Name is a key, i.e. Name→ ZipCode, AverageIncome
ZipCode→ AverageIncome
i. Determine whether the decomposition of R into R1= ( Name, ZipCode) and R2=( ZipCode, AverageIncome) is lossless-join decomposition or not. Show your work.
ii. Determine whether the decomposition of R into R1= ( Name, AverageIncome) and R2=( ZipCode, AverageIncome) is lossless-join decomposition or not. Show your work.
Let for simplicity Name = N, ZipCode = Z , AverageIncome = A
So,relation R(N,Z,A)
Functional dependency:-
N->ZA
Z->A
Condition for decomposition to be lossless:-
If a relation R is deconposed into R1 and R2 then When R1 joins R2 it must result in R.To make sure that this happen there must be atleast one attribute in common between R1 and R2 and then that attribute(or set of attributes) must be a key in atleast one relation.
1).R1(N,Z) , R2(Z,A)
R1(N,Z)
N->Z
Here, N is key
R2(Z,A)
Z->A
Here,Z is key
The attribute common between R1 and R2 is 'Z' and 'Z' is key in R2.so,when R1 joins R2 the result will be definitely R.
So,This decomposition is lossless-join decomposition.
2).R1(N,A), R2(Z,A)
R1(N,A)
N->A
Here, N is key.
R2(Z,A)
Z->A
Here, Z is key.
The attribute common in R1 and R2 is 'A' but 'A' is not key in any of relation.so,when we R1 joins R2 the result is not exactly R because there will be some spurious tuples.
So,This decomposition is not lossless-join decomposition
1.Given the schema R= ( Name, ZipCode, AverageIncome) , where the AverageIncome represents the average income...
Consider a relational schema R(A, B, C, D) with a set of functional dependencies F = { D --> AB, C --> B, CD --> A, AD --> B, B --> A } a. Compute { B, C }+ b. Show that { C, D } is a candidate key of R. c. Is { R1(A, B, C), R2(C, D ) } a lossless-join decomposition? Why? d. Compute a minimal cover Fmin of F.
Given the following Schema S = (R, FD) where R = (A, B, C, D, E, F) and FD contains the following dependencies: A -> BC B ->C C -> D D ->E C -> E E -> F DE -> F C -> F 1. Find a minimal cover of F 2. Find a key for the schema 3. Find a 3N decomposition of the schema that satisfies the lossless join decomposition and dependency preservation properties 4. Find a...
Suppose that you decompose a schema R (A, B, C, D, E) into two schemas as below: R1 (A, B, C) R2 (C, D, E) Show that this decomposition is not a lossless join decomposition. Hint: Take a suitable Relation, r, for the Schema R and show that r is a lossy join decomposition.
Consider the relation schema R(T, E, C, D, Y) and the following set of F of functional dependencies: CY à E E à Y DY à T CT à D The relation R decomposes into R1(C, Y, E), R2(C, T, D). 1. Is this decomposition lossless-join? _________________Blank 1 True False 2. Is this decomposition dependency preserving? ? _____________Blank 2 True False
Please apply the Lossless Join Testing algorithm to see if the decomposition D is a lossless join decomposition. Please provide testing details step by step when you apply the set of functional dependency for testing. Given 1. The universal relation schema Q(CTHRSG), where C = course, T = teacher, H = hour, R = room, S= student, and G = grade. 2. The minimal set of functional dependencies F are assumed: C -> T each course has one...
Given the schema S= < { A,B,C,D,E,G,H }, F>, where F represents the following dependencies: AB→D A→D E→B E→C G→C E→A EB→GH H → A Find a minimal cover for this schema. Find a key for this schema. Find a third normal form decomposition for this schema. Find a BCN form decomposition for this schema.
can you answer part e of the question
Q.31 Answer the following questions (a) Explain difference between lossy decomposition and lossless decomposition (b) If you write a SQL statement to inner join the following two tables based on Plocation value as inner join condition, is the result table lossy or lossless? (Explain why?) EMP LOCS P.K EMP PROJ1 Hours Pname Plocation Р.К. (c) Given a relation schema R ={SSN, Ename, Pnumber, Pname, Plocation, Hours) R is decomposed to R1, R2,...
Help ASAP! 1. (10 pts) Given a relation schema R = (A, B, C, D, G, H) and a set of functional dependencies F = {D -> G, CD -> G, D -> C, H -> G} Find FC, a canonical cover of F. Please show all the steps to get your answer. 2. (30 pts) A Hollywood movie studio uses a relation called Movie to keep track of information about movie stars, what fee a star charges for...
Answer the following questions: Consider the relation schema R = (N. Y, P. M. and assume that the following set of functional dependencies holds on R: The letters can be interpreted as follows: R=(Model_Number. Year, Price, Manufacturing Plant Color). 1. [25 points] Give a lossless.join decomposition of Rinto Boyce-Codd normal form. Make sure to use the algorithm studied in class (Figure 7.11, page 331 of the book) and to show all details. 2. [25 points] Does your decomposition preserve functional dependencies? Justify your...
Consider the relation concerning refrigerators Ref (Model#, Year, Price, Manuf_Plant, Color) and the following set of functional dependencies: Model# → Manuf_Plant Model#, Year → Price Manuf_Plant → Color (i) Evaluate each of the following as a candidate key for Ref, giving reasons why it can or cannot be a candidate key: {Model#}, {Model#, Year}, {Model#, Color}. (ii) Based on the result of (i) above, determine whether the relation Ref is in 3NF and in BCNF. You should justify your answers....