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

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



INSERT INTO "Team" VALUES ("1", "1000", "Hull City");
INSERT INTO "Team" VALUES ("2", "1001", "Arsenal");
INSERT INTO "Team" VALUES ("3", "1002", "Chelsea");
INSERT INTO "Team" VALUES ("4", "1003", "Manchester United");
INSERT INTO "Team" VALUES ("5", "1004", "Liverpool");
INSERT INTO "Team" VALUES ("6", "1005", "Tottenham Hotspur");
INSERT INTO "Team" VALUES ("7", "1006", "Everton");
INSERT INTO "Team_Attributes" VALUES ("1", "1000", "2010-02-22 00:00:00", "Normal", "Normal");
INSERT INTO "Team_Attributes" VALUES ("2", "1000", "2011-01-01 00:00:00", "Little", "Normal");
INSERT INTO "Team_Attributes" VALUES ("3", "1001", "2010-02-22 00:00:00", "Lots", "Normal");
INSERT INTO "Team_Attributes" VALUES ("4", "1002", "2010-02-22 00:00:00", "Normal", "Lots");
INSERT INTO "Team_Attributes" VALUES ("5", "1000", "2009-12-01 00:00:00", "Normal", "Normal");
INSERT INTO "Team_Attributes" VALUES ("6", "1000", "2010-03-15 00:00:00", "Little", "Little");
INSERT INTO "Team_Attributes" VALUES ("7", "1003", "2010-02-22 00:00:00", "Normal", "Normal");
INSERT INTO "Match" VALUES ("1", "1000", "1001", "1");
INSERT INTO "Match" VALUES ("2", "1002", "1000", "2");
INSERT INTO "Match" VALUES ("3", "1001", "1003", "0");
INSERT INTO "Match" VALUES ("4", "1004", "1005", "3");
INSERT INTO "Match" VALUES ("5", "1000", "1006", "0");