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