Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2019
Questions

Q51

NAT2 marksDatabases

A relational database contains two tables Student and Performance as shown below:

Roll_noStudent_name1Amit2Priya3Vinit4Rohan5SmitaTable: studentRoll_noSubject_codeMarks1A861B951C902A892C923C80Table: Performance\overset{\text{Table: student}}{\begin{array}{|l|l|} \hline \text{Roll\_no} & \text{Student\_name}\\\hline 1 & \text{Amit} \\\hline 2 & \text{Priya} \\\hline 3 & \text{Vinit} \\\hline 4 & \text{Rohan} \\\hline 5 & \text{Smita} \\\hline \end{array}} \qquad\overset{\text{Table: Performance}}{\begin{array}{|l|l|l|} \hline \text{Roll\_no} & \text{Subject\_code} & \text{Marks}\\\hline 1 & \text{A} & 86 \\\hline 1 & \text{B} & 95 \\\hline 1 & \text{C} & 90 \\\hline 2 & \text{A} & 89 \\\hline 2 & \text{C} & 92 \\\hline 3 & \text{C} & 80 \\\hline \end{array}}

The primary key of the Student table is Roll_no. For the performance table, the columns Roll_no. and Subject_code together form the primary key. Consider the SQL query given below:

SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE P.Marks >84
GROUP BY S.Student_name;

The number of rows returned by the above SQL query is ________

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.