ACCP S1 C# 第十章上机练习

来源:互联网 发布:开发企业软件平台 编辑:程序博客网 时间:2024/06/05 17:53
上机1
select StudentName,Phone, Addressfrom Student where Address like '山东%'select SubjectName, ClassHour, GradeIdfrom Subject where SubjectName like '%数据库%'order by GradeIdselect StudentName, Phone, Addressfrom Student where Phone like '1387%'select StudentNo, StudentName, Addressfrom Student where StudentName like '姜_'select Id, StudentNo, SubjectId, StudentResult, ExamDatefrom Result where StudentNo='S1101004' and SubjectId in(1,2,3)select StudentNo, LoginPwd, StudentName, Sex, GradeId, Phone, Address, BornDate, Emailfrom Student where BornDate between '1989-1-1' and '1995-12-31'


上机2

select COUNT(*) as '学生总人数' from Studentselect sum(ClassHour) as '第一学期的总学时'from Subject where GradeId=1select SUM(StudentResult) as 'S1101004学生第一学期的总成绩'from Result,Subject where GradeId=1 and StudentNo='S1101004'select AVG(StudentResult) as 'S1101004学生第一学期的平均分'from Result,Subject where GradeId=1 and StudentNo='S1101004'select MAX(StudentResult) as '最高分',MIN(StudentResult) as '最低分',AVG(StudentResult) as '平均分'from Result,Subject where SubjectName='使用C#语言开发数据库应用系统' and ExamDate='2013-03-22'select AVG(StudentResult) as '平均分'from Result,Subject where SubjectName='使用C#语言开发数据库应用系统' and StudentResult>=60select AVG(StudentResult) as '平均分'from Result,Subject where SubjectName='使用C#语言开发数据库应用系统'

1 0
原创粉丝点击