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

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

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





INSERT INTO "stadium" VALUES ("1", "New York", "Madison Square Garden", "20000");
INSERT INTO "stadium" VALUES ("2", "Los Angeles", "Staples Center", "21000");
INSERT INTO "stadium" VALUES ("3", "Chicago", "United Center", "23000");
INSERT INTO "stadium" VALUES ("4", "Houston", "Toyota Center", "18000");
INSERT INTO "stadium" VALUES ("5", "San Francisco", "Chase Center", "18000");
INSERT INTO "concert" VALUES ("101", "Rock Fest", "1", "2014");
INSERT INTO "concert" VALUES ("102", "Jazz Night", "1", "2015");
INSERT INTO "concert" VALUES ("103", "Pop Gala", "2", "2014");
INSERT INTO "concert" VALUES ("104", "Classical Evening", "3", "2015");
INSERT INTO "concert" VALUES ("105", "Indie Vibes", "2", "2015");
INSERT INTO "concert" VALUES ("106", "Hip Hop Bash", "4", "2014");
INSERT INTO "concert" VALUES ("107", "Country Roads", "4", "2015");
INSERT INTO "concert" VALUES ("108", "Electronic Dance", "5", "2014");
INSERT INTO "singer_in_concert" VALUES ("101", "S1");
INSERT INTO "singer_in_concert" VALUES ("101", "S2");
INSERT INTO "singer_in_concert" VALUES ("102", "S3");
INSERT INTO "singer_in_concert" VALUES ("103", "S4");
INSERT INTO "singer_in_concert" VALUES ("104", "S5");
INSERT INTO "singer_in_concert" VALUES ("105", "S6");
INSERT INTO "singer_in_concert" VALUES ("106", "S7");
INSERT INTO "singer_in_concert" VALUES ("107", "S8");
INSERT INTO "singer_in_concert" VALUES ("108", "S9");