SQL & Queries

Answer & solution
Official answer: 2
The equality join associates each course result with the appropriate student record, producing six joined rows. GROUP BY uses the name column, not the unique roll number, so the two Raj students become one aggregate group. The result contains (Raj,310) and (Rohit,140). Counting students gives three and counting course records gives six, but neither is the number of distinct grouping keys.
Solution: The join matches each performance row to its student by Roll_No, but grouping is by Student_Name alone. Roll numbers 1 and 3 both have name Raj and collapse into one group with total 80+70+80+80=310. Rohit forms the other group with 75+65=140. Hence2 result rows.