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 "visit" VALUES ("101", "V001", "2", "35.50");
INSERT INTO "visit" VALUES ("101", "V002", "1", "15.00");
INSERT INTO "visit" VALUES ("102", "V003", "3", "50.00");
INSERT INTO "visit" VALUES ("103", "V004", "1", "20.00");
INSERT INTO "visit" VALUES ("104", "V005", "2", "40.00");
INSERT INTO "visit" VALUES ("105", "V006", "1", "18.00");
INSERT INTO "visit" VALUES ("106", "V007", "4", "70.00");
INSERT INTO "visit" VALUES ("107", "V008", "1", "22.00");
INSERT INTO "visit" VALUES ("108", "V009", "2", "30.00");
INSERT INTO "visit" VALUES ("109", "V010", "1", "10.00");
INSERT INTO "visitor" VALUES ("1", "Alice", "1", "25");
INSERT INTO "visitor" VALUES ("2", "Bob", "3", "30");
INSERT INTO "visitor" VALUES ("3", "Charlie", "5", "45");
INSERT INTO "visitor" VALUES ("4", "David", "2", "22");
INSERT INTO "visitor" VALUES ("5", "Eve", "4", "38");
INSERT INTO "visitor" VALUES ("6", "Frank", "1", "60");
INSERT INTO "visitor" VALUES ("7", "Grace", "6", "55");
INSERT INTO "visitor" VALUES ("8", "Heidi", "3", "19");
INSERT INTO "visitor" VALUES ("9", "Ivan", "2", "33");
INSERT INTO "visitor" VALUES ("10", "Judy", "1", "28");