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 "performance" (
"Performance_ID" INT,
"Type" TEXT,
"Official_ratings_(millions)" FLOAT,
"Weekly_rank" TEXT,
PRIMARY KEY ("Performance_ID")
);

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





INSERT INTO "performance" VALUES ("1", "Concert", "5.2", "Top 10");
INSERT INTO "performance" VALUES ("2", "Play", "3.8", "Top 20");
INSERT INTO "performance" VALUES ("3", "Opera", "7.1", "Top 5");
INSERT INTO "performance" VALUES ("4", "Concert", "4.5", "Top 15");
INSERT INTO "performance" VALUES ("5", "Play", "2.9", "Top 30");
INSERT INTO "performance" VALUES ("6", "Opera", "6.0", "Top 10");
INSERT INTO "performance" VALUES ("7", "Concert", "5.8", "Top 10");
INSERT INTO "performance" VALUES ("8", "Play", "3.1", "Top 25");
INSERT INTO "performance" VALUES ("9", "Opera", "8.0", "Top 3");
INSERT INTO "performance" VALUES ("10", "Concert", "4.9", "Top 12");
INSERT INTO "show" VALUES ("1", "1500.0");
INSERT INTO "show" VALUES ("2", "800.0");
INSERT INTO "show" VALUES ("3", "2500.0");
INSERT INTO "show" VALUES ("4", "1200.0");
INSERT INTO "show" VALUES ("5", "600.0");
INSERT INTO "show" VALUES ("6", "2000.0");
INSERT INTO "show" VALUES ("7", "1600.0");
INSERT INTO "show" VALUES ("8", "750.0");
INSERT INTO "show" VALUES ("9", "2800.0");
INSERT INTO "show" VALUES ("10", "1300.0");