I'm following an SQL course and I'm having troubles understanding an example given my our professor, there's usually a lot of mistakes in our sheets that we have to correct but here I think it might just come from my obvious ignorance of the subject.
So the database contains three tables organized like this:
Student (StudentNumber, Name, Year)
Course (Code, Name, Hours)
Results (StudentNumbber, Code, Grade)
We're asked to give the student numbers that follow the "M11104" coded course with one query to the database servor. Here is the solution given:
Select S. *
FROM Student S, Results R
WHERE Code = 'M1105'
AND S.StudentNumber = R.StudentNumber;
I just don't get how is this supposed to work, first of all the S
and R
are no real attributes to the database given, and the SELECT S.*
doesn't seem to mean anything there.