Open In App
Related Articles

UGC-NET | UGC NET CS 2015 Jun – III | Question 8

Improve Article
Improve
Save Article
Save
Like Article
Like

The STUDENT information in a university stored in the relation STUDENT (Name, SEX, Marks, DEPT_Name)
Consider the following SQL Query SELECT DEPT_Name from STUDENT where SEX = ‘M’ group by DEPT_Name having avg (Marks)>SELECT avg (Marks) from STUDENT. It Returns the Name of the Department for which:
(A) The Average marks of Male students is more than the average marks of students in the same Department
(B) The average marks of male students is more than the average marks of students in the University
(C) The average marks of male students is more than the average marks of male students in the University
(D) The average marks of students is more than the average marks of male students in the University


Answer: (B)

Explanation: The SQL query:
SELECT DEPT_Name from STUDENT where SEX = ‘M’ group by DEPT_Name having avg (Marks)>SELECT avg (Marks) from STUDENT.
will return The average marks of male students is more than the average marks of students in the University.
So, option (B) is correct.

Quiz of this Question

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 19 Jun, 2018
Like Article
Save Article
Previous
Next
Similar Reads