CS FundamentalsModerateGATE CS (PYQ pattern)
Entity sets A (6 entities) and B (9 entities) are linked by relationship R. Every A entity must take part in R (total participation) and each A takes part at most 2 times; each B entity takes part at most once (partial participation). What are the minimum and maximum possible numbers of tuples in R?
- A. 6 and 9
- B. 6 and 12
- C. 9 and 12
- D. 1 and 9
Correct answer: A. 6 and 9
Minimum: every A appears at least once and B allows each tuple a distinct B, so 6. Maximum: each B can appear at most once, so at most 9 tuples, which is reachable (e.g. 3 A entities with 2 tuples and 3 with 1). The A-side cap 6 x 2 = 12 is not binding.
More DBMS and SQL questions
- E1(id, d, s): (1,x,50), (2,x,70), (3,x,70), (4,y,40), (5,y,40), (6,z,90), (7,z,NULL), (8,w,NULL). How many rows does SELECT FROM E1 a…
- LG(g, t, v): (a,1,10), (a,2,15), (a,3,12), (b,1,7), (b,2,7), (b,3,20). What does SELECT SUM(d) FROM (SELECT v - COALESCE(LAG(v) OVER…
- DD(id, k, v): (1,1,a), (2,1,b), (3,2,c), (4,2,d), (5,2,e), (6,3,f), (7,NULL,g), (8,NULL,h). A cleanup runs DELETE FROM DD WHERE id NOT IN…
- TP(g, id, s): (a,1,90), (a,2,90), (a,3,80), (a,4,70), (b,5,60), (b,6,60), (b,7,60), (c,8,50). Let n1, n2, n3 be the numbers of rows with…
- SP(id, s): (1,10), (2,10), (3,10), (4,20), (5,20), (6,30), (7,NULL), (8,NULL). How many rows does SELECT FROM SP a JOIN SP b ON a.s = b.s…
- Table T(x) has 4 rows. How many rows does each of these return? (a) SELECT COUNT() FROM T HAVING COUNT() > 5; (b) SELECT COUNT() FROM T…