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")
);

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





INSERT INTO "visit" VALUES ("101", "V001", "2", "30.50");
INSERT INTO "visit" VALUES ("101", "V002", "1", "15.00");
INSERT INTO "visit" VALUES ("102", "V003", "3", "45.75");
INSERT INTO "visit" VALUES ("103", "V004", "1", "18.00");
INSERT INTO "visit" VALUES ("104", "V005", "5", "75.25");
INSERT INTO "visit" VALUES ("105", "V006", "2", "32.00");
INSERT INTO "visit" VALUES ("101", "V007", "4", "60.00");
INSERT INTO "visit" VALUES ("102", "V008", "1", "16.50");
INSERT INTO "visit" VALUES ("103", "V009", "2", "30.00");
INSERT INTO "visit" VALUES ("104", "V010", "3", "48.00");
INSERT INTO "visit" VALUES ("105", "V011", "1", "15.00");
INSERT INTO "visit" VALUES ("101", "V012", "6", "90.00");
INSERT INTO "visit" VALUES ("102", "V013", "1", "15.00");
INSERT INTO "visit" VALUES ("103", "V014", "2", "30.00");
INSERT INTO "visit" VALUES ("104", "V015", "1", "15.00");
INSERT INTO "visitor" VALUES ("1", "Gold", "45");
INSERT INTO "visitor" VALUES ("2", "Silver", "30");
INSERT INTO "visitor" VALUES ("3", "Bronze", "22");
INSERT INTO "visitor" VALUES ("4", "None", "50");
INSERT INTO "visitor" VALUES ("5", "Gold", "60");
INSERT INTO "visitor" VALUES ("6", "Silver", "35");
INSERT INTO "visitor" VALUES ("7", "Gold", "28");
INSERT INTO "visitor" VALUES ("8", "Bronze", "19");
INSERT INTO "visitor" VALUES ("9", "None", "40");
INSERT INTO "visitor" VALUES ("10", "Silver", "55");
INSERT INTO "visitor" VALUES ("11", "None", "25");
INSERT INTO "visitor" VALUES ("12", "Gold", "70");
INSERT INTO "visitor" VALUES ("13", "Bronze", "20");
INSERT INTO "visitor" VALUES ("14", "None", "33");
INSERT INTO "visitor" VALUES ("15", "Silver", "48");