{"museum": {"columns": [[0, "Museum_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Num_of_Staff", "INT", 0, null, 0], [3, "Open_Year", "TEXT", 0, null, 0]], "primary_keys": ["Museum_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Museum_ID"]]], "check_constraints": []}, "visitor": {"columns": [[0, "ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Level_of_membership", "INT", 0, null, 0], [3, "Age", "INT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}, "visit": {"columns": [[0, "Museum_ID", "INT", 0, null, 1], [1, "visitor_ID", "TEXT", 0, null, 2], [2, "Num_of_Ticket", "INT", 0, null, 0], [3, "Total_spent", "REAL", 0, null, 0]], "primary_keys": ["Museum_ID", "visitor_ID"], "foreign_keys": [[0, 0, "visitor", "visitor_ID", "ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "museum", "Museum_ID", "Museum_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Museum_ID"], [1, 1, "visitor_ID"]]], "check_constraints": []}}
CREATE TABLE museum (
    Museum_ID INT   PRIMARY KEY,
    Name TEXT,
    Num_of_Staff INT,
    Open_Year TEXT,
    UNIQUE (Museum_ID)
);

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

CREATE TABLE visit (
    Museum_ID INT   PRIMARY KEY,
    visitor_ID TEXT   PRIMARY KEY,
    Num_of_Ticket INT,
    Total_spent REAL,
    PRIMARY KEY (Museum_ID, visitor_ID),
    UNIQUE (Museum_ID, visitor_ID),
    FOREIGN KEY (visitor_ID) REFERENCES visitor(ID),
    FOREIGN KEY (Museum_ID) REFERENCES museum(Museum_ID)
);