【正文】
餐桌號(hào)))go7 其他在表中創(chuàng)建相關(guān)地視圖,約束,默認(rèn)值,索引,觸發(fā)器,規(guī)則以及存儲(chǔ)過(guò)程創(chuàng)建視圖視圖1create view 職工服務(wù)asselect ,職工姓名,部門(mén)編號(hào),from 職工,服務(wù)where =go視圖2create view 消費(fèi)者享用asselect ,消費(fèi)金額,from 消費(fèi)者,享用where =go視圖3create view 職工購(gòu)買(mǎi)asselect ,部門(mén)編號(hào),購(gòu)買(mǎi)量from 職工,購(gòu)買(mǎi)where =go創(chuàng)建約束Check約束1alter table 職工with nocheckadd check(年齡=18 and 年齡=65)goCheck約束2alter table 倉(cāng)庫(kù)add check(面積=50)goCheck約束3alter table 服務(wù)with nocheck add constraint CK_服務(wù)質(zhì)量 check(服務(wù)質(zhì)量=39。,39。elsebeginprint39。)go創(chuàng)建存儲(chǔ)過(guò)程create procedure 顧客享用_infoasselect ,用餐數(shù)量,from 享用 join 成品菜 on =join 消費(fèi)者on =go8 總結(jié) 經(jīng)過(guò)兩個(gè)星期地努力,終于設(shè)計(jì)出一個(gè)……參考文獻(xiàn)[1](第四版).[2] Server [3][4][5] Server 東海科學(xué)技術(shù)學(xué)院學(xué)生課程設(shè)計(jì)日志周次日期工 作 內(nèi) 容第十八周布置任務(wù)及分組、總體需求分析與設(shè)計(jì)編寫(xiě)相關(guān)文檔、設(shè)計(jì)說(shuō)明、查找資料需求分析,寫(xiě)出DFD和DD畫(huà)出ER圖完善ER圖周次日期工 作 內(nèi) 容第十九周轉(zhuǎn)化成關(guān)系模型在SQL SERVER上實(shí)施撰寫(xiě)課程設(shè)計(jì)成果說(shuō)明書(shū)打印課程設(shè)計(jì)檢查與整理版權(quán)申明本文部分內(nèi)容,包括文字、圖片、以及設(shè)計(jì)等在網(wǎng)上搜集整理。s personal ownership.用戶可將本文的內(nèi)容或服務(wù)用于個(gè)人學(xué)習(xí)、研究或欣賞,以及其他非商業(yè)性或非盈利性用途,但同時(shí)應(yīng)遵守著作權(quán)法及其他相關(guān)法律的規(guī)定,不得侵犯本網(wǎng)站及相關(guān)權(quán)利人的合法權(quán)利。rollback transactionendreturngo創(chuàng)建規(guī)則規(guī)則1create rule 消費(fèi)金額_ruleas消費(fèi)金額=20Go規(guī)則2create rule 服務(wù)質(zhì)量_ruleas服務(wù)質(zhì)量 in (39。go創(chuàng)建索引索引1create nonclustered indexix_成品菜 on 成品菜(菜名,菜價(jià),份數(shù))go索引2create nonclustered indexix_職工 on 職工(工號(hào),職工姓名,年齡,職稱,部門(mén)編號(hào))go創(chuàng)建觸發(fā)器插入職工地觸發(fā)器create trigger insert_服務(wù) on 服務(wù)for insertasdeclare msg varchar(20)select msg=工號(hào) from insertedif exists(select * from 職工 where 工號(hào)=msg)print39。 or 服務(wù)質(zhì)量=39。e:\mydata\39。一般39。該職工地工號(hào)在表職工中不存在,不能插入該職工記錄!39。較滿意39。Reproduction or quotation of the content of this article must be reasonable and goodfaith citation for the use of news or informative public free information. It shall not misinterpret or modify the original intention of the content of this article, and shall bear legal liability such as copyright.