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 "visitor" VALUES ("1", "4", "5");
INSERT INTO "visitor" VALUES ("2", "3", "18");
INSERT INTO "visitor" VALUES ("3", "5", "30");
INSERT INTO "visitor" VALUES ("4", "2", "65");
INSERT INTO "visitor" VALUES ("5", "4", "90");
INSERT INTO "visitor" VALUES ("6", "1", "1");
INSERT INTO "visitor" VALUES ("7", "6", "40");
INSERT INTO "visitor" VALUES ("8", "4", "100");
INSERT INTO "visitor" VALUES ("9", "3", "12");
INSERT INTO "visitor" VALUES ("10", "4", "0");
INSERT INTO "visitor" VALUES ("11", "2", "85");
INSERT INTO "visitor" VALUES ("12", "5", "50");
INSERT INTO "visitor" VALUES ("13", "4", "17");
INSERT INTO "visitor" VALUES ("14", "3", "33");
INSERT INTO "visitor" VALUES ("15", "4", "4");
INSERT INTO "visit" VALUES ("1", "1", "2", "30.0");
INSERT INTO "visit" VALUES ("1", "2", "1", "15.0");
INSERT INTO "visit" VALUES ("1", "3", "3", "45.0");
INSERT INTO "visit" VALUES ("2", "4", "1", "20.0");
INSERT INTO "visit" VALUES ("2", "5", "2", "40.0");
INSERT INTO "visit" VALUES ("2", "6", "1", "10.0");
INSERT INTO "visit" VALUES ("3", "7", "4", "80.0");
INSERT INTO "visit" VALUES ("3", "8", "1", "25.0");
INSERT INTO "visit" VALUES ("3", "9", "2", "35.0");
INSERT INTO "visit" VALUES ("1", "10", "1", "15.0");
INSERT INTO "visit" VALUES ("1", "11", "3", "45.0");
INSERT INTO "visit" VALUES ("2", "12", "2", "30.0");
INSERT INTO "visit" VALUES ("2", "13", "1", "15.0");
INSERT INTO "visit" VALUES ("3", "14", "2", "40.0");
INSERT INTO "visit" VALUES ("3", "15", "1", "10.0");