數(shù)據(jù)庫(kù)設(shè)計(jì)模板_第1頁(yè)
數(shù)據(jù)庫(kù)設(shè)計(jì)模板_第2頁(yè)
數(shù)據(jù)庫(kù)設(shè)計(jì)模板_第3頁(yè)
數(shù)據(jù)庫(kù)設(shè)計(jì)模板_第4頁(yè)
數(shù)據(jù)庫(kù)設(shè)計(jì)模板_第5頁(yè)
已閱讀5頁(yè),還剩18頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、*中心開(kāi)發(fā)部文檔編號(hào)2011-6-14版本A1密級(jí)商密A項(xiàng)目名稱(chēng)時(shí)代集團(tuán)廣品跟蹤平臺(tái)項(xiàng)目來(lái)源時(shí)代集團(tuán)DR-RD-020(V1.1)數(shù)據(jù)庫(kù)設(shè)計(jì)說(shuō)明書(shū)(內(nèi)部資料請(qǐng)勿外傳)編 檢 審 批寫(xiě):日期:查:日期:日期:準(zhǔn):日期:12*版權(quán)所有不得復(fù)制時(shí)代集團(tuán)產(chǎn)品跟蹤平臺(tái) 錯(cuò)誤!未定義書(shū)簽數(shù)據(jù)庫(kù)設(shè)計(jì)說(shuō)明書(shū)1 弓I言21.1 編寫(xiě)目的21.2 術(shù)語(yǔ)表21.3 參考資料32 數(shù)據(jù)庫(kù)環(huán)境說(shuō)明33 數(shù)據(jù)庫(kù)的命名規(guī)則34 邏輯設(shè)計(jì)35 物理設(shè)計(jì)45.1 表匯總55.2 表兇:XXX表55.3 視圖的設(shè)計(jì)115.4 存儲(chǔ)過(guò)程、函數(shù)及觸發(fā)器的設(shè)計(jì)126安全性設(shè)計(jì)236.1 防止用戶直接操作數(shù)據(jù)庫(kù)的方法236.2 用戶帳號(hào)

2、密碼的加密方法236.3 角色與權(quán)限237優(yōu)化238數(shù)據(jù)庫(kù)管理與維護(hù)說(shuō)明241引言1.1 編寫(xiě)目的本文檔是時(shí)代集團(tuán)產(chǎn)品跟蹤平臺(tái)概要設(shè)計(jì)文檔的組成部分,編寫(xiě)數(shù)據(jù)庫(kù)設(shè)計(jì)文檔的目的是:明確數(shù)據(jù)庫(kù)的表名、字段名等數(shù)據(jù)信息,用來(lái)指導(dǎo)后期的數(shù)據(jù)庫(kù)腳本的開(kāi)發(fā),本文檔遵循SQL數(shù)據(jù)庫(kù)設(shè)計(jì)和開(kāi)發(fā)規(guī)范.本文檔的讀者對(duì)象是需求人員、系統(tǒng)設(shè)計(jì)人員、開(kāi)發(fā)人員、測(cè)試人員。1.2 術(shù)語(yǔ)表序號(hào)術(shù)語(yǔ)或縮略語(yǔ)說(shuō)明性定義1ESIDEnterStorageId入庫(kù)編號(hào)2ProIdProductId廣品編號(hào)o3PMIDProductManagerId廣品管理員編號(hào)1.3參考資料資料名稱(chēng)作者文件編號(hào)、版本資料存放地點(diǎn)2數(shù)據(jù)庫(kù)環(huán)境說(shuō)明數(shù)據(jù)

