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 "museum" (
"Museum_ID" INT,
"Name" TEXT,
PRIMARY KEY ("Museum_ID")
);

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





INSERT INTO "museum" VALUES ("1", "The Louvre Museum");
INSERT INTO "museum" VALUES ("2", "The British Museum");
INSERT INTO "museum" VALUES ("3", "The Metropolitan Museum of Art");
INSERT INTO "museum" VALUES ("4", "Rijksmuseum");
INSERT INTO "museum" VALUES ("5", "Uffizi Gallery");
INSERT INTO "museum" VALUES ("6", "National Museum of Natural History");
INSERT INTO "visitor" VALUES ("101", "Alice Smith", "1", "30");
INSERT INTO "visitor" VALUES ("102", "Bob Johnson", "2", "45");
INSERT INTO "visitor" VALUES ("103", "Charlie Brown", "1", "22");
INSERT INTO "visitor" VALUES ("104", "Diana Prince", "3", "50");
INSERT INTO "visitor" VALUES ("105", "Eve Adams", "1", "35");
INSERT INTO "visitor" VALUES ("106", "Frank White", "2", "60");
INSERT INTO "visitor" VALUES ("107", "Grace Lee", "1", "28");
INSERT INTO "visitor" VALUES ("108", "Henry King", "3", "40");
INSERT INTO "visitor" VALUES ("109", "Ivy Green", "1", "19");
INSERT INTO "visitor" VALUES ("110", "Jack Black", "2", "55");
INSERT INTO "visit" VALUES ("1", "101", "2", "40.00");
INSERT INTO "visit" VALUES ("1", "102", "1", "25.00");
INSERT INTO "visit" VALUES ("2", "103", "3", "60.00");
INSERT INTO "visit" VALUES ("3", "104", "2", "50.00");
INSERT INTO "visit" VALUES ("1", "105", "1", "20.00");
INSERT INTO "visit" VALUES ("4", "106", "4", "80.00");
INSERT INTO "visit" VALUES ("2", "107", "2", "40.00");
INSERT INTO "visit" VALUES ("5", "108", "1", "30.00");
INSERT INTO "visit" VALUES ("3", "109", "2", "40.00");
INSERT INTO "visit" VALUES ("6", "110", "3", "75.00");
INSERT INTO "visit" VALUES ("1", "103", "1", "20.00");
INSERT INTO "visit" VALUES ("2", "101", "1", "20.00");
INSERT INTO "visit" VALUES ("4", "105", "2", "40.00");
INSERT INTO "visit" VALUES ("5", "107", "1", "20.00");
INSERT INTO "visit" VALUES ("6", "109", "1", "20.00");