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 "Match" (
"id" INT,
"date" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Player" (
"id" INT,
"player_api_id" INT UNIQUE,
"player_name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Player_Attributes" (
"id" INT,
"player_api_id" INT,
"date" TEXT,
"overall_rating" INT,
"potential" INT,
"preferred_foot" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_id")
);



INSERT INTO "Match" VALUES ("1", "2011-08-13 00:00:00");
INSERT INTO "Match" VALUES ("2", "2012-09-22 00:00:00");
INSERT INTO "Match" VALUES ("3", "2011-01-15 00:00:00");
INSERT INTO "Match" VALUES ("4", "2013-03-02 00:00:00");
INSERT INTO "Match" VALUES ("5", "2011-11-05 00:00:00");
INSERT INTO "Match" VALUES ("6", "2010-05-01 00:00:00");
INSERT INTO "Match" VALUES ("7", "2014-07-19 00:00:00");
INSERT INTO "Match" VALUES ("8", "2011-06-25 00:00:00");
INSERT INTO "Match" VALUES ("9", "2012-02-11 00:00:00");
INSERT INTO "Match" VALUES ("10", "2011-09-03 00:00:00");
INSERT INTO "Player" VALUES ("1", "12345", "Gabriel Tamas");
INSERT INTO "Player" VALUES ("2", "67890", "Lionel Messi");
INSERT INTO "Player" VALUES ("3", "11223", "Cristiano Ronaldo");
INSERT INTO "Player" VALUES ("4", "44556", "Neymar Jr.");
INSERT INTO "Player" VALUES ("5", "77889", "Sergio Ramos");
INSERT INTO "Player" VALUES ("6", "99001", "Gabriel Jesus");
INSERT INTO "Player" VALUES ("7", "22334", "Eden Hazard");
INSERT INTO "Player" VALUES ("8", "55667", "Kevin De Bruyne");
INSERT INTO "Player" VALUES ("9", "88990", "Robert Lewandowski");
INSERT INTO "Player" VALUES ("10", "33445", "Kylian Mbappe");
INSERT INTO "Player_Attributes" VALUES ("1", "12345", "2011-02-08 00:00:00", "75", "78", "right");
INSERT INTO "Player_Attributes" VALUES ("2", "12345", "2011-08-22 00:00:00", "76", "78", "right");
INSERT INTO "Player_Attributes" VALUES ("3", "12345", "2012-02-22 00:00:00", "74", "76", "right");
INSERT INTO "Player_Attributes" VALUES ("4", "67890", "2011-02-22 00:00:00", "92", "95", "left");
INSERT INTO "Player_Attributes" VALUES ("5", "67890", "2012-02-22 00:00:00", "93", "95", "left");
INSERT INTO "Player_Attributes" VALUES ("6", "11223", "2011-02-22 00:00:00", "90", "92", "right");
INSERT INTO "Player_Attributes" VALUES ("7", "11223", "2012-02-22 00:00:00", "91", "92", "right");
INSERT INTO "Player_Attributes" VALUES ("8", "44556", "2013-02-22 00:00:00", "85", "90", "right");
INSERT INTO "Player_Attributes" VALUES ("9", "12345", "2010-08-30 00:00:00", "73", "77", "right");
INSERT INTO "Player_Attributes" VALUES ("10", "12345", "2012-08-30 00:00:00", "75", "77", "right");
INSERT INTO "Player_Attributes" VALUES ("11", "99001", "2011-02-22 00:00:00", "65", "80", "right");