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 "museum" (
"Museum_ID" INT UNIQUE,
"Num_of_Staff" INT,
"Open_Year" TEXT,
PRIMARY KEY ("Museum_ID")
);

CREATE TABLE "visit" (
"Museum_ID" INT,
"visitor_ID" TEXT,
"Total_spent" FLOAT,
PRIMARY KEY ("Museum_ID", "visitor_ID"),
FOREIGN KEY ("Museum_ID") REFERENCES "museum"("Museum_ID")
);





INSERT INTO "museum" VALUES ("1", "15", "2005");
INSERT INTO "museum" VALUES ("2", "20", "2007");
INSERT INTO "museum" VALUES ("3", "10", "2008");
INSERT INTO "museum" VALUES ("4", "25", "2013");
INSERT INTO "museum" VALUES ("5", "30", "2014");
INSERT INTO "museum" VALUES ("6", "12", "2015");
INSERT INTO "museum" VALUES ("7", "18", "2006");
INSERT INTO "museum" VALUES ("8", "22", "2012");
INSERT INTO "museum" VALUES ("9", "16", "2010");
INSERT INTO "museum" VALUES ("10", "14", "2018");
INSERT INTO "visit" VALUES ("1", "V001", "50.0");
INSERT INTO "visit" VALUES ("1", "V002", "30.5");
INSERT INTO "visit" VALUES ("2", "V003", "20.0");
INSERT INTO "visit" VALUES ("3", "V004", "15.0");
INSERT INTO "visit" VALUES ("4", "V005", "40.0");
INSERT INTO "visit" VALUES ("5", "V006", "60.0");
INSERT INTO "visit" VALUES ("6", "V007", "25.0");
INSERT INTO "visit" VALUES ("7", "V008", "35.0");
INSERT INTO "visit" VALUES ("8", "V009", "45.0");
INSERT INTO "visit" VALUES ("9", "V010", "55.0");
INSERT INTO "visit" VALUES ("10", "V011", "65.0");