Multiple choice

The STUDENT_GRADES table has the following columns: STUDENT_ID NUMBER (12) SEMESTER_END DATE GPA NUMBER (4, 3) Which of the following statements finds the highest Grade Point Average (GPA) per semester?

  1. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL;

  2. SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL;

  3. SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end;

  4. SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades;

  5. SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL;

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The GROUP BY clause organizes rows into groups based on semester_end, then MAX(gpa) finds the highest GPA within each group. The WHERE clause filters NULL values before grouping occurs. Options A and B are incorrect because they lack GROUP BY. Option D has incorrect syntax with WHERE after GROUP BY. Option E places WHERE after GROUP BY, which is invalid syntax - WHERE must precede GROUP BY.