北大“数据库原理”上机实践题目总结(5)
答案:1 属性: cname, sum,cxi
set talk off 例如: 高数 1 物理
clear
use tc
index on tno + cno to tt
action=.t.
answer=.t.
dimension d(3)
do while action
a=space(4)
b=space(6)
@ 1,1 say “请输入职工号:” get a picture “xxxx”
@ 2,1 say “请输入课号:” get b picture“xxxxxx”
read
c=a+b
seek c
if found()
scatter to d
@ 3,2 say “tno” get d(1) picture“xxxx”
@ 5,2 say “cno” get d(2) picture“xxxxxx”
clear gets
@ 7,2 say “gread” get d(3) picture“99”
read
@ 11,2 say “真的要修改吗?” get answer picture“l”
read
if answer
clear
gather from d
@ 1,1 say “该职工数据已存入!”
endif
if .not.answer
clear
endif
endif
if .not.found()
clear
@ 1,1 say “查无此人!”
endif
@ 4,2 say “继续查吗?” get action picture“l”
read
clear
enddo
set talk on