Kodewick
Start learning →
Basic←→0 / 70

Math stars

#042BasicJOINSELECT4 min

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
idnameclassagecity
1Amy1A12Leeds
2Ben1A13York
3Cara1B12NULL
4Dan1B14Leeds
5Eva1A12Hull
6Finn1C13NULL
7Gus1C12York
7 rows
scores
idstudent_idsubjectscore
11math92
21art78
32math65
42art88
53math74
64math55
74art90
85math81
95artNULL
107math99
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.