-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.log
69 lines (69 loc) · 3.33 KB
/
test.log
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
/*C16*/SET SCHEMA PUBLIC
CONNECT USER SA
/*C17*/SET SCHEMA PUBLIC
CONNECT USER SA
/*C18*/SET SCHEMA PUBLIC
CONNECT USER SA
/*C16*/alter table CustomerLog drop constraint FKF9C9DE66EE46F0F8
alter table CustomerLog drop constraint FKF9C9DE66610B879
alter table Ship drop constraint FK274E5CB9F6455C
alter table Ship drop constraint FK274E5C8856B03F
alter table Voyage drop constraint FK9915703F383DAF58
drop table Customer if exists
drop table CustomerLog if exists
drop table Nationry if exists
drop table Ship if exists
drop table ShippingCompany if exists
drop table Voyage if exists
create table Customer (id bigint generated by default as identity (start with 1), PSBString varchar(255), beginningDate date, birthday date, expirationDate date, idcardNum varchar(30) not null, nativePlace varchar(255), residentialAddress varchar(255), sex integer, primary key (id), unique (idcardNum))
create table CustomerLog (id bigint generated by default as identity (start with 1), embarkingDate date, customer_id bigint, voyage_id bigint, primary key (id))
create table Nationry (rybh bigint not null, idcardNum varchar(30) not null, primary key (rybh), unique (idcardNum))
create table Ship (id bigint generated by default as identity (start with 1), capacity integer not null, name varchar(255) not null, SHIPPINGCOMPANY_ID bigint, SHIP_SHIPPINGCOMPANY_ID bigint, primary key (id), unique (name))
create table ShippingCompany (id bigint generated by default as identity (start with 1), legalRepresentative varchar(255), name varchar(255) not null, primary key (id), unique (name))
create table Voyage (id bigint generated by default as identity (start with 1), arriveTime date, leaveTime date, status integer, SHIP_ID bigint not null, primary key (id))
alter table CustomerLog add constraint FKF9C9DE66EE46F0F8 foreign key (voyage_id) references Voyage
alter table CustomerLog add constraint FKF9C9DE66610B879 foreign key (customer_id) references Customer
alter table Ship add constraint FK274E5CB9F6455C foreign key (SHIPPINGCOMPANY_ID) references ShippingCompany
alter table Ship add constraint FK274E5C8856B03F foreign key (SHIP_SHIPPINGCOMPANY_ID) references ShippingCompany
alter table Voyage add constraint FK9915703F383DAF58 foreign key (SHIP_ID) references Ship
SET AUTOCOMMIT FALSE
INSERT INTO SHIPPINGCOMPANY VALUES(1,'yoouu','Zoerm')
INSERT INTO SHIPPINGCOMPANY VALUES(2,'Bomeo','KaSeil')
INSERT INTO SHIPPINGCOMPANY VALUES(3,'sophera','Jeeei')
INSERT INTO SHIPPINGCOMPANY VALUES(4,'jozzn','Sujeen')
INSERT INTO SHIP VALUES(1,100,'Tenicsam',3,NULL)
INSERT INTO SHIP VALUES(2,200,'Ghoist',3,NULL)
INSERT INTO SHIP VALUES(3,3,'Seewt',2,NULL)
INSERT INTO SHIP VALUES(4,2,'Boanrr',4,NULL)
INSERT INTO SHIP VALUES(5,1,'Zoddow',1,NULL)
INSERT INTO SHIP VALUES(6,403,'Reock',1,NULL)
COMMIT
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
INSERT INTO VOYAGE VALUES(1,NULL,NULL,0,1)
COMMIT
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
INSERT INTO VOYAGE VALUES(2,NULL,NULL,0,5)
COMMIT
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
INSERT INTO VOYAGE VALUES(3,NULL,NULL,0,5)
COMMIT
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE