CS FundamentalsModerateGATE CS · DBMS
R(A, B) = {(1, 2), (1, 4), (2, 4), (4, 1), (4, 2)} and S(B, C) = {(1, 6), (3, 5), (3, 7), (4, 6), (4, 7)}. How many tuples are in π_A(R ⋈ S) and in R ⋈ S respectively (set semantics)?
- A. 5 and 5
- B. 3 and 25
- C. 3 and 5
- D. 3 and 6
Correct answer: C. 3 and 5
R ⋈ S pairs each R tuple with every S tuple having the same B: 5 tuples. Projecting on A removes duplicates, leaving {1, 2, 4}.
More DBMS and SQL questions
- Consider the schedule R1(A), W2(B), W3(B), R2(B), W1(A), R2(A), W1(B), W3(A). Which statement is correct?
- Σ = {C → B, B → F, F → E, CD → F, DE → B} on R(A, B, C, D, E, F). Exactly one FD in Σ is redundant (it can be derived from the others)…
- Table Staff(id, name, dept, pay, boss) rows: (1, 'Anu', 'Ops', 40, NULL), (2, 'Bala', 'Ops', 55, 1), (3, 'Chitra', 'Tech', 70, 1), (4…
- R has 2000 tuples in 100 blocks and S has 10000 tuples in 400 blocks. With only enough memory for one block of each relation, how many…
- Table Staff(id, name, dept, pay, boss) rows: (1, 'Anu', 'Ops', 40, NULL), (2, 'Bala', 'Ops', 55, 1), (3, 'Chitra', 'Tech', 70, 1), (4…
- Table Sale(id, rep, region, amt) rows: (1, 'Ira', 'N', 100), (2, 'Jai', 'S', 250), (3, 'Ira', 'S', NULL), (4, 'Kim', 'N', 300), (5, 'Jai'…