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", "Simona", "Halep");
INSERT INTO "players" VALUES ("3", "Naomi", "Osaka");
INSERT INTO "players" VALUES ("4", "Ashleigh", "Barty");
INSERT INTO "players" VALUES ("5", "Petra", "Kvitova");
INSERT INTO "players" VALUES ("6", "Sofia", "Kenin");
INSERT INTO "players" VALUES ("7", "Elina", "Svitolina");
INSERT INTO "players" VALUES ("8", "Karolina", "Pliskova");
INSERT INTO "players" VALUES ("9", "Bianca", "Andreescu");
INSERT INTO "players" VALUES ("10", "Garbiñe", "Muguruza");
INSERT INTO "rankings" VALUES ("1", "1", "8500");
INSERT INTO "rankings" VALUES ("2", "2", "7000");
INSERT INTO "rankings" VALUES ("3", "3", "6800");
INSERT INTO "rankings" VALUES ("4", "4", "7200");
INSERT INTO "rankings" VALUES ("5", "5", "6000");
INSERT INTO "rankings" VALUES ("6", "6", "5500");
INSERT INTO "rankings" VALUES ("7", "7", "5300");
INSERT INTO "rankings" VALUES ("8", "8", "5100");
INSERT INTO "rankings" VALUES ("9", "9", "4800");
INSERT INTO "rankings" VALUES ("10", "10", "4700");
INSERT INTO "matches" VALUES ("Serena Williams");
INSERT INTO "matches" VALUES ("Simona Halep");
INSERT INTO "matches" VALUES ("Naomi Osaka");
INSERT INTO "matches" VALUES ("Ashleigh Barty");
INSERT INTO "matches" VALUES ("Serena Williams");
INSERT INTO "matches" VALUES ("Petra Kvitova");
INSERT INTO "matches" VALUES ("Sofia Kenin");
INSERT INTO "matches" VALUES ("Elina Svitolina");
INSERT INTO "matches" VALUES ("Karolina Pliskova");
INSERT INTO "matches" VALUES ("Bianca Andreescu");
INSERT INTO "matches" VALUES ("Garbiñe Muguruza");
INSERT INTO "matches" VALUES ("Serena Williams");
INSERT INTO "matches" VALUES ("Simona Halep");
INSERT INTO "matches" VALUES ("Naomi Osaka");
INSERT INTO "matches" VALUES ("Ashleigh Barty");
INSERT INTO "matches" VALUES ("Serena Williams");