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,
"first_name" TEXT,
"birth_date" DATE,
"country_code" TEXT,
PRIMARY KEY ("player_id")
);

CREATE TABLE "rankings" (
"ranking_date" DATE
);





INSERT INTO "players" VALUES ("1", "Alice", "1980-05-12", "USA");
INSERT INTO "players" VALUES ("2", "Beatrice", "1975-11-30", "FRA");
INSERT INTO "players" VALUES ("3", "Clara", "1990-07-22", "GER");
INSERT INTO "players" VALUES ("4", "Diana", "1975-11-30", "ESP");
INSERT INTO "players" VALUES ("5", "Eva", "1985-03-15", "ITA");
INSERT INTO "matches" VALUES ("USA", "FRA");
INSERT INTO "matches" VALUES ("GER", "ESP");
INSERT INTO "matches" VALUES ("ITA", "USA");
INSERT INTO "matches" VALUES ("FRA", "GER");
INSERT INTO "matches" VALUES ("ESP", "ITA");
INSERT INTO "rankings" VALUES ("2023-01-01");
INSERT INTO "rankings" VALUES ("2023-06-01");
INSERT INTO "rankings" VALUES ("2024-01-01");