北大“數(shù)據(jù)庫原理”上機實踐題目總結(jié)(5)

字號:

答案:1 屬性: cname, sum,cxi
    set talk off 例如: 高數(shù) 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(fā)”
    read
    if answer
    clear
    gather from d
    @ 1,1 say “該職工數(shù)據(jù)已存入!”
    endif
    if .not.answer
    clear
    endif
    endif
    if .not.found()
    clear
    @ 1,1 say “查無此人!”
    endif
    @ 4,2 say “繼續(xù)查嗎?” get action picture“l(fā)”
    read
    clear
    enddo
    set talk on