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 JOIN to combine the two tables on student ID.

  • Use WHERE to filter scores over 85.

  • Use ORDER BY to 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 JOIN to combine the two tables on student ID.

  • Use WHERE to filter scores over 85.

  • Use ORDER BY to sort the results nicely.

MySQL
# Write your query