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 "conductor" (
"Conductor_ID" INT,
"Name" TEXT,
PRIMARY KEY ("Conductor_ID")
);

CREATE TABLE "orchestra" (
"Orchestra_ID" INT UNIQUE,
"Orchestra" TEXT,
"Conductor_ID" INT,
PRIMARY KEY ("Orchestra_ID"),
FOREIGN KEY ("Conductor_ID") REFERENCES "conductor"("Conductor_ID")
);

CREATE TABLE "performance" (
"Performance_ID" INT,
"Orchestra_ID" INT,
"Type" TEXT,
PRIMARY KEY ("Performance_ID"),
FOREIGN KEY ("Orchestra_ID") REFERENCES "orchestra"("Orchestra_ID")
);





INSERT INTO "conductor" VALUES ("1", "John Williams");
INSERT INTO "conductor" VALUES ("2", "Marin Alsop");
INSERT INTO "conductor" VALUES ("3", "Gustavo Dudamel");
INSERT INTO "conductor" VALUES ("4", "Simone Young");
INSERT INTO "conductor" VALUES ("5", "Riccardo Muti");
INSERT INTO "orchestra" VALUES ("101", "New York Philharmonic", "1");
INSERT INTO "orchestra" VALUES ("102", "Chicago Symphony Orchestra", "2");
INSERT INTO "orchestra" VALUES ("103", "Los Angeles Philharmonic", "3");
INSERT INTO "orchestra" VALUES ("104", "Berlin Philharmonic", "4");
INSERT INTO "orchestra" VALUES ("105", "Vienna Philharmonic", "5");
INSERT INTO "orchestra" VALUES ("106", "London Symphony Orchestra", "1");
INSERT INTO "orchestra" VALUES ("107", "Boston Symphony Orchestra", "2");
INSERT INTO "performance" VALUES ("201", "101", "Classical");
INSERT INTO "performance" VALUES ("202", "101", "Contemporary");
INSERT INTO "performance" VALUES ("203", "102", "Baroque");
INSERT INTO "performance" VALUES ("204", "103", "Romantic");
INSERT INTO "performance" VALUES ("205", "103", "Modern");
INSERT INTO "performance" VALUES ("206", "105", "Classical");
INSERT INTO "performance" VALUES ("207", "106", "Jazz");