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

CREATE TABLE "Team_Attributes" (
"id" INT,
"team_api_id" INT,
"buildUpPlaySpeed" INT,
"buildUpPlayDribbling" INT,
"buildUpPlayPassing" INT,
"buildUpPlayPositioningClass" TEXT,
"chanceCreationShooting" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("team_api_id") REFERENCES "Team"("team_api_id")
);



INSERT INTO "Team" VALUES ("1", "1001", "RMA");
INSERT INTO "Team" VALUES ("2", "1002", "FCB");
INSERT INTO "Team" VALUES ("3", "1003", "ATM");
INSERT INTO "Team" VALUES ("4", "1004", "VAL");
INSERT INTO "Team" VALUES ("5", "1005", "SEV");
INSERT INTO "Team" VALUES ("6", "1006", "VIL");
INSERT INTO "Team" VALUES ("7", "1007", "BET");
INSERT INTO "Team" VALUES ("8", "1008", "CEL");
INSERT INTO "Team" VALUES ("9", "1009", "ESP");
INSERT INTO "Team" VALUES ("10", "1010", "GET");
INSERT INTO "Team_Attributes" VALUES ("1", "1001", "31", "53", "32", "Organised", "60");
INSERT INTO "Team_Attributes" VALUES ("2", "1002", "40", "60", "50", "Freeform", "70");
INSERT INTO "Team_Attributes" VALUES ("3", "1003", "35", "55", "40", "Organised", "65");
INSERT INTO "Team_Attributes" VALUES ("4", "1004", "30", "50", "30", "Organised", "55");
INSERT INTO "Team_Attributes" VALUES ("5", "1005", "45", "65", "55", "Freeform", "75");
INSERT INTO "Team_Attributes" VALUES ("6", "1006", "31", "53", "32", "Organised", "62");
INSERT INTO "Team_Attributes" VALUES ("7", "1007", "38", "58", "45", "Freeform", "68");
INSERT INTO "Team_Attributes" VALUES ("8", "1008", "31", "53", "32", "Organised", "58");
INSERT INTO "Team_Attributes" VALUES ("9", "1009", "33", "52", "35", "Organised", "61");
INSERT INTO "Team_Attributes" VALUES ("10", "1010", "31", "53", "32", "Organised", "59");
INSERT INTO "Match" VALUES ("1", "1001");
INSERT INTO "Match" VALUES ("2", "1002");
INSERT INTO "Match" VALUES ("3", "1003");
INSERT INTO "Match" VALUES ("4", "1004");
INSERT INTO "Match" VALUES ("5", "1005");
INSERT INTO "Match" VALUES ("6", "1006");
INSERT INTO "Match" VALUES ("7", "1007");
INSERT INTO "Match" VALUES ("8", "1008");
INSERT INTO "Match" VALUES ("9", "1009");
INSERT INTO "Match" VALUES ("10", "1010");