CS FundamentalsHardGATE CS (PYQ pattern)
The tuple calculus expression { t | ¬ Student(t) } over a database with a Student relation: is it safe, and why?
- A. Safe: it returns the complement within the database's active domain by definition
- B. Safe: negation is always finite in relational databases
- C. Not safe: tuple variables cannot be negated at all
- D. Not safe: it describes all tuples not in Student, an infinite set
Correct answer: D. Not safe: it describes all tuples not in Student, an infinite set
Safety requires the result to be finite and derived from the database. The set of all tuples that are not Student tuples is infinite, so the expression is unsafe (it must be restricted, e.g. t ∈ Employee ∧ ¬ Student(t)).
More DBMS and SQL questions
- 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…
- Under the deferred database modification scheme with a log, a crash occurs. The log holds <T1 start>, <T1,A,5>, <T1 commit>, <T2 start>…
- Under strict 2PL, T1 and T2 both hold S(A) and each now requests X(A) (a lock upgrade). T3 holds S(B) and requests X(A). T4 holds X(C) and…