/
world_database
71 lines (65 loc) · 4.79 KB
/
world_database
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
70
Table "public.city"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
-------------+--------------+-----------+----------+---------+----------+--------------+-------------
id | integer | | not null | | plain | |
name | text | | not null | | extended | |
countrycode | character(3) | | not null | | extended | |
district | text | | not null | | extended | |
population | integer | | not null | | plain | |
Indexes:
"city_pkey" PRIMARY KEY, btree (id)
Referenced by:
TABLE "country" CONSTRAINT "country_capital_fkey" FOREIGN KEY (capital) REFERENCES city(id)
Index "public.city_pkey"
Column | Type | Key? | Definition | Storage | Stats target
--------+---------+------+------------+---------+--------------
id | integer | yes | id | plain |
primary key, btree, for table "public.city"
Table "public.country"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
----------------+---------------+-----------+----------+---------+----------+--------------+-------------
code | character(3) | | not null | | extended | |
name | text | | not null | | extended | |
continent | text | | not null | | extended | |
region | text | | not null | | extended | |
surfacearea | real | | not null | | plain | |
indepyear | smallint | | | | plain | |
population | integer | | not null | | plain | |
lifeexpectancy | real | | | | plain | |
gnp | numeric(10,2) | | | | main | |
gnpold | numeric(10,2) | | | | main | |
localname | text | | not null | | extended | |
governmentform | text | | not null | | extended | |
headofstate | text | | | | extended | |
capital | integer | | | | plain | |
code2 | character(2) | | not null | | extended | |
Indexes:
"country_pkey" PRIMARY KEY, btree (code)
Check constraints:
"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)
Foreign-key constraints:
"country_capital_fkey" FOREIGN KEY (capital) REFERENCES city(id)
Referenced by:
TABLE "countrylanguage" CONSTRAINT "countrylanguage_countrycode_fkey" FOREIGN KEY (countrycode) REFERENCES country(code)
Index "public.country_pkey"
Column | Type | Key? | Definition | Storage | Stats target
--------+--------------+------+------------+----------+--------------
code | character(3) | yes | code | extended |
primary key, btree, for table "public.country"
Table "public.countrylanguage"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
-------------+--------------+-----------+----------+---------+----------+--------------+-------------
countrycode | character(3) | | not null | | extended | |
language | text | | not null | | extended | |
isofficial | boolean | | not null | | plain | |
percentage | real | | not null | | plain | |
Indexes:
"countrylanguage_pkey" PRIMARY KEY, btree (countrycode, language)
Foreign-key constraints:
"countrylanguage_countrycode_fkey" FOREIGN KEY (countrycode) REFERENCES country(code)
Index "public.countrylanguage_pkey"
Column | Type | Key? | Definition | Storage | Stats target
-------------+--------------+------+-------------+----------+--------------
countrycode | character(3) | yes | countrycode | extended |
language | text | yes | language | extended |
primary key, btree, for table "public.countrylanguage"