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