SESSION NAME: Joins and Unions-1

QUESTION NAME: The Report.


TABLE DESCRIPTION:

You are given two tables: Students and Grades. Students
contains three columns ID, Name and Marks.



CODE:

SELECT IF(GRADES.GRADE>=8, STUDENTS.NAME, NULL),GRADES.GRADE, STUDENTS.MARKS
FROM GRADES, STUDENTS
WHERE STUDENTS.MARKS BETWEEN GRADES.MIN_MARK AND GRADES.MAX_MARK
ORDER BY GRADES.GRADE DESC, STUDENTS.NAME;