3、庫(kù)實(shí)例數(shù)據(jù)庫(kù)系統(tǒng)數(shù)據(jù)庫(kù)部署環(huán)境數(shù)據(jù)庫(kù)設(shè)計(jì)工具數(shù)據(jù)庫(kù)存放ag說(shuō)明3數(shù)據(jù)庫(kù)的命名規(guī)則數(shù)據(jù)庫(kù)名稱(chēng):時(shí)代集團(tuán)的英文名稱(chēng)time-group表名:英文(表的用途)+下劃線+英文字段名:相關(guān)屬性的英文名4邏輯設(shè)計(jì)提示:數(shù)據(jù)庫(kù)設(shè)計(jì)人員根據(jù)需求文檔,創(chuàng)建與數(shù)據(jù)庫(kù)相關(guān)的那部分實(shí)體關(guān)系圖(ERD。如果采用面向?qū)ο蠓椒ǎ∣OAR這里實(shí)體相當(dāng)于類(lèi)(class)。產(chǎn)品管理員產(chǎn)品信息合作伙伴5物理設(shè)計(jì)提示:(1)主要是設(shè)計(jì)表結(jié)構(gòu)。一般地,實(shí)體對(duì)應(yīng)于表,實(shí)體的屬性對(duì)應(yīng)于表的列,實(shí)體之間的關(guān)系成為表的約束。邏輯設(shè)計(jì)中的實(shí)體大部分可以轉(zhuǎn)換成物理設(shè)計(jì)中的表,但是它們并不一定是一一對(duì)應(yīng)的。(2)對(duì)表結(jié)構(gòu)進(jìn)行規(guī)范化處理(第三范式)。

4、5.1表匯總表名功能說(shuō)明Enter_storage產(chǎn)品入庫(kù)(新產(chǎn)品的登記、修改、查詢(xún))Exit_storage產(chǎn)品出庫(kù)(登記產(chǎn)品出庫(kù)信息)Seller_info銷(xiāo)售商信息維護(hù)表(對(duì)銷(xiāo)售商信息的添加、修改和查詢(xún))Product_info產(chǎn)品信息表(對(duì)新產(chǎn)品的發(fā)布,修改,查詢(xún)等維護(hù))Repair_info維修表(對(duì)已出售產(chǎn)品的維修進(jìn)行登記,修改)L管理員表(包含五種身份,銷(xiāo)售人員,庫(kù)存管理人員,售后服務(wù)人員,產(chǎn)品信息管理人員,系統(tǒng)管理員)5.2表:表的索引:索引是否建立要根據(jù)具體的業(yè)務(wù)需求來(lái)確定。允許為空:不填的表示為“是”。唯一:不填的表示為“是”。表的記錄數(shù)和增長(zhǎng)量:根據(jù)具體的業(yè)務(wù)需求確定。增

5、長(zhǎng)量應(yīng)確定單位時(shí)間如果量大可以按每天,如果不大可以按每月。表字段的區(qū)別度:主要是考慮到將來(lái)在此字段上建立索引類(lèi)型選擇時(shí)作為參考,當(dāng)字段值唯一時(shí)可以不考慮,當(dāng)字段值不唯一時(shí),估算一個(gè)區(qū)別度,近似即可。例如:如果一個(gè)表的NAM序段有共2000個(gè)值,其中有1999個(gè)不同值,1999/2000=0.99越接近1區(qū)別度越高,反之區(qū)別度越低。表的并發(fā):根據(jù)具體的業(yè)務(wù)需求預(yù)測(cè)表的并發(fā)1.表名Enter_storage數(shù)據(jù)庫(kù)用戶庫(kù)存管理人員主鍵ESID入庫(kù)產(chǎn)品編號(hào)其他排序字段Product,date,num,storageManagerId索引字段序號(hào)字段名稱(chēng)數(shù)據(jù)類(lèi)型(精度范圍)允許為空Y/N唯一Y/N區(qū)別度

