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"),
FOREIGN KEY ("visitor_ID") REFERENCES "visitor"("ID")
);

CREATE TABLE "visitor" (
"ID" INT UNIQUE,
"Name" TEXT,
"Level_of_membership" INT,
"Age" INT,
PRIMARY KEY ("ID")
);





INSERT INTO "visitor" VALUES ("101", "Alice Smith", "3", "35");
INSERT INTO "visitor" VALUES ("102", "Bob Johnson", "2", "28");
INSERT INTO "visitor" VALUES ("103", "Charlie Brown", "1", "50");
INSERT INTO "visitor" VALUES ("104", "Diana Prince", "3", "42");
INSERT INTO "visitor" VALUES ("105", "Eve Adams", "2", "22");
INSERT INTO "visitor" VALUES ("106", "Frank White", "1", "60");
INSERT INTO "visitor" VALUES ("107", "Grace Lee", "3", "30");
INSERT INTO "visitor" VALUES ("108", "Henry Green", "2", "45");
INSERT INTO "visitor" VALUES ("109", "Ivy King", "1", "18");
INSERT INTO "visitor" VALUES ("110", "Jack Black", "3", "55");
INSERT INTO "visit" VALUES ("1", "101", "2", "50.00");
INSERT INTO "visit" VALUES ("2", "101", "1", "25.00");
INSERT INTO "visit" VALUES ("3", "102", "3", "75.00");
INSERT INTO "visit" VALUES ("1", "103", "1", "25.00");
INSERT INTO "visit" VALUES ("2", "104", "4", "100.00");
INSERT INTO "visit" VALUES ("3", "104", "2", "50.00");
INSERT INTO "visit" VALUES ("1", "105", "1", "25.00");
INSERT INTO "visit" VALUES ("2", "106", "2", "50.00");
INSERT INTO "visit" VALUES ("3", "107", "3", "75.00");
INSERT INTO "visit" VALUES ("1", "108", "2", "50.00");
INSERT INTO "visit" VALUES ("2", "109", "1", "25.00");
INSERT INTO "visit" VALUES ("3", "110", "4", "100.00");
INSERT INTO "visit" VALUES ("1", "104", "1", "25.00");
INSERT INTO "visit" VALUES ("2", "101", "3", "75.00");
INSERT INTO "visit" VALUES ("3", "102", "1", "25.00");
INSERT INTO "visit" VALUES ("1", "107", "2", "50.00");
INSERT INTO "visit" VALUES ("2", "110", "2", "50.00");