ACCP S1 C#第十二章

阶段三
select stuNo, stuName, stuSex, stuAge, stuSeat, stuAddress
from stuInfo where stuSex='男'

select stuNo, writtenExam
from stuMarks where writtenExam>=75 and writtenExam<=100

select AVG(writtenExam) as '笔试平均分',AVG(labExam) as '机试平均分'
from stuMarks where writtenExam<>0 and labExam<>0

select COUNT(*) as '学生总人数' from stuMarks

select COUNT(*) as '没有通过考试的人数' 
from stuMarks where writtenExam between 0 and 60 or labExam between 0 and 60

select stuNo, writtenExam, labExam,(writtenExam+labExam)/2 as '平均分'
from stuMarks

select stuNo,labExam,(writtenExam+labExam)/2 as '平均分'from stuMarks
order by (writtenExam+labExam)/2 desc


阶段四

update stuMarks set writtenExam=100 where writtenExam>=95
update stuMarks set writtenExam+=5 where writtenExam<95

你可能感兴趣的:(ACCP S1 C#第十二章)