【MySQL】查询学⽣成绩,并作详细分级:
【MySQL】查询学⽣成绩,并作详细分级:
ca...end语句做嵌套
#创建学⽣成绩
#创建学⽣成绩
createdatabatest;
utest;
createtablecour
(
Student_idchar(12)notnullcomment"学号",
Cour_idchar(4)notnullcomment"课程号",
scoreintdefault0comment"成绩"
);
inrtintocourvalues
("2","1001",65),
("2","1001",76),
("2","1001",87),
("2","1001",69),
("2","1001",96),
("2","1001",82),
("2","1001",72),
("2","1001",64);
lect
Student_idas学号,
Cour_idas课程编号,
(cawhenscore>=90then"优秀"
el
(cawhenscore>=80then"良好"
el
(cawhenscore>=70then"中等"
el
(cawhenscore>=60then"及格"el"不及格"end)
end)
end)
end)as成绩情况
fromcour;
本文发布于:2022-12-28 20:43:31,感谢您对本站的认可!
本文链接:http://www.wtabcd.cn/fanwen/fan/90/48876.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |