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", "5", "68");
INSERT INTO "visitor" VALUES ("2", "Bob Smith", "3", "45");
INSERT INTO "visitor" VALUES ("3", "Carol White", "6", "72");
INSERT INTO "visitor" VALUES ("4", "David Brown", "4", "34");
INSERT INTO "visitor" VALUES ("5", "Eve Davis", "7", "59");
INSERT INTO "visitor" VALUES ("6", "Frank Miller", "2", "50");
INSERT INTO "visitor" VALUES ("7", "Grace Wilson", "8", "80");
INSERT INTO "visitor" VALUES ("8", "Hank Moore", "5", "40");
INSERT INTO "visitor" VALUES ("9", "Ivy Taylor", "1", "29");
INSERT INTO "visitor" VALUES ("10", "Jack Anderson", "9", "85");
INSERT INTO "visit" VALUES ("101", "1", "2", "30.0");
INSERT INTO "visit" VALUES ("102", "2", "1", "15.0");
INSERT INTO "visit" VALUES ("103", "3", "3", "45.0");
INSERT INTO "visit" VALUES ("101", "4", "1", "15.0");
INSERT INTO "visit" VALUES ("102", "5", "4", "60.0");
INSERT INTO "visit" VALUES ("103", "6", "2", "30.0");
INSERT INTO "visit" VALUES ("101", "7", "5", "75.0");
INSERT INTO "visit" VALUES ("102", "8", "1", "15.0");
INSERT INTO "visit" VALUES ("103", "9", "1", "15.0");
INSERT INTO "visit" VALUES ("101", "10", "3", "45.0");