CS FundamentalsHardGATE CS (PYQ pattern)
Relations R and S have 40 and 60 tuples (union-compatible). What are the minimum and maximum cardinalities of R ∪ S, R ∩ S and R − S (in that order of listing: min–max for each)?
- A. 40–100; 0–40; 0–40
- B. 60–100; 0–40; 0–40
- C. 60–100; 0–60; 0–40
- D. 60–100; 0–40; 0–60
Correct answer: B. 60–100; 0–40; 0–40
R ∪ S ranges from 60 (R ⊆ S) to 100 (disjoint). R ∩ S ranges from 0 to 40 (bounded by the smaller relation). R − S ranges from 0 (R ⊆ S) to 40 (disjoint).
More DBMS and SQL questions
- R(A, B) has 1000 tuples; S(B, C) has 500 tuples with B a key of S; T(C, D) has 200 tuples with C a key of T, and S.C is a NOT NULL foreign…
- The tuple calculus expression { t | ¬ Student(t) } over a database with a Student relation: is it safe, and why?
- A table is stored sorted on key K in 5000 pages (100 records each). Searching for one key with binary search over pages costs ceil(log2…
- A secondary dense index on a non-key attribute of a file with 1,000,000 records uses 4096-byte pages, 12-byte key + 8-byte pointer entries…
- A table of 1,000,000 rows (100 rows per page, 10,000 pages) is clustered on A, with a B+ tree whose leaves hold 200 entries each; reaching…
- Sort-merge join of R (200 pages) and S (100 pages) with 15 buffer pages: each relation is fully sorted by external merge sort (pass 0…