{"business": {"columns": [[0, "bid", "INT", 0, null, 1], [1, "business_id", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "full_address", "TEXT", 0, null, 0], [4, "city", "TEXT", 0, null, 0], [5, "latitude", "TEXT", 0, null, 0], [6, "longitude", "TEXT", 0, null, 0], [7, "review_count", "INT", 0, null, 0], [8, "is_open", "INT", 0, null, 0], [9, "rating", "REAL", 0, null, 0], [10, "state", "TEXT", 0, null, 0]], "primary_keys": ["bid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "bid"]]], "check_constraints": []}, "category": {"columns": [[0, "id", "INT", 0, null, 1], [1, "business_id", "TEXT", 0, null, 0], [2, "category_name", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "business", "business_id", "business_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "user": {"columns": [[0, "uid", "INT", 0, null, 1], [1, "user_id", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0]], "primary_keys": ["uid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "uid"]]], "check_constraints": []}, "checkin": {"columns": [[0, "cid", "INT", 0, null, 1], [1, "business_id", "TEXT", 0, null, 0], [2, "count", "INT", 0, null, 0], [3, "day", "TEXT", 0, null, 0]], "primary_keys": ["cid"], "foreign_keys": [[0, 0, "business", "business_id", "business_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "cid"]]], "check_constraints": ["CREATE TABLE \"checkin\" ("]}, "neighbourhood": {"columns": [[0, "id", "INT", 0, null, 1], [1, "business_id", "TEXT", 0, null, 0], [2, "neighbourhood_name", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "business", "business_id", "business_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "review": {"columns": [[0, "rid", "INT", 0, null, 1], [1, "business_id", "TEXT", 0, null, 0], [2, "user_id", "TEXT", 0, null, 0], [3, "rating", "REAL", 0, null, 0], [4, "text", "TEXT", 0, null, 0], [5, "year", "INT", 0, null, 0], [6, "month", "TEXT", 0, null, 0]], "primary_keys": ["rid"], "foreign_keys": [[0, 0, "user", "user_id", "user_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "business", "business_id", "business_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "rid"]]], "check_constraints": []}, "tip": {"columns": [[0, "tip_id", "INT", 0, null, 1], [1, "business_id", "TEXT", 0, null, 0], [2, "text", "TEXT", 0, null, 0], [3, "user_id", "TEXT", 0, null, 0], [4, "likes", "INT", 0, null, 0], [5, "year", "INT", 0, null, 0], [6, "month", "TEXT", 0, null, 0]], "primary_keys": ["tip_id"], "foreign_keys": [[0, 0, "user", "user_id", "user_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "business", "business_id", "business_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "tip_id"]]], "check_constraints": []}}
CREATE TABLE business (
    bid INT   PRIMARY KEY,
    business_id TEXT,
    name TEXT,
    full_address TEXT,
    city TEXT,
    latitude TEXT,
    longitude TEXT,
    review_count INT,
    is_open INT,
    rating REAL,
    state TEXT,
    UNIQUE (bid)
);

CREATE TABLE category (
    id INT   PRIMARY KEY,
    business_id TEXT,
    category_name TEXT,
    UNIQUE (id),
    FOREIGN KEY (business_id) REFERENCES business(business_id)
);

CREATE TABLE user (
    uid INT   PRIMARY KEY,
    user_id TEXT,
    name TEXT,
    UNIQUE (uid)
);

CREATE TABLE checkin (
    cid INT   PRIMARY KEY,
    business_id TEXT,
    count INT,
    day TEXT,
    UNIQUE (cid),
    FOREIGN KEY (business_id) REFERENCES business(business_id),
    CREATE TABLE "checkin" (
);

CREATE TABLE neighbourhood (
    id INT   PRIMARY KEY,
    business_id TEXT,
    neighbourhood_name TEXT,
    UNIQUE (id),
    FOREIGN KEY (business_id) REFERENCES business(business_id)
);

CREATE TABLE review (
    rid INT   PRIMARY KEY,
    business_id TEXT,
    user_id TEXT,
    rating REAL,
    text TEXT,
    year INT,
    month TEXT,
    UNIQUE (rid),
    FOREIGN KEY (user_id) REFERENCES user(user_id),
    FOREIGN KEY (business_id) REFERENCES business(business_id)
);

CREATE TABLE tip (
    tip_id INT   PRIMARY KEY,
    business_id TEXT,
    text TEXT,
    user_id TEXT,
    likes INT,
    year INT,
    month TEXT,
    UNIQUE (tip_id),
    FOREIGN KEY (user_id) REFERENCES user(user_id),
    FOREIGN KEY (business_id) REFERENCES business(business_id)
);