北大数据库及其应用上机题(03年1月14日)_理学-查字典自考网
 
请输入您要查询的关键词
  查字典自考网 >> 理学 >> 北大数据库及其应用上机题(03年1月14日)

北大数据库及其应用上机题(03年1月14日)

发布时间: 2016-06-29 来源:查字典自考网

学生(学号,姓名,性别,出生日期,系号)

课程(课号,课程名,学分)

选修(学号,课号,成绩)

1.建库

2.输数

3.编写一个课程信息的录入程序,要求在录入一门课程后屏幕询问:“继续录入吗?”根据用户回答决定程序流程,要求不退出本程序能继续进行录入操作。

4.用Foxpro语言或sql语言编写程序完成以下查询:

(1)列出学生名单,要包含所有学生的所有信息,且在最后一行显示“年龄小于18岁的男生有XX人”

(2)列出成绩不及格的学生的信息,要包含选修表的所有属性,且在最后一行显示“他们的平均成绩为XX分”

(3)统计数学系每个学生姓名,性别,年龄以及该学生所学课程的总成绩并列表显示。

(4)检索选课在2门及2门以上的学生的学号,姓名,总学分和平均成绩,并列表显示。(不及格的课程不统计在内)

closeall
clear
select1
usekc
dimensiona(3)
action=.t.
answer=.t.
definewindoww1from1,2to30,60systemclosefloatgrow
definewindoww2inwindoww1from1,2to30,50systemclosefloatgrow
dowhileaction
dowhile.t.
scattertoablank
activatewindoww1
clear
@1,2say"课号:"geta(1)picture"xxxxxxxxxx"
@3,2say"课程名:"geta(2)picture"xxxxxxxxxx"
@5,2say"学分:"geta(3)picture"999999"
read
activatewindoww2
clear
@1,2say"输入正确么?[y/n]"getanswerpicture"l"
read
deactivatewindoww2
ifanswer
appendblank
gatherfroma
exit
endif
enddo
clear
@1,2say"要继续么?[y/n"getactionpicture"l"
read
deactivatewindoww1,w1
enddo
return


closeall
clear
select1
usexs
select2
usekc
select3
usexx
selecta.xh,a.xm,a.xb,a.csrq,b.kh,b.kcm,b.xf,c.cj;
fromxsa,kcb,xxctoscreen;
where(a.xh=c.xh)and(c.kh=b.kh)
select1
countfor((year(date()))-year(csrq)<18)and(xb="man")toa
a

closeall
clear
select1
usexs
select2
usekc
select3
usexx
selecta.xh,a.xm,a.xb,a.csrq,a.xh,b.kh,b.kcm,c.cj;
fromxsa,kcb,xxctoscreen;
where(a.xh=c.xh)and(c.kh=b.kh)and(c.cj<60)
settalkoff
averageforcj<60toab
c="他们的平均成绩"
d="分"
settalkon
c
ab
d

closeall
settalkoff
clear
sele1
usexs
sele2
usexx
sele3
use43
zap
sele1
dowhilenoteof()
sele2
sumcjforxh=a.xhtoa
sele3
appendblank
replacexmwitha.xm,xbwitha.xb,nlwithyear(date())-year(a.csrq),zcjwitha
sele1
skip
enddo
settalkon
sele3
list

点击显示
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读

当前热点关注

  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • [相关地区]