表结构stu_id varchar2(8)stu_na varchar2(20)stu_sco numberstu_class varchar2(4)
请用SQL语句完成如下查询:①,求出各班的及格率(成绩>=60)②,求出个班的优秀率(成绩>=80)
相关脚本SELECT STU_CLASS,ROUND(COUNT(CASEWHEN T.STU_SCO >= 60 THEN1ELSENULLEND) * 100 / COUNT(*),2) || ‘%’FROM TEST_TU TGROUP BY STU_CLASS
表结构
stu_id varchar2(8)
stu_na varchar2(20)
stu_sco number
stu_class varchar2(4)
请用SQL语句完成如下查询:
①,求出各班的及格率(成绩>=60)
②,求出个班的优秀率(成绩>=80)
相关脚本
SELECT STU_CLASS,
ROUND(COUNT(CASE
WHEN T.STU_SCO >= 60 THEN
1
ELSE
NULL
END) * 100 / COUNT(*),
2) || ‘%’
FROM TEST_TU T
GROUP BY STU_CLASS