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,
"home_team_api_id" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("home_team_api_id") REFERENCES "Team"("team_api_id")
);

CREATE TABLE "Team" (
"id" INT,
"team_api_id" INT UNIQUE,
"team_long_name" TEXT,
"team_short_name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Team_Attributes" (
"id" INT,
"team_api_id" INT,
"date" TEXT,
"buildUpPlaySpeed" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("team_api_id") REFERENCES "Team"("team_api_id")
);



INSERT INTO "Team" VALUES ("1", "10000", "Heart of Midlothian", "Hearts");
INSERT INTO "Team" VALUES ("2", "10001", "Celtic FC", "Celtic");
INSERT INTO "Team" VALUES ("3", "10002", "Rangers FC", "Rangers");
INSERT INTO "Team" VALUES ("4", "10003", "Aberdeen FC", "Aberdeen");
INSERT INTO "Team" VALUES ("5", "10004", "Hibernian FC", "Hibernian");
INSERT INTO "Team" VALUES ("6", "10005", "Dundee United FC", "Dundee Utd");
INSERT INTO "Team" VALUES ("7", "10006", "Motherwell FC", "Motherwell");
INSERT INTO "Team" VALUES ("8", "10007", "Kilmarnock FC", "Kilmarnock");
INSERT INTO "Team" VALUES ("9", "10008", "St Johnstone FC", "St Johnstone");
INSERT INTO "Team" VALUES ("10", "10009", "Ross County FC", "Ross County");
INSERT INTO "Team_Attributes" VALUES ("1", "10000", "2015-01-01", "50");
INSERT INTO "Team_Attributes" VALUES ("2", "10000", "2015-06-01", "60");
INSERT INTO "Team_Attributes" VALUES ("3", "10000", "2016-01-01", "55");
INSERT INTO "Team_Attributes" VALUES ("4", "10001", "2015-01-01", "70");
INSERT INTO "Team_Attributes" VALUES ("5", "10001", "2015-06-01", "75");
INSERT INTO "Team_Attributes" VALUES ("6", "10002", "2015-01-01", "65");
INSERT INTO "Team_Attributes" VALUES ("7", "10003", "2015-01-01", "45");
INSERT INTO "Team_Attributes" VALUES ("8", "10000", "2016-06-01", "65");
INSERT INTO "Team_Attributes" VALUES ("9", "10004", "2015-01-01", "52");
INSERT INTO "Team_Attributes" VALUES ("10", "10005", "2015-01-01", "58");
INSERT INTO "Match" VALUES ("1", "10000");
INSERT INTO "Match" VALUES ("2", "10001");
INSERT INTO "Match" VALUES ("3", "10000");
INSERT INTO "Match" VALUES ("4", "10002");
INSERT INTO "Match" VALUES ("5", "10003");
INSERT INTO "Match" VALUES ("6", "10000");
INSERT INTO "Match" VALUES ("7", "10001");
INSERT INTO "Match" VALUES ("8", "10004");
INSERT INTO "Match" VALUES ("9", "10005");
INSERT INTO "Match" VALUES ("10", "10000");