CS FundamentalsHardGATE CS · Product placement
Which statement about the expressive power of query languages is correct?
- A. Relational algebra, safe tuple calculus and safe domain calculus are equally expressive, while SQL with aggregation and recursion can express more
- B. Relational algebra can compute the transitive closure of any relation
- C. Domain calculus can express aggregates that algebra cannot
- D. Relational algebra is strictly more expressive than safe tuple calculus
Correct answer: A. Relational algebra, safe tuple calculus and safe domain calculus are equally expressive, while SQL with aggregation and recursion can express more
Codd's theorem makes RA and safe relational calculus equivalent ('relationally complete'). Transitive closure and aggregates are beyond them, which is why SQL adds GROUP BY and WITH RECURSIVE.
More DBMS and SQL questions
- R is decomposed into R1 and R2. Which condition guarantees the decomposition is lossless?
- Table T(x) has rows (1), (2), (3) and table U(y) has rows (2), (NULL). What do these two queries return? Q1: SELECT COUNT() FROM T WHERE x…
- Cust(cid, city) has rows (1, 'Pune'), (2, 'Delhi'), (3, NULL), (4, 'Pune'). Ord(oid, cid, amt) has rows (10, 1, 500), (11, 1, NULL), (12…
- Ord(oid, cid, amt) has rows (10, 1, 500), (11, 1, NULL), (12, 2, 300), (13, NULL, 200), (14, 5, 100). What does SELECT COUNT()…
- Player(pid, team, runs) has rows (1, 'A', 50), (2, 'A', 70), (3, 'A', 70), (4, 'B', 40), (5, 'B', NULL), (6, 'B', 90), (7, 'C', NULL). For…
- Pay(d, amt) has rows (1, 10), (2, 20), (2, 30), (3, 40). For the row (2, 20), what value does SUM(amt) OVER (ORDER BY d) give?