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,
PRIMARY KEY ("ID")
);





INSERT INTO "visitor" VALUES ("1", "Alice Johnson", "5");
INSERT INTO "visitor" VALUES ("2", "Bob Smith", "3");
INSERT INTO "visitor" VALUES ("3", "Carol White", "7");
INSERT INTO "visitor" VALUES ("4", "David Brown", "4");
INSERT INTO "visitor" VALUES ("5", "Eva Green", "6");
INSERT INTO "visitor" VALUES ("6", "Frank Black", "2");
INSERT INTO "visitor" VALUES ("7", "Grace Lee", "8");
INSERT INTO "visitor" VALUES ("8", "Hank Miller", "1");
INSERT INTO "visitor" VALUES ("9", "Ivy Wilson", "5");
INSERT INTO "visitor" VALUES ("10", "Jack Davis", "9");
INSERT INTO "visit" VALUES ("101", "1", "2", "30.0");
INSERT INTO "visit" VALUES ("102", "1", "1", "15.0");
INSERT INTO "visit" VALUES ("101", "2", "3", "45.0");
INSERT INTO "visit" VALUES ("103", "3", "4", "60.0");
INSERT INTO "visit" VALUES ("104", "3", "1", "15.0");
INSERT INTO "visit" VALUES ("102", "4", "2", "30.0");
INSERT INTO "visit" VALUES ("101", "5", "5", "75.0");
INSERT INTO "visit" VALUES ("103", "6", "1", "15.0");
INSERT INTO "visit" VALUES ("104", "7", "3", "45.0");
INSERT INTO "visit" VALUES ("102", "8", "2", "30.0");
INSERT INTO "visit" VALUES ("101", "9", "1", "15.0");
INSERT INTO "visit" VALUES ("103", "10", "6", "90.0");