-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrent.sql
55 lines (42 loc) · 1.91 KB
/
rent.sql
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
create database rent;
use rent;
create table fowner(
fId varchar(3) primary key,
fName varchar(10) not null,
fPassword varchar(10) not null,
fSuper int,
fPn varchar(20) not null
);
create table customer(
cId varchar(3) primary key,
cName varchar(10) not null,
cPassword varchar(10) not null,
cSuper int,
cPn varchar(20) not null
);
create table house(
hId varchar(10) primary key,
fId varchar(3) not null,
fName varchar(10) not null,
cId varchar(10),
dz varchar(50) not null,
Pri varchar(5) not null,
hSta int not null,
fPn varchar(20) not null,
foreign key (fId) references fowner (fId)
);
insert into fowner values('000','admin','admin',1,'666666');
insert into fowner values('f01','zhangsan1','zhangsan1',2,'123456');
insert into fowner values('f02','zhangsan2','zhangsan2',2,'123456');
insert into fowner values('f03','zhangsan3','zhangsan3',2,'123456');
insert into fowner values('f04','张三','zhangsan',2,'123456');
insert into fowner values('f05','李四','lisi',2,'123456');
insert into customer values('c01','lisi1','lisi1',2,'23456');
insert into customer values('c02','lisi2','lisi2',2,'23456');
insert into customer values('c03','lisi3','lisi3',2,'23456');
insert into customer values('c04','lisi4','lisi4',2,'23456');
insert into house values('hA01','f01','zhangsan1','c01','湛江霞山绿塘路9号','5000',5,'123456');
insert into house values('hB01','f02','zhangsan2','c02','湛江霞山霞山鼎盛','12000',5,'123456');
insert into house values('hC01','f03','zhangsan3','c03','湛江霞山绿塘路11号','7000',5,'123456');
insert into house values('hC01','f03','张三','null','湛江赤坎区跃进路18号','6000',0,'123456');
insert into house values('hC01','f04','张三','null','湛江赤坎区寸金路9号','5000',0,'123456');