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





INSERT INTO "visitor" VALUES ("1", "Alice Johnson", "3", "45");
INSERT INTO "visitor" VALUES ("2", "Bob Smith", "4", "38");
INSERT INTO "visitor" VALUES ("3", "Carol White", "5", "50");
INSERT INTO "visitor" VALUES ("4", "David Brown", "6", "50");
INSERT INTO "visitor" VALUES ("5", "Eve Davis", "7", "29");
INSERT INTO "visitor" VALUES ("6", "Frank Miller", "8", "38");
INSERT INTO "visitor" VALUES ("7", "Grace Wilson", "4", "42");
INSERT INTO "visitor" VALUES ("8", "Hank Moore", "5", "42");
INSERT INTO "visitor" VALUES ("9", "Ivy Taylor", "6", "60");
INSERT INTO "visitor" VALUES ("10", "Jack Anderson", "3", "60");
INSERT INTO "visitor" VALUES ("11", "Kara Thomas", "5", "35");
INSERT INTO "visitor" VALUES ("12", "Leo Jackson", "4", "35");
INSERT INTO "visitor" VALUES ("13", "Mona Harris", "7", "45");
INSERT INTO "visitor" VALUES ("14", "Ned Martin", "8", "55");
INSERT INTO "visitor" VALUES ("15", "Olivia Lee", "5", "38");
INSERT INTO "visit" VALUES ("101", "1", "2", "30.0");
INSERT INTO "visit" VALUES ("101", "2", "1", "15.0");
INSERT INTO "visit" VALUES ("102", "3", "3", "45.0");
INSERT INTO "visit" VALUES ("102", "4", "1", "15.0");
INSERT INTO "visit" VALUES ("103", "5", "4", "60.0");
INSERT INTO "visit" VALUES ("103", "6", "2", "30.0");
INSERT INTO "visit" VALUES ("104", "7", "1", "15.0");
INSERT INTO "visit" VALUES ("104", "8", "3", "45.0");
INSERT INTO "visit" VALUES ("105", "9", "2", "30.0");
INSERT INTO "visit" VALUES ("105", "10", "1", "15.0");
INSERT INTO "visit" VALUES ("106", "11", "2", "30.0");
INSERT INTO "visit" VALUES ("106", "12", "1", "15.0");
INSERT INTO "visit" VALUES ("107", "13", "3", "45.0");
INSERT INTO "visit" VALUES ("107", "14", "4", "60.0");
INSERT INTO "visit" VALUES ("108", "15", "1", "15.0");