CS FundamentalsModerateGATE CS · Product placement
R(A, B) = {(2, 1), (2, 2), (3, 3), (3, 4)} and S(B, C) = {(1, 5), (2, 5), (3, 5), (3, 6), (3, 7)}. How many tuples does σ_{R.B ≠ S.B}(R × S) have?
- A. 20
- B. 16
- C. 15
- D. 5
Correct answer: C. 15
R × S has 4 × 5 = 20 tuples; 5 of them have R.B = S.B (exactly the natural-join pairs), so 15 remain.
More DBMS and SQL questions
- Table Takes(sid, cid, marks) rows: (1, 'C1', 80), (1, 'C2', NULL), (2, 'C1', 65), (3, 'C2', 90), (3, 'C3', 75), (5, 'C1', 50). What does…
- Table Stu(sid, sname) rows: (1, 'Om'), (2, 'Pia'), (3, 'Raj'), (4, 'Sia'). Table Takes(sid, cid, marks) rows: (1, 'C1', 80), (1, 'C2'…
- Which set of relational algebra operators is a complete (minimal) basis from which the others can be expressed?
- A B-tree (not B+ tree) stores a record pointer with every key in every node. With 1024-byte blocks, 9-byte keys, 6-byte tree pointers and…
- Two transactions each read X = 100. T1 sets X = X − 30 and commits; then T2 sets X = X + 50 and commits. The final value is 150. Which…
- Classify the schedule R2(B), W1(A), W2(A), W3(A), R1(B), W1(B), R3(A), R3(B).