Result of a query in SQL
I see the point you are making: if there is more than 1 student with the same name, enrolled in course 107, with a percentage greater than 90%, then your query will not distinguish between them.

Given the limited amount we know about the dataset, the solution provided does do the job, but I would have added the caveat about duplicate student names, or proposed an alternative solution:

SELECT S.name,
       count(*)
FROM   Students as S,
       Registration as R 
WHERE  R.rollno=s.rollno 
  AND  R.courseno=107 
  AND  R.percent&gt;90
GROUP  BY S.name


and in this way, we list distinct names, but are aware when there are multiple records selected for the same name.