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", "Bob Smith");
INSERT INTO "CONTESTANTS" VALUES ("3", "Charlie Davis");
INSERT INTO "CONTESTANTS" VALUES ("4", "Diana Evans");
INSERT INTO "CONTESTANTS" VALUES ("5", "Ethan Brown");
INSERT INTO "CONTESTANTS" VALUES ("6", "Fiona Clark");
INSERT INTO "CONTESTANTS" VALUES ("7", "George Harris");
INSERT INTO "CONTESTANTS" VALUES ("8", "Hannah Lee");
INSERT INTO "CONTESTANTS" VALUES ("9", "Ian Martinez");
INSERT INTO "CONTESTANTS" VALUES ("10", "Julia Nelson");
INSERT INTO "VOTES" VALUES ("101", "5551234", "CA", "1");
INSERT INTO "VOTES" VALUES ("102", "5552345", "NY", "2");
INSERT INTO "VOTES" VALUES ("103", "5553456", "TX", "3");
INSERT INTO "VOTES" VALUES ("104", "5554567", "FL", "4");
INSERT INTO "VOTES" VALUES ("105", "5555678", "WA", "5");
INSERT INTO "VOTES" VALUES ("106", "5556789", "NV", "6");
INSERT INTO "VOTES" VALUES ("107", "5557890", "OR", "7");
INSERT INTO "VOTES" VALUES ("108", "5558901", "IL", "8");
INSERT INTO "VOTES" VALUES ("109", "5559012", "GA", "9");
INSERT INTO "VOTES" VALUES ("110", "5550123", "MI", "10");
INSERT INTO "VOTES" VALUES ("111", "5551235", "CA", "1");
INSERT INTO "VOTES" VALUES ("112", "5552346", "NY", "2");
INSERT INTO "VOTES" VALUES ("113", "5553457", "TX", "3");
INSERT INTO "VOTES" VALUES ("114", "5554568", "FL", "4");
INSERT INTO "VOTES" VALUES ("115", "5555679", "WA", "5");
INSERT INTO "VOTES" VALUES ("116", "5556790", "NV", "6");
INSERT INTO "VOTES" VALUES ("117", "5557891", "OR", "7");
INSERT INTO "VOTES" VALUES ("118", "5558902", "IL", "8");
INSERT INTO "VOTES" VALUES ("119", "5559013", "GA", "9");
INSERT INTO "VOTES" VALUES ("120", "5550124", "MI", "10");