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 Smith", "5", "45");
INSERT INTO "visitor" VALUES ("2", "Bob Johnson", "3", "30");
INSERT INTO "visitor" VALUES ("3", "Charlie Brown", "6", "50");
INSERT INTO "visitor" VALUES ("4", "Diana Prince", "4", "25");
INSERT INTO "visitor" VALUES ("5", "Eve Adams", "7", "60");
INSERT INTO "visitor" VALUES ("6", "Frank White", "5", "45");
INSERT INTO "visitor" VALUES ("7", "Grace Lee", "8", "55");
INSERT INTO "visitor" VALUES ("8", "Henry Green", "2", "22");
INSERT INTO "visitor" VALUES ("9", "Ivy King", "6", "50");
INSERT INTO "visitor" VALUES ("10", "Jack Black", "5", "38");
INSERT INTO "visitor" VALUES ("11", "Karen Hall", "7", "62");
INSERT INTO "visitor" VALUES ("12", "Liam Scott", "9", "70");
INSERT INTO "visitor" VALUES ("13", "Mia Clark", "5", "45");
INSERT INTO "visitor" VALUES ("14", "Noah Lewis", "6", "58");
INSERT INTO "visitor" VALUES ("15", "Olivia Young", "8", "65");
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 ("104", "4", "1", "10.0");
INSERT INTO "visit" VALUES ("105", "5", "4", "60.0");
INSERT INTO "visit" VALUES ("101", "6", "2", "30.0");
INSERT INTO "visit" VALUES ("102", "7", "3", "45.0");
INSERT INTO "visit" VALUES ("103", "8", "1", "15.0");
INSERT INTO "visit" VALUES ("104", "9", "2", "30.0");
INSERT INTO "visit" VALUES ("105", "10", "1", "15.0");
INSERT INTO "visit" VALUES ("101", "11", "3", "45.0");
INSERT INTO "visit" VALUES ("102", "12", "4", "60.0");
INSERT INTO "visit" VALUES ("103", "13", "2", "30.0");
INSERT INTO "visit" VALUES ("104", "14", "3", "45.0");
INSERT INTO "visit" VALUES ("105", "15", "2", "30.0");