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,
"Num_of_Staff" INT,
"Open_Year" 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")
);

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





INSERT INTO "museum" VALUES ("1", "Art Gallery of Ontario", "350", "1900");
INSERT INTO "museum" VALUES ("2", "Royal Ontario Museum", "500", "1914");
INSERT INTO "museum" VALUES ("3", "Museum of Modern Art", "600", "1929");
INSERT INTO "museum" VALUES ("4", "The Louvre", "2000", "1793");
INSERT INTO "museum" VALUES ("5", "National Gallery of Art", "700", "1937");
INSERT INTO "museum" VALUES ("6", "Guggenheim Museum", "400", "1959");
INSERT INTO "museum" VALUES ("7", "Smithsonian National Museum of Natural History", "1200", "1910");
INSERT INTO "museum" VALUES ("8", "New Museum", "150", "2007");
INSERT INTO "museum" VALUES ("9", "The Broad", "250", "2015");
INSERT INTO "museum" VALUES ("10", "Zeitz MOCAA", "100", "2017");
INSERT INTO "museum" VALUES ("11", "Museum of Tomorrow", "120", "2015");
INSERT INTO "museum" VALUES ("12", "Louvre Abu Dhabi", "300", "2017");
INSERT INTO "museum" VALUES ("13", "National Museum of Qatar", "200", "2019");
INSERT INTO "museum" VALUES ("14", "Design Museum", "80", "2016");
INSERT INTO "museum" VALUES ("15", "V&A Dundee", "90", "2018");
INSERT INTO "visit" VALUES ("1", "101", "2", "30.0");
INSERT INTO "visit" VALUES ("1", "102", "1", "15.0");
INSERT INTO "visit" VALUES ("2", "103", "3", "45.0");
INSERT INTO "visit" VALUES ("3", "104", "2", "40.0");
INSERT INTO "visit" VALUES ("4", "105", "4", "80.0");
INSERT INTO "visit" VALUES ("5", "106", "1", "20.0");
INSERT INTO "visit" VALUES ("6", "107", "2", "35.0");
INSERT INTO "visit" VALUES ("7", "108", "3", "60.0");
INSERT INTO "visit" VALUES ("8", "109", "1", "25.0");
INSERT INTO "visit" VALUES ("9", "110", "2", "50.0");
INSERT INTO "visit" VALUES ("10", "111", "1", "22.0");
INSERT INTO "visit" VALUES ("11", "112", "2", "48.0");
INSERT INTO "visit" VALUES ("12", "113", "3", "75.0");
INSERT INTO "visit" VALUES ("13", "114", "1", "30.0");
INSERT INTO "visit" VALUES ("14", "115", "2", "40.0");
INSERT INTO "visit" VALUES ("15", "116", "1", "25.0");
INSERT INTO "visit" VALUES ("9", "117", "1", "25.0");
INSERT INTO "visit" VALUES ("10", "118", "2", "44.0");
INSERT INTO "visit" VALUES ("11", "119", "1", "24.0");
INSERT INTO "visit" VALUES ("12", "120", "2", "50.0");
INSERT INTO "visitor" VALUES ("101");
INSERT INTO "visitor" VALUES ("102");
INSERT INTO "visitor" VALUES ("103");
INSERT INTO "visitor" VALUES ("104");
INSERT INTO "visitor" VALUES ("105");
INSERT INTO "visitor" VALUES ("106");
INSERT INTO "visitor" VALUES ("107");
INSERT INTO "visitor" VALUES ("108");
INSERT INTO "visitor" VALUES ("109");
INSERT INTO "visitor" VALUES ("110");
INSERT INTO "visitor" VALUES ("111");
INSERT INTO "visitor" VALUES ("112");
INSERT INTO "visitor" VALUES ("113");
INSERT INTO "visitor" VALUES ("114");
INSERT INTO "visitor" VALUES ("115");
INSERT INTO "visitor" VALUES ("116");
INSERT INTO "visitor" VALUES ("117");
INSERT INTO "visitor" VALUES ("118");
INSERT INTO "visitor" VALUES ("119");
INSERT INTO "visitor" VALUES ("120");