Problem: Connect Two Tables

List each student’s math grade, or show NULL if missing.

Sample data

The students table

id

name

1

Alice

2

Ford

3

Omar

The grades table

student_id

subject

score

1

Math

87.5

1

History

80.0

2

Math

91.0

Problem: Connect Two Tables

List each student’s math grade, or show NULL if missing.

Sample data

The students table

id

name

1

Alice

2

Ford

3

Omar

The grades table

student_id

subject

score

1

Math

87.5

1

History

80.0

2

Math

91.0

MySQL
# Write your query: