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" (
"tourney_date" DATE
);

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 "matches" VALUES ("2023-01-15");
INSERT INTO "matches" VALUES ("2023-02-20");
INSERT INTO "matches" VALUES ("2023-03-10");
INSERT INTO "matches" VALUES ("2023-04-05");
INSERT INTO "matches" VALUES ("2023-05-22");
INSERT INTO "players" VALUES ("1", "Serena", "Williams");
INSERT INTO "players" VALUES ("2", "Naomi", "Osaka");
INSERT INTO "players" VALUES ("3", "Simona", "Halep");
INSERT INTO "players" VALUES ("4", "Ashleigh", "Barty");
INSERT INTO "players" VALUES ("5", "Iga", "Swiatek");
INSERT INTO "players" VALUES ("6", "Petra", "Kvitova");
INSERT INTO "rankings" VALUES ("3", "1", "4500");
INSERT INTO "rankings" VALUES ("5", "1", "3200");
INSERT INTO "rankings" VALUES ("1", "2", "7800");
INSERT INTO "rankings" VALUES ("2", "2", "6200");
INSERT INTO "rankings" VALUES ("4", "3", "4100");
INSERT INTO "rankings" VALUES ("6", "3", "2900");
INSERT INTO "rankings" VALUES ("1", "4", "8000");
INSERT INTO "rankings" VALUES ("7", "5", "2700");
INSERT INTO "rankings" VALUES ("8", "5", "2300");
INSERT INTO "rankings" VALUES ("9", "6", "1500");
INSERT INTO "rankings" VALUES ("10", "6", "1200");