GATE | GATE-CS-2015 (Set 1) | Question 65

Consider the following relations:

Q45

SELECT S. Student_Name, sum(P.Marks)
     FROM Student S, Performance P
     WHERE S.Roll_No = P.Roll_No
     GROUP BY S.Student_Name 

The number of rows that will be returned by the SQL query is _________
(A) 0
(B) 1
(C) 2
(D) 3


Answer: (C)

Explanation: Below is result of given query. Note that there are only two student names and query prints sum(P.Marks) for every student.

  Student_Name     Marks
      Raj           310
     Rohit          140 


Quiz of this Question



My Personal Notes arrow_drop_up