PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "AREA_CODE_STATE" (
"area_code" INT,
"state" VARCHAR(2) UNIQUE,
PRIMARY KEY ("area_code")
);

CREATE TABLE "VOTES" (
"vote_id" INT,
"state" VARCHAR(2),
PRIMARY KEY ("vote_id"),
FOREIGN KEY ("state") REFERENCES "AREA_CODE_STATE"("state")
);





INSERT INTO "AREA_CODE_STATE" VALUES ("201", "NJ");
INSERT INTO "AREA_CODE_STATE" VALUES ("202", "DC");
INSERT INTO "AREA_CODE_STATE" VALUES ("203", "CT");
INSERT INTO "AREA_CODE_STATE" VALUES ("205", "AL");
INSERT INTO "AREA_CODE_STATE" VALUES ("206", "WA");
INSERT INTO "AREA_CODE_STATE" VALUES ("207", "ME");
INSERT INTO "AREA_CODE_STATE" VALUES ("208", "ID");
INSERT INTO "AREA_CODE_STATE" VALUES ("989", "MI");
INSERT INTO "AREA_CODE_STATE" VALUES ("999", "XX");
INSERT INTO "VOTES" VALUES ("1", "NJ");
INSERT INTO "VOTES" VALUES ("2", "DC");
INSERT INTO "VOTES" VALUES ("3", "CT");
INSERT INTO "VOTES" VALUES ("4", "AL");
INSERT INTO "VOTES" VALUES ("5", "WA");
INSERT INTO "VOTES" VALUES ("6", "ME");
INSERT INTO "VOTES" VALUES ("7", "ID");
INSERT INTO "VOTES" VALUES ("8", "CA");
INSERT INTO "VOTES" VALUES ("9", "MI");
INSERT INTO "VOTES" VALUES ("10", "NJ");
INSERT INTO "VOTES" VALUES ("11", "DC");
INSERT INTO "VOTES" VALUES ("12", "XX");