You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/world.sql
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,20 @@ CREATE TABLE city (
20
20
21
21
COMMENT ON COLUMN city.local_name IS 'City local name';
22
22
23
+
CREATETYPEcontinent_enumAS ENUM (
24
+
'Asia',
25
+
'Europe',
26
+
'North America',
27
+
'Africa',
28
+
'Oceania',
29
+
'Antarctica',
30
+
'South America'
31
+
);
32
+
23
33
CREATETABLEcountry (
24
34
code character(3) NOT NULL,
25
35
name textNOT NULL,
26
-
continent textNOT NULL,
36
+
continent continent_enumNOT NULL,
27
37
region textNOT NULL,
28
38
surface_area realNOT NULL,
29
39
indep_year smallint,
@@ -35,8 +45,7 @@ CREATE TABLE country (
35
45
government_form textNOT NULL,
36
46
head_of_state text,
37
47
capital integer,
38
-
code2 character(2) NOT NULL,
39
-
CONSTRAINT country_continent_check CHECK ((((((((continent ='Asia'::text) OR (continent ='Europe'::text)) OR (continent ='North America'::text)) OR (continent ='Africa'::text)) OR (continent ='Oceania'::text)) OR (continent ='Antarctica'::text)) OR (continent ='South America'::text)))
48
+
code2 character(2) NOT NULL
40
49
);
41
50
42
51
COMMENT ON COLUMN country.gnp IS 'GNP is Gross national product';
0 commit comments