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 Smith");
INSERT INTO "CONTESTANTS" VALUES ("2", "Bob Johnson");
INSERT INTO "CONTESTANTS" VALUES ("3", "Charlie Brown");
INSERT INTO "CONTESTANTS" VALUES ("4", "David Allen");
INSERT INTO "CONTESTANTS" VALUES ("5", "Eve Albright");
INSERT INTO "CONTESTANTS" VALUES ("6", "Frank Miller");
INSERT INTO "CONTESTANTS" VALUES ("7", "Grace Kelly");
INSERT INTO "CONTESTANTS" VALUES ("8", "Walter White");
INSERT INTO "CONTESTANTS" VALUES ("9", "Alan Turing");
INSERT INTO "CONTESTANTS" VALUES ("10", "Alexandra Green");
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", "4");
INSERT INTO "VOTES" VALUES ("5", "1234567894", "CA", "5");
INSERT INTO "VOTES" VALUES ("6", "1234567895", "NY", "3");
INSERT INTO "VOTES" VALUES ("7", "1234567896", "TX", "4");
INSERT INTO "VOTES" VALUES ("8", "1234567897", "FL", "5");
INSERT INTO "VOTES" VALUES ("9", "1234567898", "CA", "9");
INSERT INTO "VOTES" VALUES ("10", "1234567899", "NY", "10");
INSERT INTO "VOTES" VALUES ("11", "1234567900", "TX", "1");
INSERT INTO "VOTES" VALUES ("12", "1234567901", "FL", "9");
INSERT INTO "VOTES" VALUES ("13", "1234567902", "CA", "10");
INSERT INTO "VOTES" VALUES ("14", "1234567903", "NY", "4");
INSERT INTO "VOTES" VALUES ("15", "1234567904", "TX", "5");