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 "concert" (
"concert_ID" INT UNIQUE,
"Stadium_ID" TEXT,
"Year" TEXT,
PRIMARY KEY ("concert_ID"),
FOREIGN KEY ("Stadium_ID") REFERENCES "stadium"("Stadium_ID")
);

CREATE TABLE "singer" (
"Singer_ID" INT,
"Name" TEXT,
PRIMARY KEY ("Singer_ID")
);

CREATE TABLE "singer_in_concert" (
"concert_ID" INT,
"Singer_ID" TEXT,
PRIMARY KEY ("concert_ID", "Singer_ID"),
FOREIGN KEY ("Singer_ID") REFERENCES "singer"("Singer_ID")
);

CREATE TABLE "stadium" (
"Stadium_ID" INT,
"Name" TEXT,
PRIMARY KEY ("Stadium_ID")
);





INSERT INTO "stadium" VALUES ("1", "Stark's Park");
INSERT INTO "stadium" VALUES ("2", "Somerset Park");
INSERT INTO "stadium" VALUES ("3", "Bayview Stadium");
INSERT INTO "stadium" VALUES ("4", "Hampden Park");
INSERT INTO "stadium" VALUES ("5", "Forthbank Stadium");
INSERT INTO "singer" VALUES ("1", "Joe Sharp");
INSERT INTO "singer" VALUES ("2", "Timbaland");
INSERT INTO "singer" VALUES ("3", "Justin Brown");
INSERT INTO "singer" VALUES ("4", "Rose White");
INSERT INTO "singer" VALUES ("5", "John Nizinik");
INSERT INTO "singer" VALUES ("6", "Tribal King");
INSERT INTO "concert" VALUES ("1", "1", "2014");
INSERT INTO "concert" VALUES ("2", "2", "2014");
INSERT INTO "concert" VALUES ("3", "2", "2015");
INSERT INTO "concert" VALUES ("4", "3", "2013");
INSERT INTO "concert" VALUES ("5", "4", "2015");
INSERT INTO "concert" VALUES ("6", "5", "2016");
INSERT INTO "concert" VALUES ("7", "1", "2015");
INSERT INTO "concert" VALUES ("8", "3", "2014");
INSERT INTO "concert" VALUES ("9", "4", "2012");
INSERT INTO "singer_in_concert" VALUES ("1", "1");
INSERT INTO "singer_in_concert" VALUES ("1", "2");
INSERT INTO "singer_in_concert" VALUES ("2", "3");
INSERT INTO "singer_in_concert" VALUES ("3", "4");
INSERT INTO "singer_in_concert" VALUES ("4", "5");
INSERT INTO "singer_in_concert" VALUES ("5", "6");
INSERT INTO "singer_in_concert" VALUES ("6", "1");
INSERT INTO "singer_in_concert" VALUES ("7", "2");
INSERT INTO "singer_in_concert" VALUES ("8", "3");
INSERT INTO "singer_in_concert" VALUES ("9", "4");