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

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

CREATE TABLE "rankings" (
"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", "Ashleigh", "Barty");
INSERT INTO "players" VALUES ("5", "Simona", "Halep");
INSERT INTO "players" VALUES ("6", "Maria", "Sharapova");
INSERT INTO "players" VALUES ("7", "Petra", "Kvitova");
INSERT INTO "players" VALUES ("8", "Caroline", "Wozniacki");
INSERT INTO "players" VALUES ("9", "Angelique", "Kerber");
INSERT INTO "players" VALUES ("10", "Victoria", "Azarenka");
INSERT INTO "matches" VALUES ("Serena Williams", "Naomi Osaka");
INSERT INTO "matches" VALUES ("Venus Williams", "Ashleigh Barty");
INSERT INTO "matches" VALUES ("Simona Halep", "Serena Williams");
INSERT INTO "matches" VALUES ("Maria Sharapova", "Naomi Osaka");
INSERT INTO "matches" VALUES ("Petra Kvitova", "Simona Halep");
INSERT INTO "matches" VALUES ("Caroline Wozniacki", "Venus Williams");
INSERT INTO "matches" VALUES ("Angelique Kerber", "Maria Sharapova");
INSERT INTO "matches" VALUES ("Victoria Azarenka", "Petra Kvitova");
INSERT INTO "matches" VALUES ("Serena Williams", "Ashleigh Barty");
INSERT INTO "matches" VALUES ("Naomi Osaka", "Simona Halep");
INSERT INTO "matches" VALUES ("Venus Williams", "Maria Sharapova");
INSERT INTO "matches" VALUES ("Ashleigh Barty", "Petra Kvitova");
INSERT INTO "matches" VALUES ("Simona Halep", "Caroline Wozniacki");
INSERT INTO "matches" VALUES ("Maria Sharapova", "Angelique Kerber");
INSERT INTO "matches" VALUES ("Petra Kvitova", "Victoria Azarenka");
INSERT INTO "rankings" VALUES ("1", "8000");
INSERT INTO "rankings" VALUES ("2", "6500");
INSERT INTO "rankings" VALUES ("3", "9500");
INSERT INTO "rankings" VALUES ("4", "9000");
INSERT INTO "rankings" VALUES ("5", "8800");
INSERT INTO "rankings" VALUES ("6", "5000");
INSERT INTO "rankings" VALUES ("7", "7200");
INSERT INTO "rankings" VALUES ("8", "6000");
INSERT INTO "rankings" VALUES ("9", "7500");
INSERT INTO "rankings" VALUES ("10", "6800");