这是一个SQL编程题模板。本题目要求编写SQL语句,
查询Grade
表中课程“Dp010004”的学生学号和成绩,并按成绩降序排列,成绩相同按学号升序排列。
提示:请使用SELECT
语句作答。
表结构:
请在这里写定义表结构的SQL语句。例如:
Create table Grade(
CourseID char(8) ,
StudentID char(12) ,
Semester int not null,
SchoolYear int ,
Grade numeric(5,1),
primary key(CourseID,StudentID)
);
表样例
Grade
表:
输出样例:
select StudentID,a.Grade
from Grade as a
where CourseID = 'Dp010004'
order by a.grade desc,studentID asc