More Complex Filtering
Previously, the school held a competition for students who took Mathematics, and some of them were rewarded. Now, the school wants to ensure that there are no students who cheat and take more than one exam, including the math exam.
Therefore, the school has asked us to retrieve the last names of those students who took more than one exam, one of which was Mathematics
.
Here is the query from our previous assignment that you can use as an example:
Here is a preview of the student_grades
table we are working with:
id | student_surname | class_letter | subject_name | grade |
---|---|---|---|---|
1 | Smith | A | Mathematics | 85 |
2 | Johnson | B | Physics | 90 |
3 | Williams | C | Chemistry | 78 |
4 | Brown | A | Biology | 92 |
... | ... | ... | ... | ... |
100 | Gonzales | A | Biology | 89 |
Task
Retrieve the last names of those students who received more than one grade
and one of the subjects they took was Mathematics
.
Note
Retrieve only the
surname
of these students. The answer should have only one column.
Everything was clear?
Course Content
Intermediate SQL
4. DDL and DML in SQL
Intermediate SQL
More Complex Filtering
Previously, the school held a competition for students who took Mathematics, and some of them were rewarded. Now, the school wants to ensure that there are no students who cheat and take more than one exam, including the math exam.
Therefore, the school has asked us to retrieve the last names of those students who took more than one exam, one of which was Mathematics
.
Here is the query from our previous assignment that you can use as an example:
Here is a preview of the student_grades
table we are working with:
id | student_surname | class_letter | subject_name | grade |
---|---|---|---|---|
1 | Smith | A | Mathematics | 85 |
2 | Johnson | B | Physics | 90 |
3 | Williams | C | Chemistry | 78 |
4 | Brown | A | Biology | 92 |
... | ... | ... | ... | ... |
100 | Gonzales | A | Biology | 89 |
Task
Retrieve the last names of those students who received more than one grade
and one of the subjects they took was Mathematics
.
Note
Retrieve only the
surname
of these students. The answer should have only one column.
Everything was clear?