6、默認(rèn)值約束條件/說(shuō)明1ESIDintNY2ProductVarchar(50)NN3dateSmallDateTimeNN4numVarchar(50)NN5storageManagerIdVarchar(50)NYMysql腳本CREATETABLEdbo.Enter_storage(ESIDintIDENTITY(1,1)NOTNULL,productvarchar(50)NOTNULL,datesmalldatetimeNOTNULL,numvarchar(6)NOTNULL,storageManagerIdnvarchar(50)NOTNULL,CONSTRAINTPK_addStor

7、agePRIMARYKEYCLUSTERED(ESIDASC)WITH(PAD_INDEX=OFF,STATISTICS_NORECOMPUTE=OFF,IGNORE_DUP_KEY=OFF,ALLOW_ROW_LOCKS=ON,ALLOW_PAGE_LOON)ONPRIMARY)ONPRIMARYGOSETANSI_PADDINGOFFGO記錄數(shù)增長(zhǎng)量表的并發(fā)補(bǔ)充說(shuō)明2.表名Exit_storage數(shù)據(jù)庫(kù)用戶庫(kù)存管理人員主鍵ExitStorageId出庫(kù)產(chǎn)品編號(hào)其他排序字段Product,date,num,storageManagerId索引字段序號(hào)字段名稱(chēng)數(shù)據(jù)類(lèi)型(精度范圍)允許為空Y/N

8、唯一Y/N區(qū)別度默認(rèn)值約束條件/說(shuō)明1ExitStorageIdintNY2ProductVarchar(50)NN3dateSmallDateTimeNN4numVarchar(50)NN5storageManagerIdVarchar(50)NYMysql腳本CREATETABLEdbo.Exit_storage(ExitStorageIdintIDENTITY(1,1)NOTNULL,productvarchar(50)NOTNULL,datesmalldatetimeNOTNULL,numvarchar(6)NOTNULL,CONSTRAINTPK_subStoragePRIMARYK

9、EYCLUSTERED(ExitStorageIdASC)WITH(PAD_INDEX=OFF,STATISTICS_NORECOMPUTE=OFFIGNORE_DUP_KEY=OFF,ALLOW_ROW_LOCKS=ON,ALLOW_PAGE_LOCKS=ON)ONPRIMARY)ONPRIMARYGOSETANSI_PADDINGOFFGO/*Object:Tabledbo.Enter_storageScriptDate:01/17/201116:00:59*/SETANSI_NULLSONGOSETQUOTED_IDENTIFIERONGOSETANSI_PADDINGONGO記錄數(shù)增長(zhǎng)

10、量表的并發(fā)補(bǔ)充說(shuō)明3.表名Seller_info數(shù)據(jù)庫(kù)用戶銷(xiāo)售商管理員主鍵name其他排序字段telephone,address,product,stockNum,stockDate,stockPrice索引字段序號(hào)字段名稱(chēng)數(shù)據(jù)類(lèi)型(精度范圍)允許為空Y/N唯一Y/N區(qū)別度默認(rèn)值約束條件/說(shuō)明1nameVarchar(50)NY2telephoneVarchar(50)NN3addressSmallDateTimeNN4productVarchar(50)NN5stockNumVarchar(50)NN6stockDateSmallDateTimeNN7stockPriceVarchar(50

11、)NNMysql腳本CREATETABLEdbo.Seller_info(namevarchar(50)NOTNULL,telephonevarchar(20)NOTNULL,addressvarchar(50)NOTNULL,productvarchar(50)NOTNULL,stockNumvarchar(6)NOTNULL,stockDatesmalldatetimeNOTNULL,stockPricevarchar(10)NOTNULL,CONSTRAINTPK_maketer_InfoPRIMARYKEYCLUSTERED(nameASC)WITH(PAD_INDEX=OFF,STA

12、TISTICS_NORECOMPUTE=OFF,IGNORE_DUP_KEYOFF,ALLOW_ROW_LOCKSON,ALLOW_PAGE_LOC=ON)ONPRIMARY)ONPRIMARYGOSETANSI_PADDINGOFFGO/*Object:Tabledbo.Repair_infoScriptDate:12/16/201009:59:13*/SETANSI_NULLSONGOSETQUOTED_IDENTIFIERONGOSETANSI_PADDINGONGO記錄數(shù)增長(zhǎng)量表的并發(fā)補(bǔ)充說(shuō)明4.表名Product_info數(shù)據(jù)庫(kù)用戶產(chǎn)品信息管理人員主鍵proId其他排序字段name,

