Desafio da Média das Notas dos Alunos
Você fez um trabalho excelente e ajudou a empresa de construção. Eles já começaram a trabalhar na expansão da linha de metrô Amarela.
Eles recomendaram você, e a escola demonstrou interesse no seu trabalho porque também têm várias tarefas para você. Mas primeiro, vamos nos familiarizar com a student_grades tabela que eles fornecem:
Como você pode ver, a escola tem um total de 100 alunos, informações sobre os quais são fornecidas na tabela a seguir. Há informações na coluna class_letter, que possui 3 opções: A, B ou C. O nome da matéria (subject_name), assim como a nota do aluno (grade), estão incluídos. A tabela é simples e contém notas de provas em várias matérias.
Vamos ver quantos alunos há em cada turma com a seguinte consulta:
The table contains grades for exams in various subjects.
The school has a total of 100 students, information about whom is provided in the given table. There is information in the class_letter column, which has 3 options: A, B, or C. The subject name(subject_name), as well as the student's grade(grade), are included.
Let's see how many students there are in each class with the following query:
123SELECT class_letter, COUNT(DISTINCT student_surname) AS anumber_of_students FROM student_grades GROUP BY class_letter
Swipe to start coding
Your task now is to calculate the average grade for all subjects for each student. Also, for the convenience of the teachers, you need to sort the students' last names in alphabetical order. Use aggregation with the AVG() function and give an alias average_grade to ensure successful testing.
Brief Instructions
- Retrieve the
student_surnamecolumn and the average of thegradecolumn using theAVGfunction. - Add the alias
average_gradeto the second column. - Group the data by
student_surname. - Sort the results by
student_surnamein ascending order.
Solução
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 4
Desafio da Média das Notas dos Alunos
Deslize para mostrar o menu
Você fez um trabalho excelente e ajudou a empresa de construção. Eles já começaram a trabalhar na expansão da linha de metrô Amarela.
Eles recomendaram você, e a escola demonstrou interesse no seu trabalho porque também têm várias tarefas para você. Mas primeiro, vamos nos familiarizar com a student_grades tabela que eles fornecem:
Como você pode ver, a escola tem um total de 100 alunos, informações sobre os quais são fornecidas na tabela a seguir. Há informações na coluna class_letter, que possui 3 opções: A, B ou C. O nome da matéria (subject_name), assim como a nota do aluno (grade), estão incluídos. A tabela é simples e contém notas de provas em várias matérias.
Vamos ver quantos alunos há em cada turma com a seguinte consulta:
The table contains grades for exams in various subjects.
The school has a total of 100 students, information about whom is provided in the given table. There is information in the class_letter column, which has 3 options: A, B, or C. The subject name(subject_name), as well as the student's grade(grade), are included.
Let's see how many students there are in each class with the following query:
123SELECT class_letter, COUNT(DISTINCT student_surname) AS anumber_of_students FROM student_grades GROUP BY class_letter
Swipe to start coding
Your task now is to calculate the average grade for all subjects for each student. Also, for the convenience of the teachers, you need to sort the students' last names in alphabetical order. Use aggregation with the AVG() function and give an alias average_grade to ensure successful testing.
Brief Instructions
- Retrieve the
student_surnamecolumn and the average of thegradecolumn using theAVGfunction. - Add the alias
average_gradeto the second column. - Group the data by
student_surname. - Sort the results by
student_surnamein ascending order.
Solução
Obrigado pelo seu feedback!
single