Select title, credits, courseid, avg(grade) as AVG_Grade
From Course join Exam on course.courseid= exam.cid
group by title, credits, courseid
having avg(grade) = (select min(avg(grade)) from exam);
This is my query to find the course with the worst GPA, I would like to do it with a nested query however this doesn't seem to work.