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_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,
PRIMARY KEY ("Stadium_ID")
);





INSERT INTO "stadium" VALUES ("1", "New York", "Madison Square Garden");
INSERT INTO "stadium" VALUES ("2", "Los Angeles", "Staples Center");
INSERT INTO "stadium" VALUES ("3", "Chicago", "United Center");
INSERT INTO "stadium" VALUES ("4", "Houston", "Toyota Center");
INSERT INTO "stadium" VALUES ("5", "San Francisco", "Chase Center");
INSERT INTO "concert" VALUES ("101", "1", "2020");
INSERT INTO "concert" VALUES ("102", "1", "2021");
INSERT INTO "concert" VALUES ("103", "2", "2020");
INSERT INTO "concert" VALUES ("104", "2", "2021");
INSERT INTO "concert" VALUES ("105", "2", "2022");
INSERT INTO "concert" VALUES ("106", "3", "2021");
INSERT INTO "concert" VALUES ("107", "4", "2020");
INSERT INTO "concert" VALUES ("108", "4", "2020");
INSERT INTO "concert" VALUES ("109", "5", "2022");
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");
INSERT INTO "singer_in_concert" VALUES ("109", "S10");