CREATE TABLE Attributes
(
    attribute_id   INTEGER
        constraint Attributes_pk
            primary key,
    attribute_name TEXT
);
Attributes
CREATE TABLE Categories
(
    category_id   INTEGER
        constraint Categories_pk
            primary key,
    category_name TEXT
);
Categories
CREATE TABLE Compliments
(
    compliment_id   INTEGER
        constraint Compliments_pk
            primary key,
    compliment_type TEXT
);
Compliments
CREATE TABLE Days
(
    day_id      INTEGER
        constraint Days_pk
            primary key,
    day_of_week TEXT
);
Days
CREATE TABLE Years
(
    year_id     INTEGER
        constraint Years_pk
            primary key,
    actual_year INTEGER
);
Years
CREATE TABLE "Business_Attributes"
(
    attribute_id    INTEGER
        constraint Business_Attributes_Attributes_attribute_id_fk
            references Attributes,
    business_id     INTEGER
        constraint Business_Attributes_Business_business_id_fk
            references Business,
    attribute_value TEXT,
    constraint Business_Attributes_pk
        primary key (attribute_id, business_id)
);
Business_Attributes
CREATE TABLE "Business_Categories"
(
    business_id INTEGER
        constraint Business_Categories_Business_business_id_fk
            references Business,
    category_id INTEGER
        constraint Business_Categories_Categories_category_id_fk
            references Categories,
    constraint Business_Categories_pk
        primary key (business_id, category_id)
);
Business_Categories
CREATE TABLE "Business_Hours"
(
    business_id  INTEGER
        constraint Business_Hours_Business_business_id_fk
            references Business,
    day_id       INTEGER
        constraint Business_Hours_Days_day_id_fk
            references Days,
    opening_time TEXT,
    closing_time TEXT,
    constraint Business_Hours_pk
        primary key (business_id, day_id)
);
Business_Hours
CREATE TABLE "Checkins"
(
    business_id   INTEGER
        constraint Checkins_Business_business_id_fk
            references Business,
    day_id        INTEGER
        constraint Checkins_Days_day_id_fk
            references Days,
    label_time_0  TEXT,
    label_time_1  TEXT,
    label_time_2  TEXT,
    label_time_3  TEXT,
    label_time_4  TEXT,
    label_time_5  TEXT,
    label_time_6  TEXT,
    label_time_7  TEXT,
    label_time_8  TEXT,
    label_time_9  TEXT,
    label_time_10 TEXT,
    label_time_11 TEXT,
    label_time_12 TEXT,
    label_time_13 TEXT,
    label_time_14 TEXT,
    label_time_15 TEXT,
    label_time_16 TEXT,
    label_time_17 TEXT,
    label_time_18 TEXT,
    label_time_19 TEXT,
    label_time_20 TEXT,
    label_time_21 TEXT,
    label_time_22 TEXT,
    label_time_23 TEXT,
    constraint Checkins_pk
        primary key (business_id, day_id)
);
Checkins
CREATE TABLE "Elite"
(
    user_id INTEGER
        constraint Elite_Users_user_id_fk
            references Users,
    year_id INTEGER
        constraint Elite_Years_year_id_fk
            references Years,
    constraint Elite_pk
        primary key (user_id, year_id)
);
Elite
CREATE TABLE "Reviews"
(
    business_id         INTEGER
        constraint Reviews_Business_business_id_fk
            references Business,
    user_id             INTEGER
        constraint Reviews_Users_user_id_fk
            references Users,
    review_stars        INTEGER,
    review_votes_funny  TEXT,
    review_votes_useful TEXT,
    review_votes_cool   TEXT,
    review_length       TEXT,
    constraint Reviews_pk
        primary key (business_id, user_id)
);
Reviews
CREATE TABLE "Tips"
(
    business_id INTEGER
        constraint Tips_Business_business_id_fk
            references Business,
    user_id     INTEGER
        constraint Tips_Users_user_id_fk
            references Users,
    likes       INTEGER,
    tip_length  TEXT,
    constraint Tips_pk
        primary key (business_id, user_id)
);
Tips
CREATE TABLE "Users_Compliments"
(
    compliment_id         INTEGER
        constraint Users_Compliments_Compliments_compliment_id_fk
            references Compliments,
    user_id               INTEGER
        constraint Users_Compliments_Users_user_id_fk
            references Users,
    number_of_compliments TEXT,
    constraint Users_Compliments_pk
        primary key (compliment_id, user_id)
);
Users_Compliments
CREATE TABLE "Business"
(
    business_id  INTEGER
        constraint Business_pk
            primary key,
    active       TEXT,
    city         TEXT,
    state        TEXT,
    stars        REAL,
    review_count TEXT
);
Business
CREATE TABLE "Users"
(
    user_id                 INTEGER
        constraint Users_pk
            primary key,
    user_yelping_since_year INTEGER,
    user_average_stars      TEXT,
    user_votes_funny        TEXT,
    user_votes_useful       TEXT,
    user_votes_cool         TEXT,
    user_review_count       TEXT,
    user_fans               TEXT
);
Users
original_column_name,column_name,column_description,data_format,value_description
compliment_id,compliment id,,integer,
compliment_type,compliment type,,text,
Compliments
original_column_name,column_name,column_description,data_format,value_description
user_id,user id,id number identifying the users,integer,
year_id,year id,id number identifying the year,integer,
Elite
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,the number identifying the business,integer,
user_id,user id,the number identifying the user who comments on this business,integer,
review_stars,review stars,review on this business,integer,"5 – Great experience 
4 – Good experience 
3 – Average experience 
2 – Bad experience 
1 - Terrible experience"
review_votes_funny,review votes funny,the amount of funny votes that the user received for the review,text,"commonsense evidence: If the reviews receive an “Uber” number of votes for funny, they will also receive an “Uber”, “High” or “Medium” number of votes for “useful” and “cool”."
review_votes_useful,review votes useful,how many useful votes that the user received for the review,text,
review_votes_cool,review votes cool,how many cool votes that the user received for the review,text,
review_length,review length,The length of the review written by the user,text,
Reviews
original_column_name,column_name,column_description,data_format,value_description
attribute_id,attribute id,unique number identifying the attribute,integer,
attribute_name,attribute name,the name of the attribute,text,
Attributes
original_column_name,column_name,column_description,data_format,value_description
user_id,user id,the unique id number identifying which user,integer,
user_yelping_since_year,user yelping since year,the time when the user join Yelp,integer,
user_average_stars,user average stars,the average ratings of all review,real,
user_votes_funny,user votes funny,total number of funny votes sent by the user,text,
user_votes_useful,user votes useful,how many useful votes created by the user,text,
user_votes_cool,user votes cool,how many cool votes created by the user,text,
user_review_count,user review count,total number of reviews the user has written,text,
user_fans,user fans,total number of fans / followers the user has,text,"commonsense evidence: Users with “Uber” number of fans indicate that they have sent an “Uber” number of ‘cool’, ‘useful’ and ‘funny” votes."
Users
original_column_name,column_name,column_description,data_format,value_description
day_id,day id,the unique id identifying the day of the week,integer,
day_of_week,day of week,indicate the day of the week,text,
Days
original_column_name,column_name,column_description,data_format,value_description
business_id,business id, unique number identifying the business,integer,
active,,whether the business is still actively running until now,text,"commonsense reasoning:
� ""True"": the business is still running 
� ""False"": the business is closed or not running now"
city,,The city where the business is located,text,
state,,The state where the business is located,text,
stars,,ratings of the business,real,"5 � Great experience 
4 � Good experience 
3 � Average experience 
2 � Bad experience 
1 - Terrible experience 
commonsense evidence: 
� the rating of >3 stars referring to ""wonderful experience"" or positive comments and vice versa"
review_count,review count,the total number of reviews the users have written for a business,text,"commonsense evidence: 
� If a business has a low total review count and a high star rating of >3, it means there is a low veracity of reviews. 
� higher review count and with high star rating of > 3 means this business is more popular or more appealing to users."
Business
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,id number identifying the business,integer,
day_id,day id,id number identifying each day of the week,integer,
opening_time,opening time,opening time of the business,text,
closing_time,closing time,closing time of the business,text,"commonsense evidence: 
how much time does this business open: closing_time - opening_time"
Business_Hours
original_column_name,column_name,column_description,data_format,value_description
year_id,year id,the unique number identifying the year,integer,
actual_year,actual year,actual year,integer,
Years
original_column_name,column_name,column_description,data_format,value_description
compliment_id,compliment id,the id number indicating the compliment,integer,
user_id,user id,the id number indicating the user,integer,
number_of_compliments,number of compliments,how many compliments a user has received from other users,text,commonsense evidence: more number_of_compliments indicates this user is more welcome or he / she is high-quality user
Users_Compliments
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,id number identifying the business,integer,
category_id,category id,id number identifying the categories,integer,
Business_Categories
original_column_name,column_name,column_description,data_format,value_description
attribute_id,attribute id,id number identifying the attribute,integer,
business_id,business id,id number identifying the business,integer,
attribute_value,attribute value,sort of the attributes for each business,text,"commonsense evidence: 
“None”, “No” or “FALSE” means the business does not have the attribute."
Business_Attributes
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,the number identifying the business,integer,
user_id,user id,the number identifying the user who comments on this business,integer,
likes,Likes,how many likes of this tips,integer,commonsense evidence: more likes mean this tip is more valuable
tip_length,tip length,length of the tip,text,
Tips
original_column_name,column_name,column_description,data_format,value_description
category_id,category id,,integer,
category_name,category name,,text,
Categories
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,id number identifying the business,integer,
day_id,day id,id number identifying each day of the week,integer,
label_time_0,,indicates times of checkins on a business,text,"label_time_0: 12:00 a.m. 
label_time_23: 23:00 p.m. 
commonsense evidence: If the label_time recorded ""None"" for check-in on one day, then it means the business is closed on that day."
label_time_1,,,,
label_time_2,,,,
label_time_3,,,,
label_time_4,,,,
label_time_5,,,,
label_time_6,,,,
label_time_7,,,,
label_time_8,,,,
label_time_9,,,,
label_time_10,,,,
label_time_11,,,,
label_time_12,,,,
label_time_13,,,,
label_time_14,,,,
label_time_15,,,,
label_time_16,,,,
label_time_17,,,,
label_time_18,,,,
label_time_19,,,,
label_time_20,,,,
label_time_21,,,,
label_time_22,,,,
label_time_23,,,,
Checkins