Query on sql query


#1

What is the output of following SQL query?
Select * from student S where not exists (select * from course C where C.ID= S.ID and C.GRADE > 40)
(a) Displays all students who never got a grade above 4.0
(b) Displays all students who never got a grade less than equal to 40
© Displays all students who got a grade above 4.0
(d) Displays all students who got a grade less than 4.0


#2

The answer is A since the inner query generates the courses of a student in which he / she got above 40. Now the not exists can be true only when it is empty. So answer must be A. Correct me if I am wrong.

P.S. Please notify that wether my answers are correct or wrong in previous posts and in future posts I am sometime thinking wether I gave a correct answer or not


#3

HERE ANSWER IS A)
We use select statement * denotes we take all things of the table and then from the student, student represents table name. Then it makes a condition not exist .then inside the brackets it makes another select statement from the course where C.ID is equal to S.Id and grade is above 4.0