CS FundamentalsHardGATE CS (PYQ pattern)
A relation R(A, B, C) holds the tuples (1,x,10), (1,x,20), (1,y,10), (1,y,20), (2,x,10), (2,y,20). Which statement is correct?
- A. The MVD A →→ B holds, because A = 1 shows the full cross product of B and C values
- B. The MVD A →→ B holds because every A value has at least two B values
- C. The functional dependency A → B holds because the same A value always appears with the same B set
- D. The MVD A →→ B fails, because for A = 2 the tuple (2, x, 20) required by the swap rule is missing
Correct answer: D. The MVD A →→ B fails, because for A = 2 the tuple (2, x, 20) required by the swap rule is missing
For A = 2 the tuples (2,x,10) and (2,y,20) require (2,x,20) and (2,y,10) by the MVD swap rule; they are absent, so A →→ B fails even though A = 1 is a perfect cross product.
More DBMS and SQL questions
- R(A, B, C, D, E) has FDs A → B, C → D, BD → E. How many of the following decompositions are lossless-join? (1) (AB) , (CD) , (ACE) (2)…
- S1(s): a, b, c, d. C1(c): x, y. T1(s, c): (a,x), (a,y), (b,x), (c,y), (c,x), (c,y). How many rows does SELECT s FROM S1 WHERE NOT EXISTS…
- Tables T(x): 1, 2, 3 and U(y) is EMPTY. In standard SQL, what does SELECT COUNT() FROM T WHERE x > ALL (SELECT y FROM U) return, and what…
- Table V(id, v): (1,40), (2,10), (3,40), (4,30), (5,20), (6,30). What are the ids returned, in order, by SELECT id FROM V ORDER BY v DESC…
- P1(id, name, dept): (1,a,10), (2,b,20), (3,c,10). P2(id, name, city): (1,a,X), (2,z,Y), (4,d,Z). How many rows does SELECT FROM P1 NATURAL…
- DP(d): 1, 2, 3. EP(e, d): (1,1), (2,1), (3,1), (4,3). For SELECT DP.d, COUNT() AS a, COUNT(EP.e) AS b FROM DP LEFT JOIN EP ON DP.d = EP.d…