-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathManageSystem.sql
More file actions
35 lines (28 loc) · 1.03 KB
/
ManageSystem.sql
File metadata and controls
35 lines (28 loc) · 1.03 KB
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
create schema if not exists ManageSystem collate utf8mb4_0900_ai_ci;
create table if not exists ASSET
(
id int not null #资产id
primary key,
name varchar(11) null,
total int null
);
create table if not exists USER_ASSET
(
userid int not null, #持有者的id
assetid int not null, #持有的库存id
total int null, #所持有的数量
primary key (userid, assetid)
);
create table if not exists User
(
id int not null
primary key,
name varchar(11) not null,
type int not null, #0为普通用户 1为管理员 2为库管
password varchar(15) null
);
INSERT INTO ManageSystem.User (id, name, type, password) VALUES (1, 'oyjp', 1, '123456');
INSERT INTO ManageSystem.User (id, name, type, password) VALUES (2, 'pjl', 2, '123456');
INSERT INTO ManageSystem.User (id, name, type, password) VALUES (777, 'wxc', 0, '123456');
INSERT INTO ManageSystem.ASSET (id, name, total) VALUES (1, 'MacBookPro', 30);
INSERT INTO ManageSystem.USER_ASSET (userid, assetid, total) VALUES (777, 1, 10);