{"Ref_Hotel_Star_Ratings": {"columns": [[0, "star_rating_code", "CHAR(15)", 1, null, 1], [1, "star_rating_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["star_rating_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "star_rating_code"]]], "check_constraints": []}, "Locations": {"columns": [[0, "Location_ID", "INTEGER", 1, null, 1], [1, "Location_Name", "VARCHAR(255)", 0, null, 0], [2, "Address", "VARCHAR(255)", 0, null, 0], [3, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Location_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Ref_Attraction_Types": {"columns": [[0, "Attraction_Type_Code", "CHAR(15)", 1, null, 1], [1, "Attraction_Type_Description", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Attraction_Type_Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Attraction_Type_Code"]]], "check_constraints": []}, "Visitors": {"columns": [[0, "Tourist_ID", "INTEGER", 1, null, 1], [1, "Tourist_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Tourist_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Tourist_ID"]]], "check_constraints": []}, "Features": {"columns": [[0, "Feature_ID", "INTEGER", 1, null, 1], [1, "Feature_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Feature_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Hotels": {"columns": [[0, "hotel_id", "INTEGER", 1, null, 1], [1, "star_rating_code", "CHAR(15)", 1, null, 0], [2, "pets_allowed_yn", "CHAR(1)", 0, null, 0], [3, "price_range", "REAL", 0, null, 0], [4, "other_hotel_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["hotel_id"], "foreign_keys": [[0, 0, "Ref_Hotel_Star_Ratings", "star_rating_code", "star_rating_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Tourist_Attractions": {"columns": [[0, "Tourist_Attraction_ID", "INTEGER", 1, null, 1], [1, "Attraction_Type_Code", "CHAR(15)", 1, null, 0], [2, "Location_ID", "INTEGER", 1, null, 0], [3, "How_to_Get_There", "VARCHAR(255)", 0, null, 0], [4, "Name", "VARCHAR(255)", 0, null, 0], [5, "Description", "VARCHAR(255)", 0, null, 0], [6, "Opening_Hours", "VARCHAR(255)", 0, null, 0], [7, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Tourist_Attraction_ID"], "foreign_keys": [[0, 0, "Ref_Attraction_Types", "Attraction_Type_Code", "Attraction_Type_Code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Locations", "Location_ID", "Location_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Street_Markets": {"columns": [[0, "Market_ID", "INTEGER", 1, null, 1], [1, "Market_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Market_ID"], "foreign_keys": [[0, 0, "Tourist_Attractions", "Market_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Shops": {"columns": [[0, "Shop_ID", "INTEGER", 1, null, 1], [1, "Shop_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Shop_ID"], "foreign_keys": [[0, 0, "Tourist_Attractions", "Shop_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Museums": {"columns": [[0, "Museum_ID", "INTEGER", 1, null, 1], [1, "Museum_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Museum_ID"], "foreign_keys": [[0, 0, "Tourist_Attractions", "Museum_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Royal_Family": {"columns": [[0, "Royal_Family_ID", "INTEGER", 1, null, 1], [1, "Royal_Family_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Royal_Family_ID"], "foreign_keys": [[0, 0, "Tourist_Attractions", "Royal_Family_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Theme_Parks": {"columns": [[0, "Theme_Park_ID", "INTEGER", 1, null, 1], [1, "Theme_Park_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Theme_Park_ID"], "foreign_keys": [[0, 0, "Tourist_Attractions", "Theme_Park_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Visits": {"columns": [[0, "Visit_ID", "INTEGER", 1, null, 1], [1, "Tourist_Attraction_ID", "INTEGER", 1, null, 0], [2, "Tourist_ID", "INTEGER", 1, null, 0], [3, "Visit_Date", "DATETIME", 1, null, 0], [4, "Visit_Details", "VARCHAR(40)", 1, null, 0]], "primary_keys": ["Visit_ID"], "foreign_keys": [[0, 0, "Visitors", "Tourist_ID", "Tourist_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Tourist_Attractions", "Tourist_Attraction_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Photos": {"columns": [[0, "Photo_ID", "INTEGER", 1, null, 1], [1, "Tourist_Attraction_ID", "INTEGER", 1, null, 0], [2, "Name", "VARCHAR(255)", 0, null, 0], [3, "Description", "VARCHAR(255)", 0, null, 0], [4, "Filename", "VARCHAR(255)", 0, null, 0], [5, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Photo_ID"], "foreign_keys": [[0, 0, "Tourist_Attractions", "Tourist_Attraction_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Staff": {"columns": [[0, "Staff_ID", "INTEGER", 1, null, 1], [1, "Tourist_Attraction_ID", "INTEGER", 1, null, 0], [2, "Name", "VARCHAR(40)", 0, null, 0], [3, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Staff_ID"], "foreign_keys": [[0, 0, "Tourist_Attractions", "Tourist_Attraction_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Tourist_Attraction_Features": {"columns": [[0, "Tourist_Attraction_ID", "INTEGER", 1, null, 1], [1, "Feature_ID", "INTEGER", 1, null, 2]], "primary_keys": ["Tourist_Attraction_ID", "Feature_ID"], "foreign_keys": [[0, 0, "Features", "Feature_ID", "Feature_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Tourist_Attractions", "Tourist_Attraction_ID", "Tourist_Attraction_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Tourist_Attraction_ID"], [1, 1, "Feature_ID"]]], "check_constraints": []}}
CREATE TABLE Ref_Hotel_Star_Ratings (
    star_rating_code CHAR(15) NOT NULL  PRIMARY KEY,
    star_rating_description VARCHAR(80),
    UNIQUE (star_rating_code)
);

CREATE TABLE Locations (
    Location_ID INTEGER NOT NULL  PRIMARY KEY,
    Location_Name VARCHAR(255),
    Address VARCHAR(255),
    Other_Details VARCHAR(255)
);

CREATE TABLE Ref_Attraction_Types (
    Attraction_Type_Code CHAR(15) NOT NULL  PRIMARY KEY,
    Attraction_Type_Description VARCHAR(255),
    UNIQUE (Attraction_Type_Code)
);

CREATE TABLE Visitors (
    Tourist_ID INTEGER NOT NULL  PRIMARY KEY,
    Tourist_Details VARCHAR(255),
    UNIQUE (Tourist_ID)
);

CREATE TABLE Features (
    Feature_ID INTEGER NOT NULL  PRIMARY KEY,
    Feature_Details VARCHAR(255)
);

CREATE TABLE Hotels (
    hotel_id INTEGER NOT NULL  PRIMARY KEY,
    star_rating_code CHAR(15) NOT NULL,
    pets_allowed_yn CHAR(1),
    price_range REAL,
    other_hotel_details VARCHAR(255),
    FOREIGN KEY (star_rating_code) REFERENCES Ref_Hotel_Star_Ratings(star_rating_code)
);

CREATE TABLE Tourist_Attractions (
    Tourist_Attraction_ID INTEGER NOT NULL  PRIMARY KEY,
    Attraction_Type_Code CHAR(15) NOT NULL,
    Location_ID INTEGER NOT NULL,
    How_to_Get_There VARCHAR(255),
    Name VARCHAR(255),
    Description VARCHAR(255),
    Opening_Hours VARCHAR(255),
    Other_Details VARCHAR(255),
    FOREIGN KEY (Attraction_Type_Code) REFERENCES Ref_Attraction_Types(Attraction_Type_Code),
    FOREIGN KEY (Location_ID) REFERENCES Locations(Location_ID)
);

CREATE TABLE Street_Markets (
    Market_ID INTEGER NOT NULL  PRIMARY KEY,
    Market_Details VARCHAR(255),
    FOREIGN KEY (Market_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Shops (
    Shop_ID INTEGER NOT NULL  PRIMARY KEY,
    Shop_Details VARCHAR(255),
    FOREIGN KEY (Shop_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Museums (
    Museum_ID INTEGER NOT NULL  PRIMARY KEY,
    Museum_Details VARCHAR(255),
    FOREIGN KEY (Museum_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Royal_Family (
    Royal_Family_ID INTEGER NOT NULL  PRIMARY KEY,
    Royal_Family_Details VARCHAR(255),
    FOREIGN KEY (Royal_Family_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Theme_Parks (
    Theme_Park_ID INTEGER NOT NULL  PRIMARY KEY,
    Theme_Park_Details VARCHAR(255),
    FOREIGN KEY (Theme_Park_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Visits (
    Visit_ID INTEGER NOT NULL  PRIMARY KEY,
    Tourist_Attraction_ID INTEGER NOT NULL,
    Tourist_ID INTEGER NOT NULL,
    Visit_Date DATETIME NOT NULL,
    Visit_Details VARCHAR(40) NOT NULL,
    FOREIGN KEY (Tourist_ID) REFERENCES Visitors(Tourist_ID),
    FOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Photos (
    Photo_ID INTEGER NOT NULL  PRIMARY KEY,
    Tourist_Attraction_ID INTEGER NOT NULL,
    Name VARCHAR(255),
    Description VARCHAR(255),
    Filename VARCHAR(255),
    Other_Details VARCHAR(255),
    FOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Staff (
    Staff_ID INTEGER NOT NULL  PRIMARY KEY,
    Tourist_Attraction_ID INTEGER NOT NULL,
    Name VARCHAR(40),
    Other_Details VARCHAR(255),
    FOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);

CREATE TABLE Tourist_Attraction_Features (
    Tourist_Attraction_ID INTEGER NOT NULL  PRIMARY KEY,
    Feature_ID INTEGER NOT NULL  PRIMARY KEY,
    PRIMARY KEY (Tourist_Attraction_ID, Feature_ID),
    UNIQUE (Tourist_Attraction_ID, Feature_ID),
    FOREIGN KEY (Feature_ID) REFERENCES Features(Feature_ID),
    FOREIGN KEY (Tourist_Attraction_ID) REFERENCES Tourist_Attractions(Tourist_Attraction_ID)
);