資源描述:
《醫(yī)藥銷售管理系統(tǒng)sql語句》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、createdatabaseMedicalManagerSystem/*創(chuàng)建醫(yī)藥銷售管理系統(tǒng)*/useMedicalManagerSystemcreatetableMedID/*創(chuàng)建藥品類別索引信息*/(MedKindeCodechar(10)constraintMI_PRIPRIMARYKEY,KindExplanationvarchar(12)NOTNULL)createtableMedInfor/*創(chuàng)建藥品信息表*/(MedicineCodechar(6)constraintM_PRIMPRIMARYKEY,MedicineNamevar
2、char(8)NOTNULL,MedKindeCodechar(10)FOREIGNKEYREFERENCESMedID(MedKindeCode),PriceMoney,ListPriceMoney,NumberInt,FirmCodechar(10)FOREIGNKEYREFERENCESFirmInfor(FirmCode),UserfulllifeDatetime)createtableGueInfor/*創(chuàng)建客戶信息表*/(GuestCodechar(10)constraintG_PRIMPRIMARYKEY,GuestNamevar
3、char(16)NOTNULl,GLinkvarchar(12),GLinkTellvarchar(11),Cityvarchar(8))createtableFirmInfor/*創(chuàng)建供應(yīng)商信息表*/(FirmCodechar(10)constraintF_PRIMPRIMARYKEY,FirmNamevarchar(16)NOTNULL,Linkvarchar(12),LinkTellvarchar(11),Cityvarchar(8))createtableWorkInfor/*創(chuàng)建員工信息表*/(WorkNochar(10)constr
4、aintW_PRIMPRIMARYKEY,Namevarchar(12),UserRegNamechar(6)NOTNULL,Passwordchar(10)NOTNULL,Positionchar(10),PowerInt)createtablesellMain/*創(chuàng)建醫(yī)藥銷售主表*/(SaleNointconstraintSM_PRIMPRIMARYKEY,WorkNochar(10)FOREIGNKEYREFERENCESWorkInfor(WorkNo),SaleDateDateTime,AmountMoney)createtables
5、ellChild/*創(chuàng)建醫(yī)藥銷售子表*/(SaleNointconstraintSC_PRIMPRIMARYKEY,MedicineCodechar(6)FOREIGNKEYREFERENCESMedInfor(MedicineCode),MedicineNamevarchar(32)NOTNULL,PriceMoney,NumberInt,Uintchar(8),AmountMoney)/*插入數(shù)據(jù)的存儲(chǔ)過程*/createprocMedID_proc@MedKindeCodechar(10),@KindExplanationvarchar(
6、12)asinsertintoMedID(MedKindeCode,KindExplanation)values(@MedKindeCode,@KindExplanation)execMedID_proc'0001','口腔潰瘍'execMedID_proc'0002','感冒'execMedID_proc'0003','發(fā)燒'execMedID_proc'0004','拉肚子'execMedID_proc'0005','外傷'createprocMedInfor_proc@MedicineCodechar(6),@MedicineNameva
7、rchar(8),@MedKindeCodechar(10),@Pricemoney,@ListPricemoney,@Numberint,@FirmCodechar(10),@UserfulllifeDatetimeasinsertintoMedInfor(MedicineCode,MedicineName,MedKindeCode,Price,ListPrice,Number,Supplicer,Userfulllife)values(@MedicineCode,@MedicineName,@MedKindeCode,@Price,@Lis
8、tPrice,@Number,@FirmCode,@Userfulllife)execMedInfor_proc'1001','板藍(lán)根','0002'