資源描述:
《進(jìn)銷存系統(tǒng) sql文件》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、進(jìn)銷存系統(tǒng)sql文件usemastergoifexists(select*fromsysdatabaseswherename='SellManageSystem')dropdatabaseSellManageSystemgocreatedatabaseSellManageSystemgouseSellManageSystemgo--創(chuàng)建客戶信息表ifexists(select1fromsysobjectswherename='CustomerInfo')droptableCustomerInfogocreatetableCustomerInfo(Customer
2、IDintprimarykeyidentity(1000,1),--客戶編號(hào)CustomerNamenvarchar(20)notnull,--客戶名稱CustomerAddressnvarchar(50),--客戶地址CustomerPhonenvarchar(11),--客戶電話Taxnonvarchar(10),--稅號(hào)Reputenvarchar(50),--信譽(yù)度Countrynvarchar(20),--國(guó)家Provincenvarchar(20)--省份)go--創(chuàng)建供應(yīng)商信息表ifexists(select1fromsysobjectswhere
3、name='ComponyInfo')droptableComponyInfogocreatetableComponyInfo(ComponyIDintprimarykeyidentity(1000,1),--供應(yīng)商編號(hào)ComponyNamenvarchar(20)notnull,--供應(yīng)商名稱ComponyAddressnvarchar(50),--供應(yīng)商地址ComponyPhonenvarchar(11),--供應(yīng)商電話Taxnonvarchar(10),--稅號(hào)Countrynvarchar(20),--國(guó)家Provincenvarchar(20)--省份
4、)go--創(chuàng)建產(chǎn)品信息表ifexists(select1fromsysobjectswherename='ProductInfo')droptableProductInfogocreatetableProductInfo(ProductIDintprimarykeyidentity(001,1),--產(chǎn)品編號(hào)ComponyIDintforeignkeyreferencesComponyInfo(ComponyID),--供應(yīng)商編號(hào)ProductNamenvarchar(20),--產(chǎn)品名稱ProductTypenvarchar(20),--產(chǎn)品類別NumberP
5、erMonthint,--月生產(chǎn)能力Pricemoney--單價(jià))go--創(chuàng)建庫(kù)存信息表ifexists(select1fromsysobjectswherename='StorageInfo')droptableStorageInfogocreatetableStorageInfo(StorageIDintprimarykeyidentity(1,1),--庫(kù)存信息編號(hào)ProductIDintforeignkeyreferencesProductInfo(ProductID),--產(chǎn)品編號(hào)StorageAddressnvarchar(50),--庫(kù)存地址Sto
6、rageNumberint--庫(kù)存數(shù)量)go--創(chuàng)建產(chǎn)品進(jìn)庫(kù)信息表ifexists(select1fromsysobjectswherename='StockInfo')droptableStockInfogocreatetableStockInfo(StockIDintprimarykeyidentity(001,1),--進(jìn)庫(kù)號(hào)ProductIDintforeignkeyreferencesProductInfo(ProductID),--產(chǎn)品編號(hào)StockNumberint,--進(jìn)庫(kù)數(shù)量Stockmoney,--進(jìn)價(jià)Stocksummoney,--總價(jià)Co
7、mponyIDintforeignkeyreferencesComponyInfo(ComponyID),--供應(yīng)商編號(hào)StockTimedatetime,--進(jìn)庫(kù)時(shí)間Principalnvarchar(20)--經(jīng)手人)go--創(chuàng)建訂單信息表ifexists(select1fromsysobjectswherename='OrderInfo')droptableOrderInfogocreatetableOrderInfo(OrderIDintprimarykeyidentity(1,1),--訂單號(hào)CustomerIDintforeignkeyreferen
8、cesCustomerI