资源描述:
《进销存系统 sql文件》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、进销存系统sql文件usemastergoifexists(select*fromsysdatabaseswherename='SellManageSystem')dropdatabaseSellManageSystemgocreatedatabaseSellManageSystemgouseSellManageSystemgo--创建客户信息表ifexists(select1fromsysobjectswherename='CustomerInfo')droptableCustomerInfogocreatetableCustomerInfo(Customer
2、IDintprimarykeyidentity(1000,1),--客户编号CustomerNamenvarchar(20)notnull,--客户名称CustomerAddressnvarchar(50),--客户地址CustomerPhonenvarchar(11),--客户电话Taxnonvarchar(10),--税号Reputenvarchar(50),--信誉度Countrynvarchar(20),--国家Provincenvarchar(20)--省份)go--创建供应商信息表ifexists(select1fromsysobjectswhere
3、name='ComponyInfo')droptableComponyInfogocreatetableComponyInfo(ComponyIDintprimarykeyidentity(1000,1),--供应商编号ComponyNamenvarchar(20)notnull,--供应商名称ComponyAddressnvarchar(50),--供应商地址ComponyPhonenvarchar(11),--供应商电话Taxnonvarchar(10),--税号Countrynvarchar(20),--国家Provincenvarchar(20)--省份
4、)go--创建产品信息表ifexists(select1fromsysobjectswherename='ProductInfo')droptableProductInfogocreatetableProductInfo(ProductIDintprimarykeyidentity(001,1),--产品编号ComponyIDintforeignkeyreferencesComponyInfo(ComponyID),--供应商编号ProductNamenvarchar(20),--产品名称ProductTypenvarchar(20),--产品类别NumberP
5、erMonthint,--月生产能力Pricemoney--单价)go--创建库存信息表ifexists(select1fromsysobjectswherename='StorageInfo')droptableStorageInfogocreatetableStorageInfo(StorageIDintprimarykeyidentity(1,1),--库存信息编号ProductIDintforeignkeyreferencesProductInfo(ProductID),--产品编号StorageAddressnvarchar(50),--库存地址Sto
6、rageNumberint--库存数量)go--创建产品进库信息表ifexists(select1fromsysobjectswherename='StockInfo')droptableStockInfogocreatetableStockInfo(StockIDintprimarykeyidentity(001,1),--进库号ProductIDintforeignkeyreferencesProductInfo(ProductID),--产品编号StockNumberint,--进库数量Stockmoney,--进价Stocksummoney,--总价Co
7、mponyIDintforeignkeyreferencesComponyInfo(ComponyID),--供应商编号StockTimedatetime,--进库时间Principalnvarchar(20)--经手人)go--创建订单信息表ifexists(select1fromsysobjectswherename='OrderInfo')droptableOrderInfogocreatetableOrderInfo(OrderIDintprimarykeyidentity(1,1),--订单号CustomerIDintforeignkeyreferen
8、cesCustomerI