I think you're making things too hard for yourself.
select std_name, gpa
from student_p
where total_credits = max(totale_credits);
student_p has the "total_credits" field in it, so you don't even need to calculate the credit total yourself by searching through course_p.(which you'd need to use enrollment_p as well)
Hopefully the code above will help you with the second question. You should not have to state the same table name twice in a FROM clause.
Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51