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,
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,
"Age" INT,
PRIMARY KEY ("ID")
);





INSERT INTO "museum" VALUES ("1", "15");
INSERT INTO "museum" VALUES ("2", "8");
INSERT INTO "museum" VALUES ("3", "20");
INSERT INTO "museum" VALUES ("4", "5");
INSERT INTO "museum" VALUES ("5", "12");
INSERT INTO "visitor" VALUES ("101", "3", "25");
INSERT INTO "visitor" VALUES ("102", "4", "40");
INSERT INTO "visitor" VALUES ("103", "5", "30");
INSERT INTO "visitor" VALUES ("104", "2", "22");
INSERT INTO "visitor" VALUES ("105", "1", "35");
INSERT INTO "visitor" VALUES ("106", "6", "28");
INSERT INTO "visitor" VALUES ("107", "4", "50");
INSERT INTO "visitor" VALUES ("108", "3", "19");
INSERT INTO "visitor" VALUES ("109", "7", "45");
INSERT INTO "visitor" VALUES ("110", "4", "60");
INSERT INTO "visit" VALUES ("1", "101", "2", "30.0");
INSERT INTO "visit" VALUES ("1", "102", "1", "15.0");
INSERT INTO "visit" VALUES ("2", "103", "3", "45.0");
INSERT INTO "visit" VALUES ("2", "104", "1", "10.0");
INSERT INTO "visit" VALUES ("3", "105", "4", "60.0");
INSERT INTO "visit" VALUES ("3", "106", "2", "25.0");
INSERT INTO "visit" VALUES ("4", "107", "1", "12.0");
INSERT INTO "visit" VALUES ("4", "108", "3", "35.0");
INSERT INTO "visit" VALUES ("5", "109", "2", "40.0");
INSERT INTO "visit" VALUES ("5", "110", "1", "20.0");