-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathczbsql.txt
155 lines (136 loc) · 2.92 KB
/
czbsql.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
##员工编号 empid
##员工姓名 empname
##证件号 idcard
##性别 sex
##年龄 age
##邮箱 email
##地址 loc
##手机 phone
##入职日期 hiredate
##薪水 sal
##离职日期 leavedate
##职位编号 jobId
##状态 state
create table emp(
empid int PRIMARY key auto_increment,
empname VARCHAR(32),
idcard varchar(32),
sex int,#0代表女1代表男
age int,
email varchar(32),
loc VARCHAR(200),
phone varchar(32),
hiredate varchar(32),
sal varchar(32),
leavedate varchar(32),
jobId VARCHAR(32),
state int #1代表离职2为普通店员3为店长
);
##职位 jobid
##职位名称 jobname
##商店id shopid
create table job(
jobId int PRIMARY key auto_increment,
jobName VARCHAR(32),
shopid int
);
##供应商编号 supplierId
##供应商名称 supplierName
##供应商负责人 representative
##供应商邮件 supplierEmail
##供应商电话 supplierPhone
CREATE table supplier(
supplierId int PRIMARY key auto_increment,
supplierName VARCHAR(32),
representative VARCHAR(32),
supplierEmail VARCHAR(32),
supplierPhone varchar(32)
);
##商品id
## 商品名称
##价格
##商品种类
##供货商id
##描述(备注)
##备用字段1
##备用字段2
create TABLE shopitemdescrip(
shopItemid int PRIMARY key auto_increment,
shopItemname VARCHAR(32) ,
price double,
supplierId int,
shopItemType int,
descrip varchar(1000),
by1 varchar(100),
by2 varchar(100)
);
##商品id
##超市id
##数量
##是否上架
##备用字段1
##备用字段2
create TABLE shopItem(
shopItemid int,
shopid int,
num int ,
ifgrounding int,
by1 varchar(100),
by2 varchar(100)
);
create table user(
id int PRIMARY key auto_increment,
username varchar(32),
password varchar(32),
shopId int
);
##销售编号 saleid
##商店编号 shopid
##商品编号 itemid
##商品种类 itemtype
##销售数量 itemnum
##销售价格 saleprice
##销售日期 saledate
CREATE table salebill(
saleid int PRIMARY key auto_increment,
shopid int ,
itemid int,
itemtype int,
salenum int,
saleprice double,
saledate varchar(20)
);
##商店编号 shopid
##商店名字 shopname
##商店地址 shopaddress
##商店负责人 shopperson
##商店联系方式 shopphone
##商店状态 shopstate
create table shop(
shopid int PRIMARY key auto_increment,
shopname varchar(20) ,
shopaddress varchar(100),
shopperson varchar(20),
shopphone varchar(20),
shopstate varchar(2)
);
##商品种类编号
##商品名称
##父编号
CREATE TABLE `shopitemtype` (
`typeId` int(11) NOT NULL AUTO_INCREMENT,
`typeName` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`parentId` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`typeId`) USING BTREE
);
CREATE table notice(
id int PRIMARY KEY auto_increment,
title VARCHAR(2048),
content VARCHAR(10240),
date varchar(32)
);
CREATE table notice_shop(
id int,
shopid int,
isRead int ##1未读2已读3警告
)