Working with functions

Choose the appropriate query to return the student obtaining the lowest marks for each class from the given choices.

Options
1.SELECT * 
FROM students s1, s2 
WHERE marks = min( s1.marks, s2.marks)
AND s1.class_id = s2.class_id );
2.SELECT * 
FROM students 
WHERE marks = min( SELECT marks 
FROM students 
GROUP BY marks);

3.SELECT * 
FROM students s1 
WHERE s1.marks < ANY( 
SELECT marks 
FROM students s2);

4.SELECT * 
FROM students 
s1 WHERE s1.marks = ( SELECT min( marks) 
FROM students s2 
WHERE s1.class_id = s2.class_id );

Related Posts

Close Bitnami banner
Bitnami