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_ioc" TEXT,
"winner_ioc" TEXT
);

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

CREATE TABLE "rankings" (
"player_id" INT,
FOREIGN KEY ("player_id") REFERENCES "players"("player_id")
);





INSERT INTO "matches" VALUES ("USA", "CAN");
INSERT INTO "matches" VALUES ("CAN", "USA");
INSERT INTO "matches" VALUES ("GBR", "USA");
INSERT INTO "matches" VALUES ("USA", "GBR");
INSERT INTO "matches" VALUES ("AUS", "CAN");
INSERT INTO "matches" VALUES ("CAN", "AUS");
INSERT INTO "matches" VALUES ("FRA", "GER");
INSERT INTO "matches" VALUES ("GER", "FRA");
INSERT INTO "matches" VALUES ("USA", "FRA");
INSERT INTO "matches" VALUES ("FRA", "USA");
INSERT INTO "matches" VALUES ("GBR", "AUS");
INSERT INTO "matches" VALUES ("AUS", "GBR");
INSERT INTO "players" VALUES ("1", "USA");
INSERT INTO "players" VALUES ("2", "USA");
INSERT INTO "players" VALUES ("3", "CAN");
INSERT INTO "players" VALUES ("4", "GBR");
INSERT INTO "players" VALUES ("5", "AUS");
INSERT INTO "players" VALUES ("6", "FRA");
INSERT INTO "players" VALUES ("7", "GER");
INSERT INTO "players" VALUES ("8", "USA");
INSERT INTO "players" VALUES ("9", "CAN");
INSERT INTO "players" VALUES ("10", "GBR");
INSERT INTO "players" VALUES ("11", "AUS");
INSERT INTO "players" VALUES ("12", "FRA");
INSERT INTO "players" VALUES ("13", "GER");
INSERT INTO "players" VALUES ("14", "USA");
INSERT INTO "players" VALUES ("15", "USA");
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");
INSERT INTO "rankings" VALUES ("11");
INSERT INTO "rankings" VALUES ("12");
INSERT INTO "rankings" VALUES ("13");
INSERT INTO "rankings" VALUES ("14");
INSERT INTO "rankings" VALUES ("15");