Home > Back-end >  How do you write these SQL statements.
How do you write these SQL statements.

Time:11-04


Student: table s student id name class number
Class table c: class # class class teacher
Curriculum k: class, class teacher
Result table g: class student id number grades
1) statistics each student's score, according to the results sorted in reverse chronological order
2) statistics for each class, each course grade average, according to the class, the result in reverse order
3) if students have duplicate data table, writing an article or group SQL delete duplicate data

CodePudding user response:

1) SELECT s. name, SUM (g. grades) FROM A g INNER JOIN s ON g. student id=a. student id GROUP BY s. name ORDER BY DESC A
  • Related