{"AREA_CODE_STATE": {"columns": [[0, "area_code", "INTEGER", 1, null, 1], [1, "state", "varchar(2)", 1, null, 0]], "primary_keys": ["area_code"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "CONTESTANTS": {"columns": [[0, "contestant_number", "INTEGER", 0, null, 1], [1, "contestant_name", "varchar(50)", 1, null, 0]], "primary_keys": ["contestant_number"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "VOTES": {"columns": [[0, "vote_id", "INTEGER", 1, null, 1], [1, "phone_number", "INTEGER", 1, null, 0], [2, "state", "varchar(2)", 1, null, 0], [3, "contestant_number", "INTEGER", 1, null, 0], [4, "created", "timestamp", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["vote_id"], "foreign_keys": [[0, 0, "CONTESTANTS", "contestant_number", "contestant_number", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "AREA_CODE_STATE", "state", "state", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE AREA_CODE_STATE (
    area_code INTEGER NOT NULL  PRIMARY KEY,
    state varchar(2) NOT NULL
);

CREATE TABLE CONTESTANTS (
    contestant_number INTEGER   PRIMARY KEY,
    contestant_name varchar(50) NOT NULL
);

CREATE TABLE VOTES (
    vote_id INTEGER NOT NULL  PRIMARY KEY,
    phone_number INTEGER NOT NULL,
    state varchar(2) NOT NULL,
    contestant_number INTEGER NOT NULL,
    created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (contestant_number) REFERENCES CONTESTANTS(contestant_number),
    FOREIGN KEY (state) REFERENCES AREA_CODE_STATE(state)
);