Answer: The GROUP BY Clause and the AVG Function
Find a detailed explanation of how to use the GROUP BY clause to group the records in SQL query.
Solution
The solution is given below:
Explanation
The explanation of the solution code is given below:
Line 2: The
SELECTquery finds the average of students’ marks for each subject using theAVG()function.Line 3: The
FROMclause specifies the table,StudentGrades.Line 4: In the
GROUP BYclause, we specify theSubjectcolumn to group the data by subject. ...