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





INSERT INTO "visitor" VALUES ("1", "Alice", "5", "30");
INSERT INTO "visitor" VALUES ("2", "Bob", "6", "45");
INSERT INTO "visitor" VALUES ("3", "Charlie", "3", "25");
INSERT INTO "visitor" VALUES ("4", "David", "7", "50");
INSERT INTO "visitor" VALUES ("5", "Eve", "4", "35");
INSERT INTO "visitor" VALUES ("6", "Frank", "5", "60");
INSERT INTO "visitor" VALUES ("7", "Grace", "8", "40");
INSERT INTO "visitor" VALUES ("8", "Heidi", "2", "20");
INSERT INTO "visitor" VALUES ("9", "Ivan", "6", "55");
INSERT INTO "visitor" VALUES ("10", "Judy", "5", "32");
INSERT INTO "visit" VALUES ("101", "1", "2", "25.50");
INSERT INTO "visit" VALUES ("102", "2", "1", "15.00");
INSERT INTO "visit" VALUES ("103", "3", "3", "30.75");
INSERT INTO "visit" VALUES ("104", "4", "2", "28.00");
INSERT INTO "visit" VALUES ("105", "5", "1", "12.50");
INSERT INTO "visit" VALUES ("101", "6", "4", "50.00");
INSERT INTO "visit" VALUES ("102", "7", "2", "20.00");
INSERT INTO "visit" VALUES ("103", "8", "1", "10.00");
INSERT INTO "visit" VALUES ("104", "9", "3", "40.00");
INSERT INTO "visit" VALUES ("105", "10", "2", "25.00");
INSERT INTO "visit" VALUES ("101", "2", "1", "15.00");
INSERT INTO "visit" VALUES ("102", "4", "2", "28.00");
INSERT INTO "visit" VALUES ("103", "6", "4", "50.00");
INSERT INTO "visit" VALUES ("104", "7", "2", "20.00");
INSERT INTO "visit" VALUES ("105", "9", "3", "40.00");