I have a database with the following tables:
student(sid, name,address)
course(cid,type,department)
takes(sid,cid,score)
The query which i need to solve is Find the students such that, for each course they take, their score on the course is higher than any other student who has taken that same course.
I know I have to take a self join in such cases but still confused how to solve such queries !