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 "matches" (
"loser_id" INT,
"loser_name" TEXT,
"winner_id" INT,
"winner_name" TEXT,
"winner_rank_points" INT
);

CREATE TABLE "rankings" (
"ranking" INT
);





INSERT INTO "matches" VALUES ("101", "PlayerA", "201", "PlayerX", "1500");
INSERT INTO "matches" VALUES ("102", "PlayerB", "201", "PlayerX", "1500");
INSERT INTO "matches" VALUES ("103", "PlayerC", "202", "PlayerY", "1200");
INSERT INTO "matches" VALUES ("104", "PlayerD", "201", "PlayerX", "1500");
INSERT INTO "matches" VALUES ("105", "PlayerE", "203", "PlayerZ", "1000");
INSERT INTO "matches" VALUES ("106", "PlayerF", "202", "PlayerY", "1200");
INSERT INTO "matches" VALUES ("107", "PlayerG", "201", "PlayerX", "1500");
INSERT INTO "matches" VALUES ("108", "PlayerH", "203", "PlayerZ", "1000");
INSERT INTO "matches" VALUES ("109", "PlayerI", "204", "PlayerW", "800");
INSERT INTO "matches" VALUES ("110", "PlayerJ", "204", "PlayerW", "800");
INSERT INTO "matches" VALUES ("111", "PlayerK", "205", "PlayerV", "700");
INSERT INTO "matches" VALUES ("112", "PlayerL", "201", "PlayerX", "1500");
INSERT INTO "matches" VALUES ("113", "PlayerM", "202", "PlayerY", "1200");
INSERT INTO "matches" VALUES ("114", "PlayerN", "203", "PlayerZ", "1000");
INSERT INTO "matches" VALUES ("115", "PlayerO", "204", "PlayerW", "800");
INSERT INTO "rankings" VALUES ("1");
INSERT INTO "rankings" VALUES ("2");
INSERT INTO "rankings" VALUES ("3");
INSERT INTO "rankings" VALUES ("4");
INSERT INTO "rankings" VALUES ("5");
INSERT INTO "rankings" VALUES ("6");
INSERT INTO "rankings" VALUES ("7");
INSERT INTO "rankings" VALUES ("8");
INSERT INTO "rankings" VALUES ("9");
INSERT INTO "rankings" VALUES ("10");