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

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

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





INSERT INTO "conductor" VALUES ("1", "Anna Schmidt", "German");
INSERT INTO "conductor" VALUES ("2", "Luca Bianchi", "Italian");
INSERT INTO "conductor" VALUES ("3", "Maria Lopez", "Spanish");
INSERT INTO "conductor" VALUES ("4", "James O'Connor", "Irish");
INSERT INTO "conductor" VALUES ("5", "Yuki Tanaka", "Japanese");
INSERT INTO "orchestra" VALUES ("1", "Berlin Philharmonic", "1", "2005");
INSERT INTO "orchestra" VALUES ("2", "Rome Symphony", "2", "2010");
INSERT INTO "orchestra" VALUES ("3", "Madrid Philharmonia", "3", "2012");
INSERT INTO "orchestra" VALUES ("4", "Dublin Chamber Orchestra", "4", "2008");
INSERT INTO "orchestra" VALUES ("5", "Tokyo Symphony", "5", "2015");
INSERT INTO "orchestra" VALUES ("6", "Vienna Classic", "1", "2018");
INSERT INTO "orchestra" VALUES ("7", "Naples Orchestra", "2", "2007");
INSERT INTO "performance" VALUES ("1", "1");
INSERT INTO "performance" VALUES ("2", "2");
INSERT INTO "performance" VALUES ("3", "3");
INSERT INTO "performance" VALUES ("4", "4");
INSERT INTO "performance" VALUES ("5", "5");
INSERT INTO "performance" VALUES ("6", "6");
INSERT INTO "performance" VALUES ("7", "7");