Varias funciones de agregación en la consulta
La escuela ahora conoce los apellidos de los estudiantes que recibieron más de una calificación en los exámenes y la administración ha decidido calcular la nota promedio a partir de las múltiples calificaciones de estos estudiantes, y esa será su calificación final.
Tienes que hacer esto.
Aquí tienes una vista previa de la tabla student_grages con la que estamos trabajando:
Swipe to start coding
You should retrieve the last names of students with more than one exam grade and also calculate the average grade from all their grades. In the response, you should have 2 columns: the first one is the student_surname, and the second one is the average_grade. Use AVG() and COUNT() aggregate functions in this task.
Also, sort the result by the student_surname column in the ascending order.
Brief Instructions
- Retrieve the
student_surnamecolumn and the average of thegradecolumn using theAVGfunction. - Assign the alias
average_gradeto the second column. - Group the data by
student_surname. - Use the
HAVINGclause to filter the results based onCOUNT(grade) > 1. - Sort the results by
student_surname.
Solución
¡Gracias por tus comentarios!
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
How can I identify which students received more than one grade?
Can you show me how to calculate the average grade for these students?
What should I do if a student has only one grade?
Awesome!
Completion rate improved to 4
Varias funciones de agregación en la consulta
Desliza para mostrar el menú
La escuela ahora conoce los apellidos de los estudiantes que recibieron más de una calificación en los exámenes y la administración ha decidido calcular la nota promedio a partir de las múltiples calificaciones de estos estudiantes, y esa será su calificación final.
Tienes que hacer esto.
Aquí tienes una vista previa de la tabla student_grages con la que estamos trabajando:
Swipe to start coding
You should retrieve the last names of students with more than one exam grade and also calculate the average grade from all their grades. In the response, you should have 2 columns: the first one is the student_surname, and the second one is the average_grade. Use AVG() and COUNT() aggregate functions in this task.
Also, sort the result by the student_surname column in the ascending order.
Brief Instructions
- Retrieve the
student_surnamecolumn and the average of thegradecolumn using theAVGfunction. - Assign the alias
average_gradeto the second column. - Group the data by
student_surname. - Use the
HAVINGclause to filter the results based onCOUNT(grade) > 1. - Sort the results by
student_surname.
Solución
¡Gracias por tus comentarios!
single