Зміст курсу
Розширений Рівень SQL
Розширений Рівень SQL
Складніші Фільтри
Раніше школа проводила змагання для учнів, які складали Математику, і деякі з них отримали нагороди. Тепер школа хоче переконатися, що не буде учнів, які обманюють та складають більше одного іспиту, включаючи іспит з математики.
Тому школа попросила нас визначити прізвища тих учнів, які склали більше одного іспиту, одним з яких був Mathematics
.
Ось запит з нашого попереднього завдання, який ви можете використати як приклад:
SELECT student_surname, AVG(grade) as average_grade FROM student_grades GROUP BY student_surname HAVING COUNT(grade) > 1
Swipe to begin your solution
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.
Brief Instructions
- Retrieve the
student_surname
column. - Use the
WHERE
clause to setsubject_name = 'Mathematics'
. - Group the results by
student_surname
. - Use the
HAVING
clause withCOUNT(grade) > 1
.
Рішення
Дякуємо за ваш відгук!
Складніші Фільтри
Раніше школа проводила змагання для учнів, які складали Математику, і деякі з них отримали нагороди. Тепер школа хоче переконатися, що не буде учнів, які обманюють та складають більше одного іспиту, включаючи іспит з математики.
Тому школа попросила нас визначити прізвища тих учнів, які склали більше одного іспиту, одним з яких був Mathematics
.
Ось запит з нашого попереднього завдання, який ви можете використати як приклад:
SELECT student_surname, AVG(grade) as average_grade FROM student_grades GROUP BY student_surname HAVING COUNT(grade) > 1
Swipe to begin your solution
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.
Brief Instructions
- Retrieve the
student_surname
column. - Use the
WHERE
clause to setsubject_name = 'Mathematics'
. - Group the results by
student_surname
. - Use the
HAVING
clause withCOUNT(grade) > 1
.
Рішення
Дякуємо за ваш відгук!