【正文】
研項目的名稱和教師姓名來進行查詢相關(guān)的信息。 create procedure xm_xmmc @xm nvarchar(10), @xmmc nvarchar(60) as if(@xm is null and @xmmc is not null) begin select * from view_All where xmmc=@xmmc end else if(@xm is not null and @xmmc is null) begin 27 select * from view_All where xm=@xm end else if(@xm is not null and @xmmc is not null ) begin select * from view_All where xm=@xm and xmmc=@xmmc end else if(@xm is null and @xmmc is null) begin select * from view_All End ( 2) xmbh_lwmc_hjbh存儲過程 xmbh_lwmc_hjbh存儲過程可以通過教師編號和項目名稱及獲獎編號來查詢相關(guān)信息。 create procedure xmbh_lwmc_hjbh @xmbh nvarchar(2), @lwmc nvarchar(10), @hjbh nvarchar(2) as if(@xmbh is null and @lwmc is null and @hjbh is null) begin select * from view_All end else if(@xmbh is not null and @lwmc is null and @hjbh is null) begin select * from view_All where xmbh=@xmbh 28 end else if(@xmbh is null and @lwmc is not null and @hjbh is null) begin select * from view_All where lwmc=@lwmc end else if(@xmbh is null and @lwmc is null and @hjbh is not null) begin select * from view_All where hjbh=@hjbh end else if(@xmbh is not null and @lwmc is not null and @hjbh is null) begin select * from view_All where xmbh=@xmbh and lwmc=@lwmc end else if(@xmbh is null and @lwmc is null and @hjbh is not null) begin select * from view_All where xmbh=@xmbh and hjbh=@hjbh end else if(@xmbh is null and @lwmc is not null and @hjbh is not null) begin select * from view_All where lwmc=@lwmc and hjbh=@hjbh 29 end else if(@xmbh is not null and @lwmc is not null and @hjbh is not null) begin select * from view_All where xmbh=@xmbh and lwmc=@lwmc and hjbh=@hjbh end 30 數(shù)據(jù)庫的備份 數(shù)據(jù)庫的備份在當(dāng)今尤為重要,若沒有備份,數(shù)據(jù)的損害是無法修復(fù)的,而數(shù)據(jù)的損壞的原因是多方面的,是難以預(yù)料的,所以數(shù)據(jù)備份是必須的。 本數(shù)據(jù)庫的備份,如圖 ,。 圖 新建作業(yè) 31 圖 數(shù)據(jù)庫備份界面 32 5 數(shù)據(jù)庫操作 數(shù)據(jù)的插入 數(shù)據(jù)的插入是數(shù)據(jù)庫的基礎(chǔ),數(shù)據(jù)錄入是做任操作的前提。 如圖 INSERT INTO Paper VALUES(39。0139。,39。論文 39。,39。是 39。,39。2020/2/339。)。 INSERT INTO Paper VALUES(39。0239。,39。論文 39。,39。是 39。,39。2020/5/1339。)。 INSERT INTO Paper VALUES(39。0339。,39。論文 39。,39。是 39。,39。2020/5/339。)。 INSERT INTO Paper VALUES(39。0439。,39。論文 39。,39。是 39。,39。2020/4/339。)。 圖 數(shù)據(jù)插入 數(shù)據(jù)的刪除 數(shù)據(jù)的刪除是為了去除數(shù)據(jù)庫中不需要的信息和錯誤的信息。 DELETE FROM Own WHERE jsbh=39。0639。 AND hjbh=39。0439。 數(shù)據(jù)的更新 數(shù)據(jù)的更新是為了在數(shù)據(jù)出錯的情況下,進行的更改。如圖 UPDATE Research SET xmlx=39。學(xué)術(shù)性 39。 WHERE xmbh=39。0139。 33 圖 數(shù)據(jù)更新 數(shù)據(jù)的查詢 數(shù)據(jù)的查詢是數(shù)據(jù)庫的核心,我們可以直接對建立好的表進行直接查詢也可以通過視圖進行查詢。如圖 直接對表進行查詢: SELECT * FROM Teacher WHERE xm = 39。張三 39。 借助視圖進行查詢: SELECT * FROM view_Prize WHERE xm = 39。張三 39。 圖 數(shù)據(jù)查詢 34 6 總結(jié) 本次課題設(shè)計任務(wù)是開發(fā)高??蒲泄芾硐到y(tǒng)數(shù)據(jù)庫,通過課堂當(dāng)中所學(xué)知識以及對課堂中所舉高校圖書管理系統(tǒng)的設(shè)計進行參考,在我們小組的不斷努力和共同探討下最終將該任務(wù)順利完成。在此次設(shè)計與實現(xiàn)當(dāng)中,我們都遇到了如下問題: 。由于每個人對事物的看法不同導(dǎo)致起初在需求分析這里出現(xiàn)了一些分歧,無法達成一致。最終通過多次商量和網(wǎng)上調(diào)查后將需求分析梳理清楚并設(shè)計好了數(shù)據(jù)流程以及實體。 TSQL 語句書寫的不熟練。在最后實施階段中,由 于需要實際上機操作。此時則會發(fā)現(xiàn)要將理論知識靈活運用到實際當(dāng)中并不容易,尤其在存儲過程這里比較困難。最后,在經(jīng)過多次的復(fù)習(xí)和實際操作后將數(shù)據(jù)庫的實踐環(huán)節(jié)完成。 通過這次課程設(shè)計,盡管設(shè)計的系統(tǒng)不是很完善并且安全性不高。但足以讓我認識到了自己的不足以及急需要彌補的地方。所以,在今后的學(xué)習(xí)道路中,我會更加努力的完善自己,不斷的復(fù)習(xí)鞏固所學(xué)知識,并多加練習(xí)以達到可以在實際中靈活使用的地步??偟膩碚f這次課程設(shè)計讓我感到收獲頗豐。 35 參考文獻 [1] 嚴(yán)肖遙 .SQLServer數(shù)據(jù)庫訪問技術(shù) [M].北京:清華大學(xué)出版社 ,2020 [2] 史志國 .數(shù)據(jù)庫原理及應(yīng)用 [M]. 北京:清華大學(xué)出版社 ,2020 [3] 苗雪蘭 .數(shù)據(jù)庫系統(tǒng)原理及應(yīng)用教程第四版 [M]. 北京:機械工業(yè)出版社 ,2020