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", "Jessie Alloway");
INSERT INTO "CONTESTANTS" VALUES ("2", "Michael Thompson");
INSERT INTO "CONTESTANTS" VALUES ("3", "Anna Rodriguez");
INSERT INTO "CONTESTANTS" VALUES ("4", "David Kim");
INSERT INTO "CONTESTANTS" VALUES ("5", "Samantha Lee");
INSERT INTO "CONTESTANTS" VALUES ("6", "Jessie Alloway");
INSERT INTO "CONTESTANTS" VALUES ("7", "Robert Brown");
INSERT INTO "CONTESTANTS" VALUES ("8", "Emily Davis");
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", "NY", "6");
INSERT INTO "VOTES" VALUES ("107", "5553456", "TX", "7");
INSERT INTO "VOTES" VALUES ("108", "5556543", "FL", "8");
INSERT INTO "VOTES" VALUES ("109", "5551111", "CA", "2");
INSERT INTO "VOTES" VALUES ("110", "5552222", "NY", "3");
INSERT INTO "VOTES" VALUES ("111", "5553333", "TX", "1");
INSERT INTO "VOTES" VALUES ("112", "5554444", "FL", "5");
INSERT INTO "VOTES" VALUES ("113", "5555555", "CA", "7");
INSERT INTO "VOTES" VALUES ("114", "5556666", "NY", "8");
INSERT INTO "VOTES" VALUES ("115", "5557777", "TX", "4");
INSERT INTO "VOTES" VALUES ("116", "5558888", "FL", "3");