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,
"match_num" INT,
"tourney_date" DATE,
"tourney_id" TEXT,
"tourney_name" TEXT,
"winner_name" TEXT
);





INSERT INTO "matches" VALUES ("PlayerA", "1", "2023-01-15", "T001", "Grand Slam A", "PlayerB");
INSERT INTO "matches" VALUES ("PlayerC", "2", "2023-01-15", "T001", "Grand Slam A", "PlayerD");
INSERT INTO "matches" VALUES ("PlayerE", "3", "2023-01-16", "T001", "Grand Slam A", "PlayerF");
INSERT INTO "matches" VALUES ("PlayerG", "4", "2023-01-16", "T001", "Grand Slam A", "PlayerH");
INSERT INTO "matches" VALUES ("PlayerI", "5", "2023-01-17", "T001", "Grand Slam A", "PlayerJ");
INSERT INTO "matches" VALUES ("PlayerK", "6", "2023-01-17", "T001", "Grand Slam A", "PlayerL");
INSERT INTO "matches" VALUES ("PlayerM", "7", "2023-01-18", "T001", "Grand Slam A", "PlayerN");
INSERT INTO "matches" VALUES ("PlayerO", "8", "2023-01-18", "T001", "Grand Slam A", "PlayerP");
INSERT INTO "matches" VALUES ("PlayerQ", "9", "2023-01-19", "T001", "Grand Slam A", "PlayerR");
INSERT INTO "matches" VALUES ("PlayerS", "10", "2023-01-19", "T001", "Grand Slam A", "PlayerT");
INSERT INTO "matches" VALUES ("PlayerU", "11", "2023-01-20", "T001", "Grand Slam A", "PlayerV");
INSERT INTO "matches" VALUES ("PlayerW", "12", "2023-01-20", "T001", "Grand Slam A", "PlayerX");
INSERT INTO "matches" VALUES ("PlayerY", "1", "2023-02-01", "T002", "Open B", "PlayerZ");
INSERT INTO "matches" VALUES ("PlayerAA", "2", "2023-02-01", "T002", "Open B", "PlayerBB");
INSERT INTO "matches" VALUES ("PlayerCC", "3", "2023-02-02", "T002", "Open B", "PlayerDD");
INSERT INTO "matches" VALUES ("PlayerEE", "4", "2023-02-02", "T002", "Open B", "PlayerFF");
INSERT INTO "matches" VALUES ("PlayerGG", "5", "2023-02-03", "T002", "Open B", "PlayerHH");
INSERT INTO "matches" VALUES ("PlayerII", "6", "2023-02-03", "T002", "Open B", "PlayerJJ");
INSERT INTO "matches" VALUES ("PlayerKK", "7", "2023-02-04", "T002", "Open B", "PlayerLL");
INSERT INTO "matches" VALUES ("PlayerMM", "8", "2023-02-04", "T002", "Open B", "PlayerNN");
INSERT INTO "matches" VALUES ("PlayerOO", "9", "2023-02-05", "T002", "Open B", "PlayerPP");
INSERT INTO "matches" VALUES ("PlayerQQ", "10", "2023-02-05", "T002", "Open B", "PlayerRR");
INSERT INTO "matches" VALUES ("PlayerSS", "1", "2023-03-10", "T003", "Challenger C", "PlayerTT");
INSERT INTO "matches" VALUES ("PlayerUU", "2", "2023-03-10", "T003", "Challenger C", "PlayerVV");
INSERT INTO "matches" VALUES ("PlayerWW", "3", "2023-03-11", "T003", "Challenger C", "PlayerXX");
INSERT INTO "matches" VALUES ("PlayerYY", "4", "2023-03-11", "T003", "Challenger C", "PlayerZZ");
INSERT INTO "matches" VALUES ("Player1", "1", "2023-04-01", "T004", "Minor D", "Player2");