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", "2015-08-08 00:00:00");
INSERT INTO "Match" VALUES ("2", "2015-08-09 00:00:00");
INSERT INTO "Match" VALUES ("3", "2015-08-10 00:00:00");
INSERT INTO "Match" VALUES ("4", "2016-04-20 00:00:00");
INSERT INTO "Match" VALUES ("5", "2016-04-22 00:00:00");
INSERT INTO "Match" VALUES ("6", "2007-02-21 00:00:00");
INSERT INTO "Match" VALUES ("7", "2007-02-23 00:00:00");
INSERT INTO "Match" VALUES ("8", "2010-01-15 00:00:00");
INSERT INTO "Match" VALUES ("9", "2013-07-01 00:00:00");
INSERT INTO "Match" VALUES ("10", "2016-04-21 00:00:00");
INSERT INTO "Player" VALUES ("1", "12345", "Marko Arnautovic");
INSERT INTO "Player" VALUES ("2", "67890", "Lionel Messi");
INSERT INTO "Player" VALUES ("3", "11223", "Cristiano Ronaldo");
INSERT INTO "Player" VALUES ("4", "44556", "Eden Hazard");
INSERT INTO "Player" VALUES ("5", "77889", "Neymar Jr.");
INSERT INTO "Player" VALUES ("6", "99001", "Marko Arnautovic");
INSERT INTO "Player" VALUES ("7", "22334", "Robert Lewandowski");
INSERT INTO "Player_Attributes" VALUES ("1", "12345", "2007-02-22 00:00:00", "70", "85", "right");
INSERT INTO "Player_Attributes" VALUES ("2", "12345", "2008-05-10 00:00:00", "75", "88", "right");
INSERT INTO "Player_Attributes" VALUES ("3", "12345", "2010-01-01 00:00:00", "78", "89", "right");
INSERT INTO "Player_Attributes" VALUES ("4", "12345", "2013-03-15 00:00:00", "80", "87", "right");
INSERT INTO "Player_Attributes" VALUES ("5", "12345", "2016-04-21 00:00:00", "82", "85", "right");
INSERT INTO "Player_Attributes" VALUES ("6", "12345", "2016-04-22 00:00:00", "83", "86", "right");
INSERT INTO "Player_Attributes" VALUES ("7", "12345", "2007-02-21 00:00:00", "68", "84", "right");
INSERT INTO "Player_Attributes" VALUES ("8", "67890", "2015-01-01 00:00:00", "95", "97", "left");
INSERT INTO "Player_Attributes" VALUES ("9", "11223", "2014-06-01 00:00:00", "92", "94", "right");
INSERT INTO "Player_Attributes" VALUES ("10", "12345", "2011-11-11 00:00:00", "79", "88", "right");
INSERT INTO "Player_Attributes" VALUES ("11", "12345", "2012-07-07 00:00:00", "79", "88", "right");
INSERT INTO "Player_Attributes" VALUES ("12", "99001", "2015-01-01 00:00:00", "77", "80", "left");