Course Content
Intermediate 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:
SELECT student_surname, AVG(grade) as average_grade FROM student_grades GROUP BY student_surname HAVING COUNT(grade) > 1
Here is a preview of the student_grades
table we are working with:
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.
Thanks for your feedback!
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:
SELECT student_surname, AVG(grade) as average_grade FROM student_grades GROUP BY student_surname HAVING COUNT(grade) > 1
Here is a preview of the student_grades
table we are working with:
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.
Thanks for your feedback!
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:
SELECT student_surname, AVG(grade) as average_grade FROM student_grades GROUP BY student_surname HAVING COUNT(grade) > 1
Here is a preview of the student_grades
table we are working with:
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.
Thanks for your feedback!
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:
SELECT student_surname, AVG(grade) as average_grade FROM student_grades GROUP BY student_surname HAVING COUNT(grade) > 1
Here is a preview of the student_grades
table we are working with:
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.