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" (
"winner_name" TEXT
);

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

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





INSERT INTO "players" VALUES ("1", "Serena", "Williams");
INSERT INTO "players" VALUES ("2", "Venus", "Williams");
INSERT INTO "players" VALUES ("3", "Naomi", "Osaka");
INSERT INTO "players" VALUES ("4", "Simona", "Halep");
INSERT INTO "players" VALUES ("5", "Ashleigh", "Barty");
INSERT INTO "players" VALUES ("6", "Bianca", "Andreescu");
INSERT INTO "players" VALUES ("7", "Petra", "Kvitova");
INSERT INTO "players" VALUES ("8", "Garbiñe", "Muguruza");
INSERT INTO "players" VALUES ("9", "Elina", "Svitolina");
INSERT INTO "players" VALUES ("10", "Coco", "Gauff");
INSERT INTO "players" VALUES ("11", "Iga", "Swiatek");
INSERT INTO "players" VALUES ("12", "Madison", "Keys");
INSERT INTO "players" VALUES ("13", "Karolina", "Pliskova");
INSERT INTO "players" VALUES ("14", "Sloane", "Stephens");
INSERT INTO "players" VALUES ("15", "Angelique", "Kerber");
INSERT INTO "players" VALUES ("16", "Daria", "Kasatkina");
INSERT INTO "players" VALUES ("17", "Barbora", "Krejcikova");
INSERT INTO "players" VALUES ("18", "Ons", "Jabeur");
INSERT INTO "players" VALUES ("19", "Leylah", "Fernandez");
INSERT INTO "players" VALUES ("20", "Jelena", "Ostapenko");
INSERT INTO "rankings" VALUES ("1", "1", "8500");
INSERT INTO "rankings" VALUES ("2", "1", "1500");
INSERT INTO "rankings" VALUES ("3", "2", "4300");
INSERT INTO "rankings" VALUES ("4", "3", "7200");
INSERT INTO "rankings" VALUES ("5", "3", "800");
INSERT INTO "rankings" VALUES ("6", "4", "6000");
INSERT INTO "rankings" VALUES ("7", "5", "9000");
INSERT INTO "rankings" VALUES ("8", "6", "0");
INSERT INTO "rankings" VALUES ("9", "7", "3500");
INSERT INTO "rankings" VALUES ("10", "7", "1200");
INSERT INTO "rankings" VALUES ("11", "8", "0");
INSERT INTO "rankings" VALUES ("12", "9", "4100");
INSERT INTO "rankings" VALUES ("13", "10", "150");
INSERT INTO "rankings" VALUES ("14", "11", "7800");
INSERT INTO "rankings" VALUES ("15", "12", "0");
INSERT INTO "rankings" VALUES ("16", "13", "5000");
INSERT INTO "rankings" VALUES ("17", "14", "3200");
INSERT INTO "rankings" VALUES ("18", "15", "4700");
INSERT INTO "rankings" VALUES ("19", "16", "0");
INSERT INTO "rankings" VALUES ("20", "17", "2900");
INSERT INTO "rankings" VALUES ("21", "18", "3600");
INSERT INTO "rankings" VALUES ("22", "19", "2100");
INSERT INTO "rankings" VALUES ("23", "20", "0");
INSERT INTO "matches" VALUES ("Serena Williams");
INSERT INTO "matches" VALUES ("Venus Williams");
INSERT INTO "matches" VALUES ("Naomi Osaka");
INSERT INTO "matches" VALUES ("Simona Halep");
INSERT INTO "matches" VALUES ("Ashleigh Barty");
INSERT INTO "matches" VALUES ("Bianca Andreescu");
INSERT INTO "matches" VALUES ("Petra Kvitova");
INSERT INTO "matches" VALUES ("Garbiñe Muguruza");
INSERT INTO "matches" VALUES ("Elina Svitolina");
INSERT INTO "matches" VALUES ("Coco Gauff");
INSERT INTO "matches" VALUES ("Iga Swiatek");
INSERT INTO "matches" VALUES ("Madison Keys");
INSERT INTO "matches" VALUES ("Karolina Pliskova");
INSERT INTO "matches" VALUES ("Sloane Stephens");
INSERT INTO "matches" VALUES ("Angelique Kerber");
INSERT INTO "matches" VALUES ("Daria Kasatkina");
INSERT INTO "matches" VALUES ("Barbora Krejcikova");
INSERT INTO "matches" VALUES ("Ons Jabeur");
INSERT INTO "matches" VALUES ("Leylah Fernandez");
INSERT INTO "matches" VALUES ("Jelena Ostapenko");