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 "orchestra" (
"Orchestra_ID" INT,
"Orchestra" TEXT,
PRIMARY KEY ("Orchestra_ID")
);

CREATE TABLE "performance" (
"Performance_ID" INT UNIQUE,
"Date" TEXT,
PRIMARY KEY ("Performance_ID")
);

CREATE TABLE "show" (
"Show_ID" INT,
"Performance_ID" INT,
"Attendance" FLOAT,
FOREIGN KEY ("Performance_ID") REFERENCES "performance"("Performance_ID")
);





INSERT INTO "orchestra" VALUES ("1", "New York Philharmonic");
INSERT INTO "orchestra" VALUES ("2", "Berlin Philharmonic");
INSERT INTO "orchestra" VALUES ("3", "London Symphony Orchestra");
INSERT INTO "orchestra" VALUES ("4", "Vienna Philharmonic");
INSERT INTO "orchestra" VALUES ("5", "Chicago Symphony Orchestra");
INSERT INTO "performance" VALUES ("101", "2023-01-15");
INSERT INTO "performance" VALUES ("102", "2023-02-20");
INSERT INTO "performance" VALUES ("103", "2023-03-10");
INSERT INTO "performance" VALUES ("104", "2023-04-05");
INSERT INTO "performance" VALUES ("105", "2023-05-22");
INSERT INTO "performance" VALUES ("106", "2023-06-18");
INSERT INTO "performance" VALUES ("107", "2023-07-30");
INSERT INTO "performance" VALUES ("108", "2023-08-14");
INSERT INTO "performance" VALUES ("109", "2023-09-09");
INSERT INTO "performance" VALUES ("110", "2023-10-25");
INSERT INTO "show" VALUES ("201", "101", "1500.0");
INSERT INTO "show" VALUES ("202", "101", "1520.5");
INSERT INTO "show" VALUES ("203", "102", "0.0");
INSERT INTO "show" VALUES ("204", "102", "NULL");
INSERT INTO "show" VALUES ("205", "103", "3000.0");
INSERT INTO "show" VALUES ("206", "104", "50000.0");
INSERT INTO "show" VALUES ("207", "105", "1200.0");
INSERT INTO "show" VALUES ("208", "106", "1300.0");
INSERT INTO "show" VALUES ("209", "107", "1400.0");
INSERT INTO "show" VALUES ("210", "108", "1600.0");
INSERT INTO "show" VALUES ("211", "109", "1700.0");
INSERT INTO "show" VALUES ("212", "110", "1800.0");
INSERT INTO "show" VALUES ("213", "110", "1850.0");
INSERT INTO "show" VALUES ("214", "110", "1900.0");
INSERT INTO "show" VALUES ("215", "110", "1950.0");