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





INSERT INTO "museum" VALUES ("1", "National Art Gallery", "50");
INSERT INTO "museum" VALUES ("2", "History Museum", "75");
INSERT INTO "museum" VALUES ("3", "Science Center", "75");
INSERT INTO "museum" VALUES ("4", "Children's Museum", "30");
INSERT INTO "museum" VALUES ("5", "Modern Art Museum", "45");
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 "visit" VALUES ("1", "101", "2", "40.0");
INSERT INTO "visit" VALUES ("2", "102", "1", "20.0");
INSERT INTO "visit" VALUES ("3", "103", "3", "60.0");
INSERT INTO "visit" VALUES ("2", "104", "4", "80.0");
INSERT INTO "visit" VALUES ("3", "105", "1", "20.0");
INSERT INTO "visit" VALUES ("4", "101", "2", "30.0");
INSERT INTO "visit" VALUES ("5", "102", "1", "15.0");
INSERT INTO "visit" VALUES ("3", "101", "5", "100.0");