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,
"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")
);

CREATE TABLE "visitor" (
"ID" INT,
"Level_of_membership" INT,
PRIMARY KEY ("ID")
);





INSERT INTO "museum" VALUES ("1", "15", "2005");
INSERT INTO "museum" VALUES ("2", "8", "2010");
INSERT INTO "museum" VALUES ("3", "20", "2000");
INSERT INTO "museum" VALUES ("4", "5", "2015");
INSERT INTO "museum" VALUES ("5", "12", "2008");
INSERT INTO "museum" VALUES ("6", "25", "1999");
INSERT INTO "museum" VALUES ("7", "7", "2009");
INSERT INTO "museum" VALUES ("8", "10", "2007");
INSERT INTO "museum" VALUES ("9", "18", "2003");
INSERT INTO "museum" VALUES ("10", "3", "2012");
INSERT INTO "visitor" VALUES ("101", "1");
INSERT INTO "visitor" VALUES ("102", "2");
INSERT INTO "visitor" VALUES ("103", "3");
INSERT INTO "visitor" VALUES ("104", "1");
INSERT INTO "visitor" VALUES ("105", "2");
INSERT INTO "visitor" VALUES ("106", "3");
INSERT INTO "visitor" VALUES ("107", "1");
INSERT INTO "visitor" VALUES ("108", "2");
INSERT INTO "visitor" VALUES ("109", "3");
INSERT INTO "visitor" VALUES ("110", "1");
INSERT INTO "visit" VALUES ("1", "101", "50.0");
INSERT INTO "visit" VALUES ("1", "102", "30.5");
INSERT INTO "visit" VALUES ("2", "103", "20.0");
INSERT INTO "visit" VALUES ("3", "104", "45.0");
INSERT INTO "visit" VALUES ("3", "105", "60.0");
INSERT INTO "visit" VALUES ("4", "106", "15.0");
INSERT INTO "visit" VALUES ("5", "107", "25.0");
INSERT INTO "visit" VALUES ("6", "108", "80.0");
INSERT INTO "visit" VALUES ("7", "109", "10.0");
INSERT INTO "visit" VALUES ("8", "110", "40.0");
INSERT INTO "visit" VALUES ("9", "101", "55.0");
INSERT INTO "visit" VALUES ("10", "102", "35.0");