Group by and having functionality works

To do items button has been added to student home.
QUERY: select * from
    (select sID from enrollment
  natural join
course
  group by sID
  having sum(Credits) < 12) a
where a.sID = ?