forked from mike1226/SpringMVCExample-01
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathddl.sql
More file actions
68 lines (58 loc) · 1.82 KB
/
ddl.sql
File metadata and controls
68 lines (58 loc) · 1.82 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
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
CREATE TABLE Country (
MstCountryCD varchar(10) NOT NULL,
MstCountryNanme varchar(20),
UpdateDt DECIMAL(10),
DeleteDt DECIMAL(10)
);
ALTER TABLE Country ADD CONSTRAINT PK_Country PRIMARY KEY (MstCountryCD);
CREATE TABLE Province (
ProvCode varchar(10) NOT NULL,
MstCountryCD varchar(10) NOT NULL,
ProvName varchar(20) NOT NULL
);
ALTER TABLE Province ADD CONSTRAINT PK_Province PRIMARY KEY (ProvCode,MstCountryCD);
ALTER TABLE Province ADD CONSTRAINT FK_Province_0 FOREIGN KEY (MstCountryCD) REFERENCES Country (MstCountryCD);
INSERT INTO Country (MstCountryNanme,MstCountryCD)
VALUES
('Poland','5492'),
('Singapore','6721'),
('Netherlands','2173'),
('Brazil','1713'),
('Philippines','4521'),
('Austria','9357'),
('Costa Rica','5827'),
('Poland','5657'),
('Nigeria','7672'),
('Italy','1451'),
('Ukraine','4222'),
('South Korea','6217'),
('South Africa','3738'),
('India','3489'),
('Brazil','7026');
INSERT INTO Province (ProvName,ProvCode,MstCountryCD)
VALUES
('Gilgit Baltistan','48273','5492'),
('Voronezh Oblast','66361','5492'),
('Xīnán','668562','5492'),
('Utah','854524','5492'),
('Lào Cai','15481275','5492'),
('New South Wales','8564KR','5492'),
('Junín','61142161','5492'),
('Guerrero','8851','5492'),
('Lima','89075','5492'),
('Oost-Vlaanderen','A8V1B5','5492'),
('West-Vlaanderen','24514','5492'),
('Bremen','14261','5492'),
('Saskatchewan','47264868','5492'),
('Małopolskie','38845','5492'),
('Kaliningrad Oblast','7875','5492'),
('Gilgit Baltistan','388423','3489'),
('Katsina','17151','3489'),
('Limburg','4573','3489'),
('Gyeonggi','92225','3489'),
('Cartago','387768','3489'),
('Paraíba','33751','3489'),
('Pernambuco','28123','3489'),
('South Island','802342','3489'),
('Gauteng','44116','3489'),
('New South Wales','1273212','3489');