13、price,proDate,storage索引字段序號(hào)字段名稱(chēng)數(shù)據(jù)類(lèi)型(精度范圍)允許為空Y/N唯一Y/N區(qū)別度默認(rèn)值約束條件/說(shuō)明1proIdintNY2nameVarchar(50)NN3priceVarchar(50)NN4proDateSmallDateTimeNN5storageVarchar(50)NYMysql腳本CREATETABLEdbo.ProductJnfo(proIdintIDENTITY。/)NOTNULL,namevarchar(50)NOTNULL,pricevarchar(6)NOTNULL,proDatesmalldatetimeNOTNULL,storage

14、varchar(4)NOTNULL,CONSTRAINTPK_product_InfoPRIMARYKEYCLUSTERED(proIdASC)WITH(PAD_INDEX=OFF,STATISTICS_NORECOMPUTEOFF,IGNORE_DUP_KEY=OFF,ALLOW_ROW_LOCKS=ON,ALLOW_PAGE_LOCKS=ON)ONPRIMARY)ONPRIMARYGOSETANSI_PADDINGOFFGO/*Object:Tabledbo.LoginScriptDate:01/17/201116:00:59*/SETANSI_NULLSONGOSETQUOTED_IDE

15、NTIFIERONGOSETANSI_PADDINGONGO記錄數(shù)增長(zhǎng)量表的并發(fā)補(bǔ)充說(shuō)明5.表名Repair_info數(shù)據(jù)庫(kù)用戶售后服務(wù)人員主鍵repairId廣品維修編號(hào)其他排序字段repairName,repairtel,product,customer,date,customertel索引字段序號(hào)字段名稱(chēng)數(shù)據(jù)類(lèi)型(精度范圍)允許為空Y/N唯一Y/N區(qū)別度默認(rèn)值約束條件/說(shuō)明1repairIdintNY2repairNameVarchar(50)NN3repairtelSmallDateTimeNN4productVarchar(50)NN5customerVarchar(50)NNdat

16、eSmallDateTimeNNcustomertelVarchar(50)NNMysql腳本CREATETABLEdbo.Repair_info(repairIdintIDENTITY。/)NOTNULL,repairNamenchar(10)NULL,repairtelnchar(10)NULL,productvarchar(50)NOTNULL,customervarchar(20)NOTNULL,datesmalldatetimeNOTNULL,customertelnchar(10)NULL,CONSTRAINTPK_Table_1PRIMARYKEYCLUSTERED(repair

17、IdASC)WITH(PAD_INDEX=OFF,STATISTICS_NORECOMPUTE=OFF,IGNORE_DUP_KEYOFF,ALLOW_ROW_LOCKSON,ALLOW_PAGE_LOC=ON)ONPRIMARY)ONPRIMARYGOSETANSI_PADDINGOFFGO/*Object:Tabledbo.Product_infoScriptDate:01/17/201116:00:59*/SETANSI_NULLSONGOSETQUOTED_IDENTIFIERONGOSETANSI_PADDINGONGO記錄數(shù)增長(zhǎng)量表的并發(fā)補(bǔ)充說(shuō)明6.表名Login數(shù)據(jù)庫(kù)用戶管理人員

18、主鍵userId用戶編號(hào)其他排序字段password,userName,tel,birthday,registerTime,type索引字段序號(hào)字段名稱(chēng)數(shù)據(jù)類(lèi)型(精度范圍)允許為空Y/N唯一Y/N區(qū)別度默認(rèn)值約束條件/說(shuō)明1userIdintNY2passwordVarchar(50)NN3userNameSmallDateTimeNN4telVarchar(50)NN5birthdayVarchar(50)NN6registerTimeSmallDateTimeNN7typeVarchar(50)NNMysql腳本CREATETABLEdbo.Login(userIdvarchar(10)N

19、OTNULL,passwordvarchar(16)NOTNULL,userNamevarchar(20)NOTNULL,telvarchar(20)NOTNULL,birthdaysmalldatetimeNOTNULL,registerTimesmalldatetimeNOTNULL,typenvarchar(50)NOTNULL,CONSTRAINTPK_manager_InfoPRIMARYKEYCLUSTERED(userIdASC)WITH(PAD_INDEX=OFF,STATISTICS_NORECOMPUTE=OFF,IGNORE_DUP_KEY=OFF,ALLOW_ROW_L

20、OCKS=ON,ALLOW_PAGE_LOCKSONPRIMARY)ONPRIMARYGOSETANSI_PADDINGOFFGO記錄數(shù)增長(zhǎng)量表的并發(fā)補(bǔ)充說(shuō)明ON)5.3視圖的設(shè)計(jì)根據(jù)XXX產(chǎn)品的概要設(shè)計(jì)文檔來(lái)確定。視圖的命名按照xx數(shù)據(jù)庫(kù)設(shè)計(jì)規(guī)范中關(guān)于視圖的命名規(guī)范命名視圖的設(shè)計(jì)應(yīng)注意以下幾點(diǎn):1盡量減少列中使用的公式。2去掉所有不必要的列。3不要使同一個(gè)文檔屬于多個(gè)分類(lèi)。4避免使用表單公式。NameO'rerTypeC>M:&d_dateLrrft1viaw.ftrtft-Stortgeidbs業(yè)20111171:GB:37.34C%iiiii,iui«aa

21、iii,IeICdunmjiameTypeQxroutedLengthFreeNulaofeTfhtTrailngBlanksF-xedLe-WInSou跣Co£ion1ESIDirtrw410noNULL2praduSvansharftOMnononoCKness_FRC_CLAS3d?tenoAno同司,旬NULL4numvarWarno5nongChneSe_PR;_Cl>S5storageMaragerdnvair+iarno100AD於研Omese_PRC_Cl_.Sldern>,S6edIncnememNotForReptcacjon1:Nddmttjrcal

22、uffincefined.NULLNULLNULLRg,GudCS1jNdnowguidcQlcDlumndefned.e5.4存儲(chǔ)過(guò)程、函數(shù)及觸發(fā)器的設(shè)計(jì)存儲(chǔ)過(guò)程及觸發(fā)器的命名按照xx數(shù)據(jù)庫(kù)設(shè)計(jì)規(guī)范中關(guān)于存儲(chǔ)過(guò)程及觸發(fā)器的命名規(guī)范命名。存儲(chǔ)過(guò)程:根據(jù)具體得業(yè)務(wù)邏輯確定輸入?yún)?shù)個(gè)數(shù),類(lèi)型,確定對(duì)哪幾個(gè)表進(jìn)行何種作。在定義存儲(chǔ)過(guò)程時(shí),要使用其完成單一、相對(duì)集中的任務(wù),不要定義已由其他提供功能的過(guò)程。例如:不要定義強(qiáng)制數(shù)據(jù)完整性的過(guò)程(使用完整性約束)。函數(shù):函數(shù)與存儲(chǔ)過(guò)程非常相似,它也是存儲(chǔ)在數(shù)據(jù)庫(kù)中的對(duì)象。但是可以在SQ僚令中使用函數(shù)。就好像建立自己的substr函數(shù)一樣觸發(fā)器:觸發(fā)器是存儲(chǔ)在

23、數(shù)據(jù)庫(kù)中的程序,它在某一特定事件發(fā)生時(shí)執(zhí)行。這些程序可以用PL/SQL和java語(yǔ)言編寫(xiě),也可以用作c語(yǔ)言的調(diào)用,數(shù)據(jù)庫(kù)允許用戶定義這些程序,然后在相關(guān)的表,視圖或者數(shù)據(jù)庫(kù)動(dòng)作執(zhí)行insert,update或delete語(yǔ)句時(shí)執(zhí)行。1 .存儲(chǔ)過(guò)程:CREATEPROCEDUREnter_storage_GetMaxIdASDECLARETempIDintSELECTTempID=max(ESID)+1FROMEnter_storageIFTempIDISNULLRETURN1ELSERETURNTempIDCREATEPROCEDUREnter_storage_ExistsESIDintASD

