Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Average Student's Grade | Section
Intermediate SQL
セクション 1.  4
single

single

bookChallenge: Average Student's Grade

メニューを表示するにはスワイプしてください

You've done an excellent job and helped the construction company. They have started working on expanding the Yellow metro line.

They have recommended you, and the school has shown interest in you because they also have several tasks for you. But first, let's familiarize ourselves with the student_grades table they provide:

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:

123
SELECT class_letter, COUNT(DISTINCT student_surname) AS anumber_of_students FROM student_grades GROUP BY class_letter
copy
タスク

スワイプしてコーディングを開始

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_surname column and the average of the grade column using the AVG function.
  • Add the alias average_grade to the second column.
  • Group the data by student_surname.
  • Sort the results by student_surname in ascending order.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt