CS FundamentalsVery hardGATE CS (PYQ pattern)

VW(id, v): (1,5), (2,15), (3,25) and the view BIG = SELECT id, v FROM VW WHERE v > 10. Two more rows (4,8) and (5,30) are then inserted directly into VW. How many rows does SELECT * FROM BIG return afterwards?

  1. A. 2
  2. B. 4
  3. C. 5
  4. D. 3

Correct answer: D. 3

A view is a stored query, not a copy: it is evaluated on the current VW rows, so BIG shows ids 2, 3 and 5 (values 15, 25, 30): 3 rows.

More DBMS and SQL questions

Exams that ask this topic