24、ECLARETempIDintSELECTTempID=count(1)FROMEnter_storageWHEREESID=ESIDIFTempID=0RETURN0ELSERETURN1CREATEPROCEDUREEnter_storage_ADDESIDintoutput,productvarchar(50),datesmalldatetime,numvarchar(6),storageManagerIdnvarchar(50)ASINSERTINTOEnter_storage(product,date,num,storageManagerId)VALUES(product,date,

25、num,storageManagerId)SETESID=IDENTITYCREATEPROCEDUREEnter_storage_UpdateESIDint,productvarchar(50),datesmalldatetime,numvarchar(6),storageManagerIdnvarchar(50)ASUPDATEEnter_storageSETproduct=product,date=date,num=num,storageManagerId=storageManagerIdWHEREESID=ESIDCREATEPROCEDUREEnter_storage_DeleteE

26、SIDintASDELETEEnter_storageWHEREESID=ESIDCREATEPROCEDUREEnter_storage_GetModelESIDintASSELECTESID,product,date,num,storageManagerIdFROMEnter_storageWHEREESID=ESIDCREATEPROCEDUREEnter_storage_GetListASSELECTESID,product,date,num,storageManagerIdFROMEnter_storageCREATEPROCEDUREExit_storage_GetMaxIdASD

27、ECLARETempIDintSELECTTempID=max(ExitStorageId)+1FROMExit_storageIFTempIDISNULLRETURN1ELSERETURNTempIDCREATEPROCEDUREExit_storage_ExistsExitStorageIdintASDECLARETempIDintSELECTTempID=count(1)FROMExit_storageWHEREExitStorageId=ExitStorageIdIFTempID=0RETURN0ELSERETURN1CREATEPROCEDUREExit_storage_ADDExi

28、tStorageIdintoutput,productvarchar(50),datesmalldatetime,numvarchar(6),storageManagerIdnvarchar(50)ASINSERTINTOExit_storage(product,date,num,storageManagerId)VALUES(product,date,num,storageManagerId)SETExitStorageId=IDENTITYCREATEPROCEDUREExit_storage_UpdateExitStorageIdint,productvarchar(50),datesm

29、alldatetime,numvarchar(6),storageManagerIdnvarchar(50)ASUPDATEExit_storageSETproduct=product,date=date,num=num,storageManagerId=storageManagerIdWHEREExitStorageId=ExitStorageIdCREATEPROCEDUREExit_storage_DeleteExitStorageIdintASDELETEExit_storageWHEREExitStorageId=ExitStorageIdCREATEPROCEDUREExit_st

30、orage_GetModelExitStorageIdintASSELECTExitStorageId,product,date,num,storageManagerIdFROMExit_storageWHEREExitStorageId=ExitStorageIdCREATEPROCEDUREExit_storage_GetListASSELECTExitStorageId,product,date,num,storageManagerIdFROMExit_storageCREATEPROCEDURLEogin_ExistsuserIdvarchar(10)ASDECLARETempIDin

31、tSELECTTempID=count(1)FROMLoginWHEREuserId=userIdIFTempID=0RETURN0ELSERETURN1CREATEPROCEDURLEogin_ADDuserIdvarchar(10),passwordvarchar(16),userNamevarchar(20),telvarchar(20),birthdaysmalldatetime,registerTimesmalldatetimetypenvarchar(50)ASINSERTINTOLogin(userId,password,userName,tel,birthday,registe

32、rTime,type)VALUES(userId,password,userName,tel,birthday,registerTime,type)CREATEPROCEDURLEogin_UpdateuserIdvarchar(10),passwordvarchar(16),userNamevarchar(20),telvarchar(20),birthdaysmalldatetime,registerTimesmalldatetime,typenvarchar(50)ASUPDATELoginSETpassword=password,userName=userName,tel=tel,bi

33、rthday=birthday,registerTime=registerTime,type=typeWHEREuserId=userIdCREATEPROCEDURLEogin_DeleteuserIdvarchar(10)ASDELETELoginWHEREuserId=userIdCREATEPROCEDURLEogin_GetModeluserIdvarchar(10)ASSELECTuserId,password,userName,tel,birthday,registerTime,typeFROMLoginWHEREuserId=userIdCREATEPROCEDURLEogin

