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 "CONTESTANTS" (
"contestant_number" INT UNIQUE,
"contestant_name" VARCHAR(50),
PRIMARY KEY ("contestant_number")
);

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





INSERT INTO "CONTESTANTS" VALUES ("1", "Alice Johnson");
INSERT INTO "CONTESTANTS" VALUES ("2", "Caleb Smith");
INSERT INTO "CONTESTANTS" VALUES ("3", "Malcolm Reed");
INSERT INTO "CONTESTANTS" VALUES ("4", "Sally Fields");
INSERT INTO "CONTESTANTS" VALUES ("5", "Robert Allen");
INSERT INTO "CONTESTANTS" VALUES ("6", "Diana Prince");
INSERT INTO "CONTESTANTS" VALUES ("7", "Alfred Nobel");
INSERT INTO "CONTESTANTS" VALUES ("8", "Paul Walker");
INSERT INTO "CONTESTANTS" VALUES ("9", "Eleanor Rigby");
INSERT INTO "CONTESTANTS" VALUES ("10", "Alan Turing");
INSERT INTO "VOTES" VALUES ("101", "5551234", "CA", "1");
INSERT INTO "VOTES" VALUES ("102", "5555678", "NY", "2");
INSERT INTO "VOTES" VALUES ("103", "5558765", "TX", "3");
INSERT INTO "VOTES" VALUES ("104", "5554321", "FL", "4");
INSERT INTO "VOTES" VALUES ("105", "5556789", "CA", "5");
INSERT INTO "VOTES" VALUES ("106", "5559876", "WA", "6");
INSERT INTO "VOTES" VALUES ("107", "5553456", "NY", "7");
INSERT INTO "VOTES" VALUES ("108", "5556543", "TX", "8");
INSERT INTO "VOTES" VALUES ("109", "5557890", "FL", "9");
INSERT INTO "VOTES" VALUES ("110", "5550987", "CA", "10");
INSERT INTO "VOTES" VALUES ("111", "5551111", "CA", "1");
INSERT INTO "VOTES" VALUES ("112", "5552222", "NY", "7");
INSERT INTO "VOTES" VALUES ("113", "5553333", "TX", "10");
INSERT INTO "VOTES" VALUES ("114", "5554444", "FL", "5");
INSERT INTO "VOTES" VALUES ("115", "5555555", "WA", "3");