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



INSERT INTO "Team" VALUES ("1", "1001", "Ajax");
INSERT INTO "Team" VALUES ("2", "1002", "Feyenoord");
INSERT INTO "Team" VALUES ("3", "1003", "PSV");
INSERT INTO "Team" VALUES ("4", "1004", "AZ Alkmaar");
INSERT INTO "Team" VALUES ("5", "1005", "FC Utrecht");
INSERT INTO "Team_Attributes" VALUES ("1", "1001", "70", "Normal", "65");
INSERT INTO "Team_Attributes" VALUES ("2", "1001", "85", "High", "75");
INSERT INTO "Team_Attributes" VALUES ("3", "1001", "60", "Low", "50");
INSERT INTO "Team_Attributes" VALUES ("4", "1002", "75", "Normal", "70");
INSERT INTO "Team_Attributes" VALUES ("5", "1003", "90", "High", "80");
INSERT INTO "Team_Attributes" VALUES ("6", "1001", "80", "Normal", "70");
INSERT INTO "Team_Attributes" VALUES ("7", "1004", "68", "Normal", "60");
INSERT INTO "Team_Attributes" VALUES ("8", "1005", "72", "Normal", "62");
INSERT INTO "Match" VALUES ("1", "1001", "1002");
INSERT INTO "Match" VALUES ("2", "1003", "1001");
INSERT INTO "Match" VALUES ("3", "1002", "1004");
INSERT INTO "Match" VALUES ("4", "1001", "1005");
INSERT INTO "Match" VALUES ("5", "1003", "1002");