假定数据库中有三张表,student,sc,course,分别存有学生ID,学生名字;学生ID,课程ID,课程成绩;课程课程名称,现在要求求得每个学生的平均分,并筛选平均分大于80的学生并排序,SQL代码如下: select student.Name,AVG(sc.grade) as Averagefrom student,sc,coursewhere student.ID = sc.ID and sc.CourseID = course.CourseIDgroup by student.name having AVG(sc.grade) >= 80order by Average desc;