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

CREATE TABLE "visit" (
"Museum_ID" INT,
"visitor_ID" TEXT,
"Num_of_Ticket" INT,
"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", "History Museum", "15", "2005");
INSERT INTO "museum" VALUES ("2", "Modern Art Gallery", "8", "2012");
INSERT INTO "museum" VALUES ("3", "Science Center", "20", "2015");
INSERT INTO "museum" VALUES ("4", "Children's Museum", "5", "2018");
INSERT INTO "museum" VALUES ("5", "Maritime Museum", "10", "2009");
INSERT INTO "museum" VALUES ("6", "Natural History", "12", "2011");
INSERT INTO "museum" VALUES ("7", "Cultural Heritage", "7", "2013");
INSERT INTO "museum" VALUES ("8", "Technology Museum", "25", "2000");
INSERT INTO "museum" VALUES ("9", "Photography Museum", "6", "2014");
INSERT INTO "museum" VALUES ("10", "Aviation Museum", "18", "2016");
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", "2", "30.0");
INSERT INTO "visit" VALUES ("2", "102", "1", "15.0");
INSERT INTO "visit" VALUES ("3", "103", "3", "45.0");
INSERT INTO "visit" VALUES ("4", "104", "1", "10.0");
INSERT INTO "visit" VALUES ("5", "105", "2", "25.0");
INSERT INTO "visit" VALUES ("6", "106", "1", "12.0");
INSERT INTO "visit" VALUES ("7", "107", "4", "60.0");
INSERT INTO "visit" VALUES ("8", "108", "1", "20.0");
INSERT INTO "visit" VALUES ("9", "109", "2", "30.0");
INSERT INTO "visit" VALUES ("10", "110", "3", "40.0");