Problem: Go Multi-Level
Your goal is to find out which students scored above 85 in any subject, and for which subjects.
Tables
Here are the students and grades tables:
The students table
ID | Name |
1 | Ali |
2 | Fatima |
3 | Omar |
The grades table
ID | Student ID | Subject | Score |
1 | 1 | Math | 87.5 |
2 | 1 | History | 80.0 |
3 | 2 | Math | 91.0 |
Hints:
Use an
INNER JOINto combine the two tables on student ID.Use
WHEREto filter scores over 85.Use
ORDER BYto sort the results nicely.
Problem: Go Multi-Level
Your goal is to find out which students scored above 85 in any subject, and for which subjects.
Tables
Here are the students and grades tables:
The students table
ID | Name |
1 | Ali |
2 | Fatima |
3 | Omar |
The grades table
ID | Student ID | Subject | Score |
1 | 1 | Math | 87.5 |
2 | 1 | History | 80.0 |
3 | 2 | Math | 91.0 |
Hints:
Use an
INNER JOINto combine the two tables on student ID.Use
WHEREto filter scores over 85.Use
ORDER BYto sort the results nicely.