From 4e24f31612479ed2ec6f85a022b4918fde06adda Mon Sep 17 00:00:00 2001 From: onz <1546299812@qq.com> Date: Thu, 8 Oct 2020 17:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jinxiaocun.sql" | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 "\347\216\213\344\273\260\346\226\207/jinxiaocun.sql" diff --git "a/\347\216\213\344\273\260\346\226\207/jinxiaocun.sql" "b/\347\216\213\344\273\260\346\226\207/jinxiaocun.sql" new file mode 100644 index 0000000..cdd1e15 --- /dev/null +++ "b/\347\216\213\344\273\260\346\226\207/jinxiaocun.sql" @@ -0,0 +1,94 @@ +--进销存系统 +create database Invoicing + +go + +use Invoicing +go + +--用户信息表 +--字段:用户id,用户名,用户密码,手机号 +create table UserInfo +( + UserId int primary key identity(1,1), + UserName varchar(10) not null, + UserPwd nvarchar(20) not null, + UserPhone int not null +) +--商品信息表 +--字段:商品id,商品名称,商品生产地,采购商品id,售出商品id +create table CommodityInfo +( + CommodityId int primary key identity(1,1), + CommodityName varchar(20) not null, + CommodityOrigin varchar(80) not null, + ParchaseId int not null, + SaleId int not null +) +--采购信息表 +--字段:采购商品id,采购商品名称,采购商品价格,采购时间 +create table ParchaseInfo +( + ParchaseId int primary key identity(1,1), + CommodityInName varchar(20) not null, + CommodityInPrice decimal not null, + ParchaseTime datetime default(getdate()) +) +--销售信息表 +--字段:售出商品id,售出商品名称,售出商品价格,售出时间 +create table SaleInfo +( + SaleId int primary key identity(1,1), + CommodityOutName varchar(20) not null, + CommodityOutPrine decimal not null, + SaleTime datetime default(getdate()) +) +--库存商品管理表 +--字段:库存商品管理id,采购商品id,入库商品名称,入库时间,售出商品id,出库商品名称,出库时间 +create table StockManage +( + StockManageId int primary key identity(1,1), + ParchaseId int not null, + StockIn varchar(20) not null, + StockInTime datetime default(getdate()), + SaleId int not null, + StockOut varchar(20) not null, + StockOutTime datetime default(getdate()) +) +--库存商品统计表 +--字段:商品统计id,商品入库总数量,商品出库总数量 +create table StockStatistics +( + StockStatisticsId int primary key identity(1,1), + StockInSum int not null, + StockOutSum int not null +) +--物流信息表 +--字段:物流id,采购商品,售出商品,采购商品发货时间,售出商品发货时间,采购商品收货时间,售出商品收货时间,采购商品退货,销售商品退货 +create table LogisticsInfo +( + LogisticsId int primary key identity(1,1), + CommodityIn varchar(20) not null, + CommodityOut varchar(20) not null, + ComIndeliveryTime datetime default(getdate()), + ComOutdeliveryTime datetime default(getdate()), + ComInReceivingTime datetime default(getdate()), + ComOutReceivingTime datetime default(getdate()), + CommodityInReturn varchar(80) not null, + CommodityOutReturn varchar(80) not null +) + + + +--表关系 +alter table CommodityInfo + add constraint FK_CommodityInfo_ParchaseId foreign key(ParchaseId) references ParchaseInfo(ParchaseId) + +alter table CommodityInfo + add constraint FK_CommodityInfo_SaleId foreign key(SaleId) references SaleInfo(SaleId) + +alter table StockManage + add constraint FK_StockManage_ParchaseId foreign key(ParchaseId) references ParchaseInfo(ParchaseId) + +alter table StockManage + add constraint FK_StockManage_SaleId foreign key(SaleId) references SaleInfo(SaleId) \ No newline at end of file -- Gitee