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





INSERT INTO "visitor" VALUES ("1", "Alice", "5", "30");
INSERT INTO "visitor" VALUES ("2", "Bob", "4", "25");
INSERT INTO "visitor" VALUES ("3", "Charlie", "6", "40");
INSERT INTO "visitor" VALUES ("4", "David", "3", "22");
INSERT INTO "visitor" VALUES ("5", "Eve", "7", "35");
INSERT INTO "visitor" VALUES ("6", "Frank", "5", "28");
INSERT INTO "visitor" VALUES ("7", "Grace", "2", "50");
INSERT INTO "visitor" VALUES ("8", "Heidi", "6", "45");
INSERT INTO "visitor" VALUES ("9", "Ivan", "1", "18");
INSERT INTO "visitor" VALUES ("10", "Judy", "5", "33");
INSERT INTO "visitor" VALUES ("11", "Kevin", "4", "29");
INSERT INTO "visitor" VALUES ("12", "Liam", "7", "38");
INSERT INTO "visit" VALUES ("101", "1");
INSERT INTO "visit" VALUES ("102", "2");
INSERT INTO "visit" VALUES ("103", "3");
INSERT INTO "visit" VALUES ("104", "4");
INSERT INTO "visit" VALUES ("105", "5");
INSERT INTO "visit" VALUES ("101", "6");
INSERT INTO "visit" VALUES ("102", "7");
INSERT INTO "visit" VALUES ("103", "8");
INSERT INTO "visit" VALUES ("104", "9");
INSERT INTO "visit" VALUES ("105", "10");
INSERT INTO "visit" VALUES ("101", "11");
INSERT INTO "visit" VALUES ("102", "12");
INSERT INTO "visit" VALUES ("106", "1");
INSERT INTO "visit" VALUES ("107", "3");
INSERT INTO "visit" VALUES ("108", "5");
INSERT INTO "visit" VALUES ("109", "6");
INSERT INTO "visit" VALUES ("110", "8");
INSERT INTO "visit" VALUES ("111", "10");
INSERT INTO "visit" VALUES ("112", "12");