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", "Vienna Philharmonic");
INSERT INTO "orchestra" VALUES ("4", "London Symphony Orchestra");
INSERT INTO "orchestra" VALUES ("5", "Chicago Symphony Orchestra");
INSERT INTO "performance" VALUES ("101", "2023-01-15");
INSERT INTO "performance" VALUES ("102", "2023-01-16");
INSERT INTO "performance" VALUES ("103", "2023-02-10");
INSERT INTO "performance" VALUES ("104", "2023-02-11");
INSERT INTO "performance" VALUES ("105", "2023-03-05");
INSERT INTO "performance" VALUES ("106", "2023-03-06");
INSERT INTO "performance" VALUES ("107", "2023-04-01");
INSERT INTO "performance" VALUES ("108", "2023-04-02");
INSERT INTO "show" VALUES ("201", "101", "1500.0");
INSERT INTO "show" VALUES ("202", "101", "1520.5");
INSERT INTO "show" VALUES ("203", "102", "1400.0");
INSERT INTO "show" VALUES ("204", "103", "0.0");
INSERT INTO "show" VALUES ("205", "104", "1800.0");
INSERT INTO "show" VALUES ("206", "105", "1750.0");
INSERT INTO "show" VALUES ("207", "106", "1600.0");
INSERT INTO "show" VALUES ("208", "107", "2000.0");
INSERT INTO "show" VALUES ("209", "108", "1950.0");
INSERT INTO "show" VALUES ("210", "108", "1950.0");