Gate CS-2016-2 Question Paper With Solutions

Q. 62 Consider the following database table named water_schemes :

Gate CS-2016-2 Question Paper With Solutions

The number of tuples returned by the following SQL query is

with total(name, capacity) as
   select district_name, sum(capacity)
   from water_schemes
   group by district_name
with total_avg(capacity) as
   select avg(capacity)
   from total
select name
   from total, total_avg
   where total.capacity >= total_avg.capacity

 

(A) 1

(B) 2

(C) 3

(D) 4

Answer: (B)

Explanation:

Gate CS-2016-2 Question Paper With Solutions

Learn More:   Gate CS-2006 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here