{"state": {"columns": [[0, "state_name", "TEXT", 0, null, 1], [1, "population", "INTEGER", 0, "NULL", 0], [2, "area", "double", 0, "NULL", 0], [3, "country_name", "varchar(3)", 1, "''", 0], [4, "capital", "TEXT", 0, null, 0], [5, "density", "double", 0, "NULL", 0]], "primary_keys": ["state_name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "state_name"]]], "check_constraints": []}, "city": {"columns": [[0, "city_name", "TEXT", 0, null, 1], [1, "population", "INTEGER", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "state_name", "TEXT", 0, null, 2]], "primary_keys": ["city_name", "state_name"], "foreign_keys": [[0, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "city_name"], [1, 3, "state_name"]]], "check_constraints": []}, "border_info": {"columns": [[0, "state_name", "TEXT", 0, null, 2], [1, "border", "TEXT", 0, null, 1]], "primary_keys": ["state_name", "border"], "foreign_keys": [[0, 0, "state", "border", "state_name", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "border"], [1, 0, "state_name"]]], "check_constraints": []}, "highlow": {"columns": [[0, "state_name", "TEXT", 0, null, 1], [1, "highest_elevation", "TEXT", 0, null, 0], [2, "lowest_point", "TEXT", 0, null, 0], [3, "highest_point", "TEXT", 0, null, 0], [4, "lowest_elevation", "TEXT", 0, null, 0]], "primary_keys": ["state_name"], "foreign_keys": [[0, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "state_name"]]], "check_constraints": []}, "lake": {"columns": [[0, "lake_name", "TEXT", 0, null, 0], [1, "area", "double", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "state_name", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "mountain": {"columns": [[0, "mountain_name", "TEXT", 0, null, 1], [1, "mountain_altitude", "INTEGER", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "state_name", "TEXT", 0, null, 2]], "primary_keys": ["mountain_name", "state_name"], "foreign_keys": [[0, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "mountain_name"], [1, 3, "state_name"]]], "check_constraints": []}, "river": {"columns": [[0, "river_name", "TEXT", 0, null, 1], [1, "length", "INTEGER", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "traverse", "TEXT", 0, null, 0]], "primary_keys": ["river_name"], "foreign_keys": [[0, 0, "state", "traverse", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "river_name"]]], "check_constraints": []}}
CREATE TABLE state (
    state_name TEXT   PRIMARY KEY,
    population INTEGER  DEFAULT NULL,
    area double  DEFAULT NULL,
    country_name varchar(3) NOT NULL DEFAULT '',
    capital TEXT,
    density double  DEFAULT NULL,
    UNIQUE (state_name)
);

CREATE TABLE city (
    city_name TEXT   PRIMARY KEY,
    population INTEGER  DEFAULT NULL,
    country_name varchar(3) NOT NULL DEFAULT '',
    state_name TEXT   PRIMARY KEY,
    PRIMARY KEY (city_name, state_name),
    UNIQUE (city_name, state_name),
    FOREIGN KEY (state_name) REFERENCES state(state_name)
);

CREATE TABLE border_info (
    state_name TEXT   PRIMARY KEY,
    border TEXT   PRIMARY KEY,
    PRIMARY KEY (state_name, border),
    UNIQUE (border, state_name),
    FOREIGN KEY (border) REFERENCES state(state_name),
    FOREIGN KEY (state_name) REFERENCES state(state_name)
);

CREATE TABLE highlow (
    state_name TEXT   PRIMARY KEY,
    highest_elevation TEXT,
    lowest_point TEXT,
    highest_point TEXT,
    lowest_elevation TEXT,
    UNIQUE (state_name),
    FOREIGN KEY (state_name) REFERENCES state(state_name)
);

CREATE TABLE lake (
    lake_name TEXT,
    area double  DEFAULT NULL,
    country_name varchar(3) NOT NULL DEFAULT '',
    state_name TEXT
);

CREATE TABLE mountain (
    mountain_name TEXT   PRIMARY KEY,
    mountain_altitude INTEGER  DEFAULT NULL,
    country_name varchar(3) NOT NULL DEFAULT '',
    state_name TEXT   PRIMARY KEY,
    PRIMARY KEY (mountain_name, state_name),
    UNIQUE (mountain_name, state_name),
    FOREIGN KEY (state_name) REFERENCES state(state_name)
);

CREATE TABLE river (
    river_name TEXT   PRIMARY KEY,
    length INTEGER  DEFAULT NULL,
    country_name varchar(3) NOT NULL DEFAULT '',
    traverse TEXT,
    UNIQUE (river_name),
    FOREIGN KEY (traverse) REFERENCES state(state_name)
);