CREATE TABLE "borders"
(
    Country1 TEXT default '' not null
        constraint borders_ibfk_1
            references country,
    Country2 TEXT default '' not null
        constraint borders_ibfk_2
            references country,
    Length   REAL,
    primary key (Country1, Country2)
);
borders
CREATE TABLE "city"
(
    Name       TEXT default '' not null,
    Country    TEXT default '' not null
        constraint city_ibfk_1
            references country
            on update cascade on delete cascade,
    Province   TEXT default '' not null,
    Population INTEGER,
    Longitude  REAL,
    Latitude   REAL,
    primary key (Name, Province),
    constraint city_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
city
CREATE TABLE "continent"
(
    Name TEXT default '' not null
        primary key,
    Area REAL
);
continent
CREATE TABLE "country"
(
    Name       TEXT            not null
        constraint ix_county_Name
            unique,
    Code       TEXT default '' not null
        primary key,
    Capital    TEXT,
    Province   TEXT,
    Area       REAL,
    Population INTEGER
);
country
CREATE TABLE "desert"
(
    Name      TEXT default '' not null
        primary key,
    Area      REAL,
    Longitude REAL,
    Latitude  REAL
);
desert
CREATE TABLE "economy"
(
    Country     TEXT default '' not null
        primary key
        constraint economy_ibfk_1
            references country
            on update cascade on delete cascade,
    GDP         REAL,
    Agriculture REAL,
    Service     REAL,
    Industry    REAL,
    Inflation   REAL
);
economy
CREATE TABLE "encompasses"
(
    Country    TEXT not null
        constraint encompasses_ibfk_1
            references country
            on update cascade on delete cascade,
    Continent  TEXT not null
        constraint encompasses_ibfk_2
            references continent
            on update cascade on delete cascade,
    Percentage REAL,
    primary key (Country, Continent)
);
encompasses
CREATE TABLE "ethnicGroup"
(
    Country    TEXT default '' not null
        constraint ethnicGroup_ibfk_1
            references country
            on update cascade on delete cascade,
    Name       TEXT default '' not null,
    Percentage REAL,
    primary key (Name, Country)
);
ethnicGroup
CREATE TABLE "geo_desert"
(
    Desert   TEXT default '' not null
        constraint geo_desert_ibfk_3
            references desert
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_desert_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, Desert),
    constraint geo_desert_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_desert
CREATE TABLE "geo_estuary"
(
    River    TEXT default '' not null
        constraint geo_estuary_ibfk_3
            references river
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_estuary_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, River),
    constraint geo_estuary_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_estuary
CREATE TABLE "geo_island"
(
    Island   TEXT default '' not null
        constraint geo_island_ibfk_3
            references island
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_island_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, Island),
    constraint geo_island_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_island
CREATE TABLE "geo_lake"
(
    Lake     TEXT default '' not null
        constraint geo_lake_ibfk_3
            references lake
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_lake_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, Lake),
    constraint geo_lake_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_lake
CREATE TABLE "geo_mountain"
(
    Mountain TEXT default '' not null
        constraint geo_mountain_ibfk_3
            references mountain
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_mountain_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, Mountain),
    constraint geo_mountain_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_mountain
CREATE TABLE "geo_river"
(
    River    TEXT default '' not null
        constraint geo_river_ibfk_3
            references river
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_river_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, River),
    constraint geo_river_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_river
CREATE TABLE "geo_sea"
(
    Sea      TEXT default '' not null
        constraint geo_sea_ibfk_3
            references sea
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_sea_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, Sea),
    constraint geo_sea_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_sea
CREATE TABLE "geo_source"
(
    River    TEXT default '' not null
        constraint geo_source_ibfk_3
            references river
            on update cascade on delete cascade,
    Country  TEXT default '' not null
        constraint geo_source_ibfk_1
            references country
            on update cascade on delete cascade,
    Province TEXT default '' not null,
    primary key (Province, Country, River),
    constraint geo_source_ibfk_2
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
geo_source
CREATE TABLE "island"
(
    Name      TEXT default '' not null
        primary key,
    Islands   TEXT,
    Area      REAL,
    Height    REAL,
    Type      TEXT,
    Longitude REAL,
    Latitude  REAL
);
island
CREATE TABLE "islandIn"
(
    Island TEXT
        constraint islandIn_ibfk_4
            references island
            on update cascade on delete cascade,
    Sea    TEXT
        constraint islandIn_ibfk_3
            references sea
            on update cascade on delete cascade,
    Lake   TEXT
        constraint islandIn_ibfk_1
            references lake
            on update cascade on delete cascade,
    River  TEXT
        constraint islandIn_ibfk_2
            references river
            on update cascade on delete cascade
);
islandIn
CREATE TABLE "isMember"
(
    Country      TEXT default '' not null
        constraint isMember_ibfk_1
            references country
            on update cascade on delete cascade,
    Organization TEXT default '' not null
        constraint isMember_ibfk_2
            references organization
            on update cascade on delete cascade,
    Type         TEXT default 'member',
    primary key (Country, Organization)
);
isMember
CREATE TABLE "lake"
(
    Name      TEXT default '' not null
        primary key,
    Area      REAL,
    Depth     REAL,
    Altitude  REAL,
    Type      TEXT,
    River     TEXT,
    Longitude REAL,
    Latitude  REAL
);
lake
CREATE TABLE "language"
(
    Country    TEXT default '' not null
        constraint language_ibfk_1
            references country
            on update cascade on delete cascade,
    Name       TEXT default '' not null,
    Percentage REAL,
    primary key (Name, Country)
);
language
CREATE TABLE "located"
(
    City     TEXT,
    Province TEXT,
    Country  TEXT
        constraint located_ibfk_1
            references country
            on update cascade on delete cascade,
    River    TEXT
        constraint located_ibfk_3
            references river
            on update cascade on delete cascade,
    Lake     TEXT
        constraint located_ibfk_4
            references lake
            on update cascade on delete cascade,
    Sea      TEXT
        constraint located_ibfk_5
            references sea
            on update cascade on delete cascade,
    constraint located_ibfk_2
        foreign key (City, Province) references city
            on update cascade on delete cascade,
    constraint located_ibfk_6
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
located
CREATE TABLE "locatedOn"
(
    City     TEXT default '' not null,
    Province TEXT default '' not null,
    Country  TEXT default '' not null
        constraint locatedOn_ibfk_1
            references country
            on update cascade on delete cascade,
    Island   TEXT default '' not null
        constraint locatedOn_ibfk_2
            references island
            on update cascade on delete cascade,
    primary key (City, Province, Country, Island),
    constraint locatedOn_ibfk_3
        foreign key (City, Province) references city
            on update cascade on delete cascade,
    constraint locatedOn_ibfk_4
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
locatedOn
CREATE TABLE "mergesWith"
(
    Sea1 TEXT default '' not null
        constraint mergesWith_ibfk_1
            references sea
            on update cascade on delete cascade,
    Sea2 TEXT default '' not null
        constraint mergesWith_ibfk_2
            references sea
            on update cascade on delete cascade,
    primary key (Sea1, Sea2)
);
mergesWith
CREATE TABLE "mountain"
(
    Name      TEXT default '' not null
        primary key,
    Mountains TEXT,
    Height    REAL,
    Type      TEXT,
    Longitude REAL,
    Latitude  REAL
);
mountain
CREATE TABLE "mountainOnIsland"
(
    Mountain TEXT default '' not null
        constraint mountainOnIsland_ibfk_2
            references mountain
            on update cascade on delete cascade,
    Island   TEXT default '' not null
        constraint mountainOnIsland_ibfk_1
            references island
            on update cascade on delete cascade,
    primary key (Mountain, Island)
);
mountainOnIsland
CREATE TABLE "organization"
(
    Abbreviation TEXT not null
        primary key,
    Name         TEXT not null
        constraint ix_organization_OrgNameUnique
            unique,
    City         TEXT,
    Country      TEXT
        constraint organization_ibfk_1
            references country
            on update cascade on delete cascade,
    Province     TEXT,
    Established  DATE,
    constraint organization_ibfk_2
        foreign key (City, Province) references city
            on update cascade on delete cascade,
    constraint organization_ibfk_3
        foreign key (Province, Country) references province
            on update cascade on delete cascade
);
organization
CREATE TABLE "politics"
(
    Country      TEXT default '' not null
        primary key
        constraint politics_ibfk_1
            references country
            on update cascade on delete cascade,
    Independence DATE,
    Dependent    TEXT
        constraint politics_ibfk_2
            references country
            on update cascade on delete cascade,
    Government   TEXT
);
politics
CREATE TABLE "population"
(
    Country           TEXT default '' not null
        primary key
        constraint population_ibfk_1
            references country
            on update cascade on delete cascade,
    Population_Growth REAL,
    Infant_Mortality  REAL
);
population
CREATE TABLE "province"
(
    Name       TEXT not null,
    Country    TEXT not null
        constraint province_ibfk_1
            references country
            on update cascade on delete cascade,
    Population INTEGER,
    Area       REAL,
    Capital    TEXT,
    CapProv    TEXT,
    primary key (Name, Country)
);
province
CREATE TABLE "religion"
(
    Country    TEXT default '' not null
        constraint religion_ibfk_1
            references country
            on update cascade on delete cascade,
    Name       TEXT default '' not null,
    Percentage REAL,
    primary key (Name, Country)
);
religion
CREATE TABLE "river"
(
    Name             TEXT default '' not null
        primary key,
    River            TEXT,
    Lake             TEXT
        constraint river_ibfk_1
            references lake
            on update cascade on delete cascade,
    Sea              TEXT,
    Length           REAL,
    SourceLongitude  REAL,
    SourceLatitude   REAL,
    Mountains        TEXT,
    SourceAltitude   REAL,
    EstuaryLongitude REAL,
    EstuaryLatitude  REAL
);
river
CREATE TABLE "sea"
(
    Name  TEXT default '' not null
        primary key,
    Depth REAL
);
sea
CREATE TABLE "target"
(
    Country TEXT not null
        primary key
        constraint target_Country_fkey
            references country
            on update cascade on delete cascade,
    Target  TEXT
);
target
original_column_name,column_name,column_description,data_format,value_description
City,,the name of the city,text,
Province,, the province where the city belongs to,text,
Country,,the country code where the city belongs to,text,
Island,, the island it is (maybe only partially) located on,text,
locatedOn
original_column_name,column_name,column_description,data_format,value_description
Name,,the name of the administrative division,text,
Country,, the country code where it belongs to,text,
Area,,"the total area of the province,",integer,
Population,,the population of the province,real,
Capital,,the name of the capital,text,"if null, doesn't have capital"
CapProv,capital province,the name of the province where the capital belongs to,text,"commonsense evidence:

note that capprov is not necessarily equal to name"
province
original_column_name,column_name,column_description,data_format,value_description
Sea,,the name of the sea,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_sea
original_column_name,column_name,column_description,data_format,value_description
Country,,the country code,text,
Name,,name of the language,text,
Percentage,,percentage of the language in this country,real,%
language
original_column_name,column_name,column_description,data_format,value_description
Island,,,text,
Sea,,,text,
Lake,,,text,
River,,,text,
islandIn
original_column_name,column_name,column_description,data_format,value_description
Name,,the name of the mountain,text,
Mountains,,the mountains where it belongs to,text,
Height,, the maximal elevation of the summit of the mountain,real,
Type,, the sea where it finally flows to,text,"(note that at most one out of {river,lake,sea} can be non-null"
Longitude,,the length of the river,real,
Latitude,,the longitude of its source,real,
mountain
original_column_name,column_name,column_description,data_format,value_description
Country,,the country code,text,
Population_Growth,population growth,population growth rate,real,per annum
Infant_Mortality,infant mortality, infant mortality,real,per thousand
population
original_column_name,column_name,column_description,data_format,value_description
City,,the name of the city,text,
Country,,the country code where the city belongs to,text,
Province,,the province where the city belongs to,text,
River,, the river where it is located at,text,
Lake,,the lake where it is located at,text,
Sea,,the sea where it is located at,text,"Note that for a given city, there can be several lakes/seas/rivers where it is located at."
located
original_column_name,column_name,column_description,data_format,value_description
Country,,the country code,text,
Name,,name of the language,text,
Percentage,,percentage of the language in this country.,real,%
ethnicGroup
original_column_name,column_name,column_description,data_format,value_description
Country,,,text,
Organization,,,text,
Type,,,text,
isMember
original_column_name,column_name,column_description,data_format,value_description
Country,,the country code,text,
Name,,name of the religion,text,
Percentage,,percentage of the language in this country,real,%
religion
original_column_name,column_name,column_description,data_format,value_description
Country,,a country code,text,
Continent,,the continent name.,text,
Percentage,,how much of the area of a country belongs to the continent,real,%
encompasses
original_column_name,column_name,column_description,data_format,value_description
Name,,name of city,text,
Country,,the code of the country where it belongs to,text,
Province,,the name of the province where it belongs to,text,
Population,,population of the city,integer,
Longitude,,geographic longitude,real,
Latitude,,geographic latitude,real,
city
original_column_name,column_name,column_description,data_format,value_description
Name,,the name of the island,text,
Islands,,the group of islands where it belongs to,text,
Area,,the area of the island,real,
Height,,the maximal elevation of the island,real,
Type,, the type of the island,text,
Longitude,,Longitude,real,
Latitude,,Latitude,real,
island
original_column_name,column_name,column_description,data_format,value_description
Island,,the name of the island,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_island
original_column_name,column_name,column_description,data_format,value_description
Mountain,,the name of the mountain,text,
Island,,the name of the island,text,
mountainonisland
original_column_name,column_name,column_description,data_format,value_description
River,,the name of the river,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_source
original_column_name,column_name,column_description,data_format,value_description
Sea1,,the name of the mountain,text,
Sea2,,the country code where it is located,text,
mergeswith
original_column_name,column_name,column_description,data_format,value_description
Country,,the country code,text,
GDP,gross domestic product,gross domestic product,real,
Agriculture,,percentage of agriculture of the GDP,real,
Service,,"percentage of services of the GDP,",real,
Industry,,percentage of industry of the GDP,real,
Inflation,,"inflation rate (per annum),",real,
economy
original_column_name,column_name,column_description,data_format,value_description
Country,,,text,
Target,,,real,
target
original_column_name,column_name,column_description,data_format,value_description
Name,,the name of the river,text,
River,,the river where it finally flows to,text,
Lake,,the lake where it finally flows to,text,
Sea,, the sea where it finally flows to,text,"(note that at most one out of {river,lake,sea} can be non-null"
Length,,the length of the river,real,
SourceLongitude,,the longitude of its source,real,
SourceLatitude,,the latitude of its source,real,
Mountains,,the mountains where its source is located,text,
SourceAltitude,, the elevation (above sea level) of its source,real,
EstuaryLongitude,,the coordinates of its estuary,real,
EstuaryLatitude,,the latitude of its estuary,real,
river
original_column_name,column_name,column_description,data_format,value_description
River,,the name of the river,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_river
original_column_name,column_name,column_description,data_format,value_description
Name,,the name of the lake,text,
Area,,the total area of the lake,real,
Depth,, the depth of the lake,real,
Altitude,,the altitude (above sea level) of the lake,real,
River,,the river that flows out of the lake,text,
Type,,the type of the lake,text,
Longitude,,longitude of lake ,real,
Latitude,,latitude of lake ,real,
lake
original_column_name,column_name,column_description,data_format,value_description
Name,,the name of the desert,text,
Area,,the total area of the desert,real,
Longitude,,Longitude,real,
Latitude,,Latitude,real,"commonsense evidence:

coordinate: (Longitude, Latitude)"
desert
original_column_name,column_name,column_description,data_format,value_description
Name,,the name of the sea,text,
Depth,,the maximal depth of the sea,real,
sea
original_column_name,column_name,column_description,data_format,value_description
River,,the name of the river,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_estuary
original_column_name,column_name,column_description,data_format,value_description
Name,,name of the continent,text,
Area,,total area of the continent.,real,
continent
original_column_name,column_name,column_description,data_format,value_description
Lake,,the name of the lake,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_lake
original_column_name,column_name,column_description,data_format,value_description
Name,,the country name,text,
Code,,country code,text,
Capital,,"the name of the capital,",text,
Province,,"the province where the capital belongs to,",text,
Area,,"the total area,",real,
Population,,the population number.,integer,
country
original_column_name,column_name,column_description,data_format,value_description
Country,,the country code,text,
Independence,,date of independence,date,"Commonsense evidence:

if the value is null or empty, it means this country is not independent"
Dependent,, the country code where the area belongs to,text,
Government,,type of government,text,
politics
original_column_name,column_name,column_description,data_format,value_description
Desert,,the name of the desert,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_desert
original_column_name,column_name,column_description,data_format,value_description
Abbreviation,, its abbreviation,text,
Name,,the full name of the organization,text,
City,,the city where the headquarters are located,text,
Country,, the code of the country where the headquarters are located,text,
Province,,"the name of the province where the headquarters are located,",text,
Established,,date of establishment,date,
organization
original_column_name,column_name,column_description,data_format,value_description
Mountain,,the name of the mountain,text,
Country,,the country code where it is located,text,
Province,,the province of this country,text,
geo_mountain
original_column_name,column_name,column_description,data_format,value_description
Country1,,a country code,text,
Country2,,a country code,text,
Length,,length of the border between country1 and country2,real,
borders