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_hand" TEXT,
"winner_hand" TEXT
);

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

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





INSERT INTO "players" VALUES ("1", "right-handed");
INSERT INTO "players" VALUES ("2", "left-handed");
INSERT INTO "players" VALUES ("3", "right-handed");
INSERT INTO "players" VALUES ("4", "right-handed");
INSERT INTO "players" VALUES ("5", "left-handed");
INSERT INTO "players" VALUES ("6", "right-handed");
INSERT INTO "players" VALUES ("7", "ambidextrous");
INSERT INTO "players" VALUES ("8", "right-handed");
INSERT INTO "players" VALUES ("9", "left-handed");
INSERT INTO "players" VALUES ("10", "right-handed");
INSERT INTO "matches" VALUES ("right-handed", "left-handed");
INSERT INTO "matches" VALUES ("left-handed", "right-handed");
INSERT INTO "matches" VALUES ("right-handed", "right-handed");
INSERT INTO "matches" VALUES ("left-handed", "ambidextrous");
INSERT INTO "matches" VALUES ("right-handed", "left-handed");
INSERT INTO "matches" VALUES ("right-handed", "right-handed");
INSERT INTO "matches" VALUES ("ambidextrous", "right-handed");
INSERT INTO "matches" VALUES ("left-handed", "left-handed");
INSERT INTO "matches" VALUES ("right-handed", "right-handed");
INSERT INTO "matches" VALUES ("right-handed", "left-handed");
INSERT INTO "rankings" VALUES ("1");
INSERT INTO "rankings" VALUES ("2");
INSERT INTO "rankings" VALUES ("3");
INSERT INTO "rankings" VALUES ("4");
INSERT INTO "rankings" VALUES ("5");
INSERT INTO "rankings" VALUES ("6");
INSERT INTO "rankings" VALUES ("7");
INSERT INTO "rankings" VALUES ("8");
INSERT INTO "rankings" VALUES ("9");
INSERT INTO "rankings" VALUES ("10");