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");
INSERT INTO "CONTESTANTS" VALUES ("2", "Bob");
INSERT INTO "CONTESTANTS" VALUES ("3", "Charlie");
INSERT INTO "CONTESTANTS" VALUES ("4", "David");
INSERT INTO "CONTESTANTS" VALUES ("5", "Eve");
INSERT INTO "CONTESTANTS" VALUES ("6", "Frank");
INSERT INTO "CONTESTANTS" VALUES ("7", "Grace");
INSERT INTO "VOTES" VALUES ("1", "1234567890", "CA", "1");
INSERT INTO "VOTES" VALUES ("2", "1234567891", "NY", "2");
INSERT INTO "VOTES" VALUES ("3", "1234567892", "TX", "1");
INSERT INTO "VOTES" VALUES ("4", "1234567893", "FL", "3");
INSERT INTO "VOTES" VALUES ("5", "1234567894", "CA", "2");
INSERT INTO "VOTES" VALUES ("6", "1234567895", "NY", "4");
INSERT INTO "VOTES" VALUES ("7", "1234567896", "TX", "1");
INSERT INTO "VOTES" VALUES ("8", "1234567897", "FL", "5");
INSERT INTO "VOTES" VALUES ("9", "1234567898", "CA", "3");
INSERT INTO "VOTES" VALUES ("10", "1234567899", "NY", "6");
INSERT INTO "VOTES" VALUES ("11", "1234567900", "TX", "7");
INSERT INTO "VOTES" VALUES ("12", "1234567901", "FL", "1");
INSERT INTO "VOTES" VALUES ("13", "1234567902", "CA", "2");
INSERT INTO "VOTES" VALUES ("14", "1234567903", "NY", "3");
INSERT INTO "VOTES" VALUES ("15", "1234567904", "TX", "4");
INSERT INTO "VOTES" VALUES ("16", "1234567905", "FL", "5");
INSERT INTO "VOTES" VALUES ("17", "1234567906", "CA", "6");
INSERT INTO "VOTES" VALUES ("18", "1234567907", "NY", "7");
INSERT INTO "VOTES" VALUES ("19", "1234567908", "TX", "1");
INSERT INTO "VOTES" VALUES ("20", "1234567909", "FL", "2");