Briefly answer the following questions
A functional dependence is some column which can always be determined by another group of one or more columns.
Because they're the dependence from something to itself, and exists for all attributes making them trivial.
R(A,B,C,D) with Primary Key AB under Which R is in 1NF but not in 2NFA, B C, DR(A,B,C,D) with Primary Key AB under Which R is in 2NF but not in 3NFA, B C, DC DR(A,B,C), Which Has the FD B C. if A is A Candidate Key for R, is it Possible for R to Be in BCNF? if So, under what Conditions? if Not, Explain why notIt's possible only if B is a candidate key of R.
R(A,B,C) Representing a Relationship between Two Entity Sets with Keys A and B, Respectively, and Suppose that R Has (among others) the FDs A B and B A. Explain what such a Pair of Dependencies means (i.e., what They Imply about the Relationship that the relation models)It means that the relationship is 1 to 1 as every A is associated with only one B and vice-versa.
Consider a relation R with five attributes ABCDE. You are given the following dependencies: A B, B,C E, and E,D A.
RA, C, DB, C, DC, D, ER in 3NF?Yes it is.
R in BCNF?No it's not as A B violates it as A is not by itself a candidate key.
Consider the relation shown below
| X | Y | Z |
|---|---|---|
| x1 | y1 | z1 |
| x1 | y1 | z2 |
| x2 | y1 | z1 |
| x2 | y1 | z3 |
X YX, Z YX, Y, Z X, Y, ZX YX, Z YX, Y, Z X, Y, ZAssume that you are given a relation with attributes ABCD.
NULL Values. Write an SQL Query that Checks whether the Functional Dependency A B HoldsSELECT * FROM ABCD AS i1
WHERE EXISTS (
SELECT * FROM ABCD AS i2
WHERE i2.a = i1.a
AND i1.b != i2.b
);
NULL Values. Write an SQL Assertion that Enforces the Functional Dependency A BCREATE ASSERTION enforce_A_determines_B
CHECK (
NOT EXISTS (
SELECT * FROM ABCD AS i1
WHERE EXISTS (
SELECT * FROM ABCD AS i2
WHERE i2.A = i1.A
AND i1.B != i2.B
)
)
);
Consider the following collection of relations and dependencies. Assume that each relation is obtained through decomposition from a relation with attributes ABCDEFGHI and that all the known dependencies over relation ABCDEFGHI are listed for each question. (The questions are independent of each other, obviously, since the given dependencies over ABCDEFGHI are different.)
For each (sub)relation:
R1(A,C,B,D,E), A B, C D1NF
R2(A, C, E)R3(A, B)R4(C, D)R2(A,B,F), AC E, B F1NF
R2(A, B)R3(B, F)R3(A,D), D G, G HBCNF
Already in BCNF
R4(D,C,H,G), A I, I ABCNF
Already in BCNF
R5(A,I,C,E)BCNF
Already in BCNF
Suppose that we have the following three tuples in a legal instance of a relation schema S with three attributes ABC (listed in order): (1,2,3), (4,2,3), and (5,3,3).
S?A BB, C AB CA BB CA CSuppose you are given a relation R with four attributes ABCD. For each of the following sets of FDs, assuming those are the only dependencies that hold for R, do the following:
R.R satisfies (1NF, 2NF, 3NF, or BCNF).R is not in BCNF, decompose it into a set of BCNF relations that preserve the dependencies.C D, C A, B RBR Satisfies (1NF, 2NF, 3NF, or BCNF)2NF
R is not in BCNF, Decompose it into a Set of BCNF Relations that Preserve the dependencies.`R1(B, C)R2(C, A, D)B C, D ARB, DR Satisfies (1NF, 2NF, 3NF, or BCNF)1NF
R is not in BCNF, Decompose it into a Set of BCNF Relations that Preserve the dependencies.`R1(B, D)R2(B, C)R3(D, AA, B, C D, D ARA, B, CD, B, CR Satisfies (1NF, 2NF, 3NF, or BCNF)3NF
R is not in BCNF, Decompose it into a Set of BCNF Relations that Preserve the DependenciesR2(D, A)A B, B,C D, A CRAR Satisfies (1NF, 2NF, 3NF, or BCNF)2NF
R is not in BCNF, Decompose it into a Set of BCNF Relations that Preserve the dependencies.`R1(A, B, C)R2(B, C, D)A, B C, A, B D, C A, D BRA, BA, DB, CC, DR Satisfies (1NF, 2NF, 3NF, or BCNF)3NF
R is not in BCNF, Decompose it into a Set of BCNF Relations that Preserve the DependenciesThere is no way to decompose it into BCNF without losing a FD.
Consider a relation R with five attributes ABCDE. With the following instances:
{ } (i.e., empty relation){(a,2,3,4,5), (2,a,3,5,5)}{(a,2,3,4,5), (2,a,3,5,5), (a,2,3,4,6)}{(a,2,3,4,5), (2,a,3,4,5), (a,2,3,6,5)}{(a,2,3,4,5), (2,a,3,7,5), (a,2,3,4,6)}{(a,2,3,4,5), (2,a,3,4,5), (a,2,3,6,5), (a,2,3,6,6)}{(a,2,3,4,5), (a,2,3,6,5), (a,2,3,6,6), (a,2,3,4,6)}BC EA BWe can't say anything project just the name of this relation as.