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_ioc" TEXT,
"winner_id" INT,
FOREIGN KEY ("loser_id") REFERENCES "players"("player_id"),
FOREIGN KEY ("winner_id") REFERENCES "players"("player_id")
);

CREATE TABLE "players" (
"player_id" INT UNIQUE,
"country_code" TEXT,
PRIMARY KEY ("player_id")
);





INSERT INTO "players" VALUES ("1", "USA");
INSERT INTO "players" VALUES ("2", "USA");
INSERT INTO "players" VALUES ("3", "USA");
INSERT INTO "players" VALUES ("4", "FRA");
INSERT INTO "players" VALUES ("5", "FRA");
INSERT INTO "players" VALUES ("6", "GER");
INSERT INTO "players" VALUES ("7", "GER");
INSERT INTO "players" VALUES ("8", "GER");
INSERT INTO "players" VALUES ("9", "GER");
INSERT INTO "players" VALUES ("10", "ESP");
INSERT INTO "players" VALUES ("11", "ESP");
INSERT INTO "players" VALUES ("12", "ITA");
INSERT INTO "players" VALUES ("13", "ITA");
INSERT INTO "players" VALUES ("14", "ITA");
INSERT INTO "players" VALUES ("15", "ITA");
INSERT INTO "players" VALUES ("16", "ITA");
INSERT INTO "players" VALUES ("17", "BRA");
INSERT INTO "players" VALUES ("18", "BRA");
INSERT INTO "players" VALUES ("19", "BRA");
INSERT INTO "players" VALUES ("20", "JPN");
INSERT INTO "players" VALUES ("21", "JPN");
INSERT INTO "players" VALUES ("22", "JPN");
INSERT INTO "players" VALUES ("23", "JPN");
INSERT INTO "players" VALUES ("24", "JPN");
INSERT INTO "players" VALUES ("25", "JPN");
INSERT INTO "players" VALUES ("26", "AUS");
INSERT INTO "players" VALUES ("27", "AUS");
INSERT INTO "players" VALUES ("28", "AUS");
INSERT INTO "players" VALUES ("29", "AUS");
INSERT INTO "players" VALUES ("30", "AUS");
INSERT INTO "players" VALUES ("31", "AUS");
INSERT INTO "players" VALUES ("32", "AUS");
INSERT INTO "players" VALUES ("33", "CAN");
INSERT INTO "players" VALUES ("34", "CAN");
INSERT INTO "players" VALUES ("35", "CAN");
INSERT INTO "players" VALUES ("36", "CAN");
INSERT INTO "players" VALUES ("37", "CAN");
INSERT INTO "players" VALUES ("38", "CAN");
INSERT INTO "players" VALUES ("39", "CAN");
INSERT INTO "players" VALUES ("40", "CAN");
INSERT INTO "players" VALUES ("41", "MEX");
INSERT INTO "players" VALUES ("42", "MEX");
INSERT INTO "players" VALUES ("43", "MEX");
INSERT INTO "players" VALUES ("44", "MEX");
INSERT INTO "players" VALUES ("45", "MEX");
INSERT INTO "players" VALUES ("46", "MEX");
INSERT INTO "players" VALUES ("47", "MEX");
INSERT INTO "players" VALUES ("48", "MEX");
INSERT INTO "players" VALUES ("49", "MEX");
INSERT INTO "players" VALUES ("50", "MEX");
INSERT INTO "matches" VALUES ("1", "USA", "4");
INSERT INTO "matches" VALUES ("5", "FRA", "2");
INSERT INTO "matches" VALUES ("6", "GER", "3");
INSERT INTO "matches" VALUES ("7", "GER", "8");
INSERT INTO "matches" VALUES ("9", "GER", "10");
INSERT INTO "matches" VALUES ("11", "ESP", "12");
INSERT INTO "matches" VALUES ("13", "ITA", "14");
INSERT INTO "matches" VALUES ("15", "ITA", "16");
INSERT INTO "matches" VALUES ("17", "BRA", "18");
INSERT INTO "matches" VALUES ("19", "BRA", "20");
INSERT INTO "matches" VALUES ("21", "JPN", "22");
INSERT INTO "matches" VALUES ("23", "JPN", "24");
INSERT INTO "matches" VALUES ("25", "JPN", "26");
INSERT INTO "matches" VALUES ("27", "AUS", "28");
INSERT INTO "matches" VALUES ("29", "AUS", "30");
INSERT INTO "matches" VALUES ("31", "AUS", "32");
INSERT INTO "matches" VALUES ("33", "CAN", "34");
INSERT INTO "matches" VALUES ("35", "CAN", "36");
INSERT INTO "matches" VALUES ("37", "CAN", "38");
INSERT INTO "matches" VALUES ("39", "CAN", "40");
INSERT INTO "matches" VALUES ("41", "MEX", "42");
INSERT INTO "matches" VALUES ("43", "MEX", "44");
INSERT INTO "matches" VALUES ("45", "MEX", "46");
INSERT INTO "matches" VALUES ("47", "MEX", "48");
INSERT INTO "matches" VALUES ("49", "MEX", "50");