34、_GetListASSELECTuserId,password,userName,tel,birthday,registerTime,typeFROMLoginCREATEPROCEDURPEroduct_info_GetMaxIdASDECLARETempIDintSELECTTempID=max(proId)+1FROMProduct_infoIFTempIDISNULLRETURN1ELSERETURNTempIDCREATEPROCEDURPEroduct_info_ExistsproIdintASDECLARETempIDintSELECTTempID=count(1)FROMPro

35、duct_infoWHEREproId=proIdIFTempID=0RETURN0ELSERETURN1CREATEPROCEDURPEroduct_info_ADDproIdintoutput,namevarchar(50),pricevarchar(6),proDatesmalldatetime,storagevarchar(4)ASINSERTINTOProduct_info(name,price,proDate,storage)VALUES(name,price,proDate,storage)SETproId=IDENTITYCREATEPROCEDURPEroduct_info_

36、UpdateproIdint,namevarchar(50),pricevarchar(6),proDatesmalldatetime,storagevarchar(4)ASUPDATEProduct_infoSETname=name,price=price,proDate=proDate,storage=storageWHEREproId=proIdCREATEPROCEDURPEroduct_info_DeleteproIdintASDELETEProduct_infoWHEREproId=proIdCREATEPROCEDURPEroduct_info_GetModelproIdintA

37、SSELECTproId,name,price,proDate,storageFROMProduct_infoWHEREproId=proIdCREATEPROCEDURPEroduct_info_GetListASSELECTproId,name,price,proDate,storageFROMProduct_infoCREATEPROCEDURREepair_info_GetMaxIdASDECLARETempIDintSELECTTempID=max(repairId)+1FROMRepair_infoIFTempIDISNULLRETURN1ELSERETURNTempIDCREAT

38、EPROCEDURREepair_info_ExistsrepairIdintASDECLARETempIDintSELECTTempID=count(1)FROMRepair_infoWHERErepairId=repairIdIFTempID=0RETURN0ELSERETURN1CREATEPROCEDURREepair_info_ADDrepairIdintoutput,repairNamenchar(10),repairtelnchar(10),productvarchar(50),customervarchar(20),datesmalldatetime,customertelnc

39、har(10)ASINSERTINTORepair_info(repairName,repairtel,product,customer,date,customertel)VALUES(repairName,repairtel,product,customer,date,customertel)SETrepairId=IDENTITY1。18CREATEPROCEDURREepair_info_UpdaterepairIdint,repairNamenchar(10),repairtelnchar(10),productvarchar(50),customervarchar(20),dates

40、malldatetime,customertelnchar(10)ASUPDATERepair_infoSETrepairName=repairName,repairtel=repairtel,product=product,customer=customer,date=date,customertel=customertelWHERErepairId=repairIdCREATEPROCEDURREepair_info_DeleterepairIdintASDELETERepair_infoWHERErepairId=repairIdCREATEPROCEDURREepair_info_Ge

41、tModelrepairIdintASSELECTrepairId,repairName,repairtel,product,customer,date,customertelFROMRepair_infoWHERErepairId=repairIdCREATEPROCEDURREepair_info_GetListASSELECTrepairId,repairName,repairtel,product,customer,date,customertelFROMRepair_infoCREATEPROCEDURSEeller_info_Existsnamevarchar(50)ASDECLA

42、RETempIDintSELECTTempID=count(1)FROMSeller_infoWHEREname=nameIFTempID=0RETURN0ELSERETURN1CREATEPROCEDURSEeller_info_ADDnamevarchar(50),telephonevarchar(20),addressvarchar(50),productvarchar(50),stockNumvarchar(6),stockDatesmalldatetime,stockPricevarchar(10)ASINSERTINTOSeller_info(name,telephone,address,product,stockNum,stockDate,stockPrice)VALUES(name,telephone,address,product,stockNum,stockDate,stockPrice)CREATEPROCEDURSEeller_info_Updatenamevarchar(50),telephonevarchar(20),addressvarchar(50),productvarchar(50),stockNumvarchar(6),stockDatesmalldatetim

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論