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_rank" INT,
"winner_rank" INT
);

CREATE TABLE "players" (
"player_id" INT UNIQUE,
"first_name" TEXT,
"last_name" TEXT,
"hand" TEXT,
"birth_date" DATE,
"country_code" TEXT,
PRIMARY KEY ("player_id")
);

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





INSERT INTO "players" VALUES ("1", "Serena", "Williams", "R", "1981-09-26", "USA");
INSERT INTO "players" VALUES ("2", "Venus", "Williams", "R", "1980-06-17", "USA");
INSERT INTO "players" VALUES ("3", "Simona", "Halep", "R", "1991-09-27", "ROU");
INSERT INTO "players" VALUES ("4", "Naomi", "Osaka", "R", "1997-10-16", "JPN");
INSERT INTO "players" VALUES ("5", "Ashleigh", "Barty", "L", "1996-04-24", "AUS");
INSERT INTO "players" VALUES ("6", "Bianca", "Andreescu", "R", "2000-06-16", "CAN");
INSERT INTO "players" VALUES ("7", "Petra", "Kvitova", "L", "1990-03-08", "CZE");
INSERT INTO "players" VALUES ("8", "Angelique", "Kerber", "L", "1988-01-18", "GER");
INSERT INTO "players" VALUES ("9", "Sofia", "Kenin", "R", "1998-11-14", "USA");
INSERT INTO "players" VALUES ("10", "Garbiñe", "Muguruza", "R", "1993-10-08", "ESP");
INSERT INTO "players" VALUES ("11", "Iga", "Swiatek", "L", "2001-05-31", "POL");
INSERT INTO "players" VALUES ("12", "Elina", "Svitolina", "R", "1994-09-12", "UKR");
INSERT INTO "players" VALUES ("13", "Karolina", "Pliskova", "R", "1992-03-21", "CZE");
INSERT INTO "players" VALUES ("14", "Madison", "Keys", "R", "1995-02-17", "USA");
INSERT INTO "players" VALUES ("15", "Kiki", "Bertens", "R", "1991-12-10", "NED");
INSERT INTO "players" VALUES ("16", "Elena", "Rybakina", "R", "1999-06-17", "KAZ");
INSERT INTO "players" VALUES ("17", "Marketa", "Vondrousova", "L", "1999-06-28", "CZE");
INSERT INTO "players" VALUES ("18", "Jelena", "Ostapenko", "R", "1997-06-08", "LAT");
INSERT INTO "players" VALUES ("19", "Anett", "Kontaveit", "R", "1995-12-24", "EST");
INSERT INTO "players" VALUES ("20", "Elise", "Mertens", "R", "1995-11-17", "BEL");
INSERT INTO "matches" VALUES ("5", "1");
INSERT INTO "matches" VALUES ("3", "2");
INSERT INTO "matches" VALUES ("7", "4");
INSERT INTO "matches" VALUES ("10", "6");
INSERT INTO "matches" VALUES ("8", "9");
INSERT INTO "matches" VALUES ("12", "11");
INSERT INTO "matches" VALUES ("15", "13");
INSERT INTO "matches" VALUES ("20", "14");
INSERT INTO "matches" VALUES ("18", "16");
INSERT INTO "matches" VALUES ("19", "17");
INSERT INTO "rankings" VALUES ("10000");
INSERT INTO "rankings" VALUES ("9500");
INSERT INTO "rankings" VALUES ("9000");
INSERT INTO "rankings" VALUES ("8500");
INSERT INTO "rankings" VALUES ("8000");
INSERT INTO "rankings" VALUES ("7500");
INSERT INTO "rankings" VALUES ("7000");
INSERT INTO "rankings" VALUES ("6500");
INSERT INTO "rankings" VALUES ("6000");
INSERT INTO "rankings" VALUES ("5500");