The math teacher wants to praise everyone who scored 90 or more in math. Join students with scores, keep the rows whose subject is 'math' and score is 90 or more, and pick the student's name and the score.
The tables
students
id
name
class
age
city
1
Amy
1A
12
Leeds
2
Ben
1A
13
York
3
Cara
1B
12
NULL
4
Dan
1B
14
Leeds
5
Eva
1A
12
Hull
6
Finn
1C
13
NULL
7
Gus
1C
12
York
7 rows
scores
id
student_id
subject
score
1
1
math
92
2
1
art
78
3
2
math
65
4
2
art
88
5
3
math
74
6
4
math
55
7
4
art
90
8
5
math
81
9
5
art
NULL
10
7
math
99
10 rows
students
id
name
class
age
city
1
Amy
1A
12
Leeds
2
Ben
1A
13
York
3
Cara
1B
12
NULL
4
Dan
1B
14
Leeds
5
Eva
1A
12
Hull
6
Finn
1C
13
NULL
7
Gus
1C
12
York
7 rows
scores
id
student_id
subject
score
1
1
math
92
2
1
art
78
3
2
math
65
4
2
art
88
5
3
math
74
6
4
math
55
7
4
art
90
8
5
math
81
9
5
art
NULL
10
7
math
99
10 rows
query.sql
SELECT students.name, scores.score
FROM students
JOIN scores ON scores.student_id = students.id
-- your code here: WHERE keeps the math ('math') rows with 90 or more
;
Ctrl + Enter runs too
Result
Run shows what your query gives. When it looks right, Submit.