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

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





INSERT INTO "visitor" VALUES ("1", "2", "25");
INSERT INTO "visitor" VALUES ("2", "1", "29");
INSERT INTO "visitor" VALUES ("3", "3", "30");
INSERT INTO "visitor" VALUES ("4", "2", "18");
INSERT INTO "visitor" VALUES ("5", "1", "45");
INSERT INTO "visitor" VALUES ("6", "3", "22");
INSERT INTO "visitor" VALUES ("7", "2", "31");
INSERT INTO "visitor" VALUES ("8", "1", "27");
INSERT INTO "visitor" VALUES ("9", "2", "60");
INSERT INTO "visitor" VALUES ("10", "3", "15");
INSERT INTO "visit" VALUES ("101", "1", "50.0");
INSERT INTO "visit" VALUES ("102", "2", "30.5");
INSERT INTO "visit" VALUES ("103", "3", "0.0");
INSERT INTO "visit" VALUES ("101", "4", "20.0");
INSERT INTO "visit" VALUES ("104", "5", "100.0");
INSERT INTO "visit" VALUES ("102", "6", "15.0");
INSERT INTO "visit" VALUES ("103", "7", "40.0");
INSERT INTO "visit" VALUES ("104", "8", "25.0");
INSERT INTO "visit" VALUES ("101", "9", "60.0");
INSERT INTO "visit" VALUES ("102", "10", "10.0");