1、第一题a=allt(thisform.text1.value)n=this.valuedo casecase n=1select * from sb where 商品名=athisform.refreshcase n=2update sb set 单价=出厂单价*1.1 where left(商品号,2)=“10“browsecase n=3copy to 商品备份表 .dbfcase n=4thisform.releaseendcasethisform.text1.setfocus关注 第二题a=alltrim(thisform.text1.value)b=left(a,2)i=2do wh
2、ile len(b)=60,2,0)+iif(高数=60,3,0)+iif(英语=60,4,0)select * from score order by 学分 ,学号 desc into table XF第八题sele avg(成绩) from CHENGJI group by 学号 into array z thisform.refreshrepl XUESHENG.平均分 with z allthisform.refreshsele 学号,姓名,平均分 from xuesheng into dbf pingjun order by 平均分,学号thisform.refresh第九题a=th
3、isform.text1.valuethisform.grid1.recordsource=“sele * from cj where 姓名=a into cursor aa“sele 姓名,max(成绩) as b ,min(成绩) as c ,avg(成绩) as d from cj group by 姓名 where 姓名=a into cursor aaathisform.text2.value=bthisform.text3.value=cthisform.text4.value=d第十题n=thisform.optiongroup1.valuedo casecase n=1sele
4、ct 姓名,专业名称 from student,class where student.专业号=class. 专业号case n=2select 专业名称,count(*)as 学生数 from student,class where student.专业号=class. 专业号 group by 专业名称case n=3update student set 成绩=成绩+5 where 专业号 in (select 专业号 from class where 专业名称=“英语“)endcase关注 第十二题学生名单if thisform.check1.value=0select 学号,姓名 fr
5、om std_da elseselect 学号,姓名,性别, 出生日期,专业 from std_daendif计算成绩update std_cj set 总成绩=期中*0.2+ 平时+期末*0.7显示成绩IF thisform.optiongroup1.value=1thisform.grid1.recordsource =“SELECT * from std_cj order by 总成绩 into cursor aa“ELSEthisform.grid1.recordsource =“SELECT * from std_cj order by 总成绩 desc into cursor bb
6、“ENDIF选课统计thisform.grid1.recordsource = “SELECT Std_da_a.学号, Std_da_a.姓名, count(*) as 选课门数;FROM std_da Std_da_a LEFT OUTER JOIN std_xk Std_xk_a ;ON Std_da_a.学号 = Std_xk_a.学号;GROUP BY Std_da_a.学号 into cursor aa“第十三题学生成绩IF thisform.check1.value=0SELECT 学号,总成绩 from std_cjELSESELECT std_da.学号,std_da.姓名,
7、std_da. 性别,std_da. 专业,std_cj. 总成绩 from std_da,std_cj where std_da.学号=std_cj. 学号ENDIF班级成绩表select left(学号,4) as 班级号,avg(总成绩) as 平均成绩 from std_cj group by 班级号课程列表select std_xk.课程代号,tch_pk.课程名,count(*)as 学生数 from std_xk,tch_pk;where std_xk.课程代号=tch_pk.课程代号 group by std_xk.课程代号第十四题N=this.valueDO caseCASE n=1cx=“select 学号,姓名, 总成绩 from std_cj where 总成绩 =85 into cursor yx“CASE n=2cx=“select 学号,姓名, 总成绩 from std_cj order by 总成绩 desc top 5 into cursor q5“CASE n=3cx=“select 姓名,总成绩 from std_cj where 总成绩=180sele * top 5 from std_cj order by 总成绩 desc sele * from std_cj where 总成绩 =140