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

CREATE TABLE "orchestra" (
"Orchestra_ID" INT,
"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", "Leonard Bernstein", "1958");
INSERT INTO "conductor" VALUES ("2", "Gustavo Dudamel", "2005");
INSERT INTO "conductor" VALUES ("3", "Marin Alsop", "1990");
INSERT INTO "conductor" VALUES ("4", "Simon Rattle", "1977");
INSERT INTO "conductor" VALUES ("5", "Valery Gergiev", "1988");
INSERT INTO "conductor" VALUES ("6", "JoAnn Falletta", "1980");
INSERT INTO "conductor" VALUES ("7", "Riccardo Muti", "1967");
INSERT INTO "orchestra" VALUES ("101", "New York Philharmonic", "1", "1842");
INSERT INTO "orchestra" VALUES ("102", "Los Angeles Philharmonic", "2", "1919");
INSERT INTO "orchestra" VALUES ("103", "Baltimore Symphony Orchestra", "3", "1916");
INSERT INTO "orchestra" VALUES ("104", "Berlin Philharmonic", "4", "1882");
INSERT INTO "orchestra" VALUES ("105", "Mariinsky Theatre Orchestra", "5", "1783");
INSERT INTO "orchestra" VALUES ("106", "Buffalo Philharmonic Orchestra", "6", "1935");
INSERT INTO "orchestra" VALUES ("107", "Chicago Symphony Orchestra", "7", "1891");
INSERT INTO "orchestra" VALUES ("108", "Vienna Philharmonic", "4", "1842");
INSERT INTO "orchestra" VALUES ("109", "Simulated Orchestra", "1", "2020");
INSERT INTO "orchestra" VALUES ("110", "Experimental Orchestra", "2", "2021");
INSERT INTO "performance" VALUES ("1001", "101");
INSERT INTO "performance" VALUES ("1002", "102");
INSERT INTO "performance" VALUES ("1003", "103");
INSERT INTO "performance" VALUES ("1004", "104");
INSERT INTO "performance" VALUES ("1005", "105");
INSERT INTO "performance" VALUES ("1006", "106");
INSERT INTO "performance" VALUES ("1007", "107");
INSERT INTO "performance" VALUES ("1008", "108");
INSERT INTO "performance" VALUES ("1009", "109");
INSERT INTO "performance" VALUES ("1010", "110");