forked from Mercy-akuma/2022-Summer-Research
-
Notifications
You must be signed in to change notification settings - Fork 0
/
database_code.txt
59 lines (51 loc) · 1.53 KB
/
database_code.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
//新建一个transaction数据库
drop database if exists transaction;
create database transaction;
//在transaction数据库里面建立User表
use transaction;
drop table if exists User;
create table User(
UID int not null auto_increment primary key,
Name varchar(16) not null,
Password varchar(64) not null,
Role char(6) not null,
Pricecoefficient decimal(6,3),
Sensitivity decimal(6,3)
);
//在transaction数据库里面建立Dataset表
drop table if exists Dataset;
create table Dataset(
DID int not null auto_increment primary key,
Name varchar(32) not null,
Owner varchar(16) not null,
Field varchar(16) not null,
Size int not null,
Keywords varchar(64) not null,
CreateDate datetime not null,
SaleNum int not null,
State tinyint not null,
PriceStrategy varchar(16) not null,
BasePrice decimal(10,3) not null
);
//在transaction数据库里面建立Order表
drop table if exists Order_table;
create table Order_table(
OID int not null auto_increment primary key,
DName varchar(32) not null,
Seller varchar(16) not null,
Buyer varchar(16) not null,
CreateDate datetime not null,
UCAPrice decimal(10,3) not null,
SaleDataNum int not null,
AccessDataNum int not null,
Pricecoefficient decimal(6,3) not null,
Sensitivity decimal(6,3) not null,
TotalCompleteness decimal(6,3) not null,
PriceStrategy varchar(16) not null,
Price decimal(10,3) not null,
SQLquery varchar(128),
QueryQuality float
);
//初始注册一个Role是Admin的用户
insert into User(Name,Password,Role) value("root","123","Admin");
//其他用户的注册通过网站前端来注册