...
Database-Management-System
October 4, 2023
Database-Management-System
October 4, 2023
Database-Management-System
October 4, 2023
Database-Management-System
October 4, 2023

SQL

Question 7

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

The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and Subject_code together from 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 _____.

A
0
B
9
C
7
D
5
Question 7 Explanation: 
(Executed under Oracle Express Edition)

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

Correct Answer: D
Question 7 Explanation: 
(Executed under Oracle Express Edition)

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

Leave a Reply

Your email address will not be published. Required fields are marked *