query
stringlengths
24
325
positive
stringlengths
1
580
negative_1
stringlengths
6
580
negative_2
stringlengths
1
576
negative_3
stringlengths
1
576
negative_4
stringlengths
1
580
negative_5
stringlengths
1
580
negative_6
stringlengths
1
580
negative_7
stringlengths
5
576
negative_8
stringlengths
1
576
negative_9
stringlengths
1
580
negative_10
stringlengths
1
580
Find the location of businesses that has business hours from 9 am to 9 pm every Saturday.
9 am refers to opening_time = '9AM'; 9 pm refers to closing_time = '9PM'; every Saturday refers to day_of_week = 'Saturday'; location refers to city
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
posted more than 10 reviews refers to count(Reviews.user_id) > 10
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
cool compliments refers to compliment_type = 'cool'; user number refers to user_id;
review of 4 star and above refers to stars > 4; DIVIDE(SUM(stars > 4), COUNT(business_id)) = 0.65;
5 star reviews refers to review_stars = 5; business No. refers to business_id;
ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
percentage refers to DIVIDE(COUNT(attribute_name = 'Accepts Credit Cards'), COUNT(business_id))*100%
number of running business refers to COUNT(business_id) where active = 'true'; each review count includes review_count = 'High', review_count = 'Medium', review_count = 'Low';
Calculate the percentage of medium tip length in the list. List out the time when users of medium tip length join Yelp.
medium tip length refers to tip_length = 'Medium'; percentage = divide(count(tips where tip_length = 'Medium'), count(tips))*100%; the time when users join Yelp refers to user_yelping_since_year
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
Yelp_Business no.1 refers to business_id = 1; on weekends refers to day_of_week = 'Saturday' or day_of_week = 'Sunday'; average business time refers to DIVIDE(SUBTRACT(closing_time, opening_time), 2)
active businesses in Arizona refer to business_id where state = 'Arizona' and active = 'true'; work after 12PM refer to opening_time > '12PM';
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
located in Phoenix refers to city = 'Phoenix'; Arizona refers to state = 'AZ'
year has the most elite users refers to year_id with MAX(user_id);
business No. refers to business_id; have TV refers to attribute_name = 'Has TV';
12 am refers to opening_time = '12AM'; 1 am refers to closing_time = '1AM'; on Saturday refers to day_of_week = 'Saturday'
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
"Gilbert" is the name of city; highest star rating refers to Max(stars)
What is the correlation between the review starts and business stars?
highest review count refers to review_count = 'Uber'; average business review stars = Divide (Sum(review_stars), Count(user_id))
business which received the most likes refers to business_id where MAX(likes);
high review count refers to review_count = 'High'
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
type of compliments refers to compliment_type; user No. refers to user_id;
under the category "Food" refers to category_name = 'Food'
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
less than 5 low compliment refers to number_of_compliments < 5
category refers to category_name
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
Among the users who have posted more than 10 reviews, how many users are elite users?
posted more than 10 reviews refers to count(Reviews.user_id) > 10
active businesses refers to active = 'true'; underrated refers to review_count = 'Low';
in Tempe refers to city = 'Tempe'; rated as 'Wonderful experience refers to stars > 3
in 2012 refers to actual_year = 2012;
year the user join the Yelp refers to user_yelping_since_year; star reviews refers to review_stars;
elite user for consecutively 5 years or more refers to user_id COUNT(year_id) > 5; Average star = AVG(likes)
active business ID refers to active = 'true'; categories refers to category_name; Glendale is a city; AZ is a state
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time; ratio can be computed as DIVIDE(COUNT(stars BETWEEN 3.5 and 5), COUNT(stars BETWEEN 1 and 2.5));
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
Give the number of users who joined Yelp since "2004".
joined yelp since 2004 refers to user_yelping_since_year = 2004;
AVG(user_yelping_since_year) where user_id from Elite;
the ID refers to business_id; active status refers to active; active = 'true' means the business is still running; active = 'false' means the business is closed or not running now
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
5 in the Elitestar rating refers to stars = 5;
10 am refers to opening_time = '10AM'; 12 pm refers to closing_time = '12PM'; on Sunday refers to day_of_week = 'Sunday'
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
beer_and_wine refers to attribute_value = 'beer_and_wine';
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
DIVIDE(COUNT(business_id where category_name = 'Food' and opening_time = '7AM' and closing_time = '8PM'), COUNT(business_id where opening_time = '7AM' and closing_time = '8PM')) as percentage;
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
How many businesses operating in the shopping business have opening times before 8AM?
shopping business refers to category_name = 'Shopping'; opening time before 8AM refers to opening_time < '8AM';
active businesses refers to active = 'true'; in Tempe refers to city = 'Tempe'; with stars greater than the 70% of average age of star rating refers to stars > DIVIDE(sum(stars), COUNT(business_id)) * 70%
closed at 8PM refers to closing_time = '8PM';
average star less than 3 stars refers to user_average_stars < 3; in 2012 refers to user_yelping_since_year = 2012
Sunday refers to day_of_week = 'Sunday' where day_id = 1; opened from 9AM to 9PM refers to Business_Hours where opening_time = '9AM' and closing_time = '9PM'; DIVIDE(COUNT(opening_time = '9AM' and closing_time = '9PM' and day_of_week = 'Sunday'), COUNT(opening_time = NOT NULL and closing_time = NOT NULL and day_of_week = 'Sunday')) as percentage;
state refers to city
with great experience refers to stars = 5
9 am refers to opening_time = '9AM'; 9 pm refers to closing_time = '9PM'; every Saturday refers to day_of_week = 'Saturday'; location refers to city
active business ID refers to active = 'true'; categories refers to category_name; Glendale is a city; AZ is a state
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
"South Carolina" and "California" are both state; average review stars from users = Divide((Sum(review_stars(state = 'SC')) + Sum(review_stars(state = 'CA'))), Sum(stars))
Among the active businesses located at Mesa, AZ, list the category and attributes of business with a low review count.
active business refers to active = 'true': 'Mesa' is the name of city; 'AZ' is the state; low review count refers to review_count = 'Low'; category refers to category_name
active business refers to active = 'true'; not in Arizona refers to state ! = 'AZ'; category refers to category_name
user no.3 refers to user_id = 3; in Arizona refers to state = 'AZ'; stars on average = avg(review_stars(user_id = 3))
the ID refers to business_id; active status refers to active; active = 'true' means the business is still running; active = 'false' means the business is closed or not running now
"Shopping Centers" is the category_name; high review count refers to review_count = 'High'
joined yelp since 2004 refers to user_yelping_since_year = 2004;
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); average ratings = AVG(review_stars);
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
business number refers to business_id;
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
How many elite users have reviewed Yelp_Business no.1?
Yelp_Business no.1 refers to business_id = 1
businesses are not closed refers to active = 'true'
business No. refers to business_id; have TV refers to attribute_name = 'Has TV';
can be attributed to 'Good for Kids' refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
average review = Divide(Count(user_id), Count(business_id))
"Good for Kids" attribute refers to attribute_name = 'Good for Kids' AND attribute_value = 'true'; Calculation = DIVIDE(SUM(attribute_name = 'Good for Kids' AND attribute_value = 'true')), SUM(business_id) * 100
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
the most common type of compliments refers to MAX(COUNT(compliment_type))
in Chandler refers to city = 'Chandler'; attribute refers to attribute_name
high compliments refers to number_of_compliments = 'High'; type in photo refers to compliment_ID = 1
active business ID refers to active = 'true'; category of Food refers to category_name = 'Food'; attribute of BYOB refers to attribute_name = 'BYOB'; high review count refers to review_count = 'High'
Write the user ID, business ID and tips length of who started using Yelp since 2004 and had high followers.
started using Yelp since 2004 refers to user_yelping_since_year = '2004'; had high followers refers to user_fans = 'High'
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
bars refers to category_name = 'Bars';
active businesses refers to active = 'true'; in Tempe refers to city = 'Tempe'; with stars greater than the 70% of average age of star rating refers to stars > DIVIDE(sum(stars), COUNT(business_id)) * 70%
false
since year 2012 refers to user_yelping_since_year = '2012'
review of 4 star and above refers to stars > 4; DIVIDE(SUM(stars > 4), COUNT(business_id)) = 0.65;
"cool" type compliments refers to compliment_type = 'cool'; user No. 41717 refers to user_id = 41717
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
List at least 5 active business ID that are good for groups and dancing.
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
long tip refers to tip_length = 'Long'; 2 likes refers to likes = 2; high number of fans refers to user_fans = 'High'
user No. refers to user_id;
bars refers to category_name = 'Bars';
with great experience refers to stars = 5
business no. 14033 refers to business_id = 14033; good for supper refers to attribute_name = 'good_for_dinner'
elite user for consecutively 5 years or more refers to user_id COUNT(year_id) > 5; Average star = AVG(likes)
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
opening hours before 7AM refer to opening_time < '7AM'; businesses refer to business_id;
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
high review count refers to review_count = 'High'; received 2 stars refers to stars = 2; category refers to category_name
What is the most common type of compliments that a user has received from other users?
the most common type of compliments refers to MAX(COUNT(compliment_type))
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
shopping business refers to category_name = 'Shopping'; opening time before 8AM refers to opening_time < '8AM';
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
in 2012 refers to actual_year = 2012;
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
Scottsdale refers to city = 'Scottsdale'; positive comments refers to stars > 3; Elitestar rating refers to stars;
in Chandler refers to city = 'Chandler'; attribute refers to attribute_name
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
in Arizona refers to state = 'AZ'; user no. 3 refers to user_id = 3
Between 2006 and 2007, which year ID had the greater number in elite user?
2006 and 2007 refers to BETWEEN 2006 AND 2007; greater number in elite user refers to count(user_id)
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
high compliments refers to number_of_compliments = ' High'; joined Yelp earliest refers to min(user_yelping_since_year)
"Gilbert" is the name of city; highest star rating refers to Max(stars)
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
close after 8PM refers to closing_time = '9PM' or closing_time = '10PM' closing_time = '11PM' closing_time = '12PM'; Mondays refers to day_of_week = 'Monday'
medium tip length refers to tip_length = 'Medium'; percentage = divide(count(tips where tip_length = 'Medium'), count(tips))*100%; the time when users join Yelp refers to user_yelping_since_year
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time; ratio can be computed as DIVIDE(COUNT(stars BETWEEN 3.5 and 5), COUNT(stars BETWEEN 1 and 2.5));
For the user who gave the most number of long reviews, what is his/her averge ratings of all review?
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); average ratings = AVG(review_stars);
business number refers to business_id;
do not provide alcohol refers to attribute_name = 'Alcohol'and attribute_value = 'none'
bars refers to category_name = 'Bars';
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
longest business time refers to max(subtract(closing_time, opening_time)); on Mondays refers to day_of_week = 'Monday';  category "Shopping" refers to category_name = 'Shopping'
high review count refers to review_count = 'High'; received 2 stars refers to stars = 2; category refers to category_name
elite user for consecutively 5 years or more refers to user_id COUNT(year_id) > 5; Average star = AVG(likes)
attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
Scottsdale refers to city = 'Scottsdale'; positive comments refers to stars > 3; Elitestar rating refers to stars;
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
Which closed/not running Yelp business in "Sun City" has got the most reviews? Give the business id.
closed/not running refers to active = 'False'; most reviews refers to MAX(COUNT(user_id));
"Gilbert" is the name of city; high review count refers to review_count = 'High'
category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars))
year with yelp = Subtract ('%Y'(CURRENT TIME), user_yelping_since_year)
rating more than 2 refers to stars > 2;
short tips refers to tip_length = 'short'; most number of short tips refers to MAX(COUNT(tip_length = 'short')); category refers to category_name;
short comment refers to tip_length = 'Short'; users who joined in 2010 refer to user_id where user_yelping_since_year = 2010;
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
in Anthem refers to city = 'Anthem'; the category of "Food" refers to category_name = 'Food'
Yelp user refers to user_id; average 5-star rating refers to user_average_stars = 5; yelping the longest refers to min(user_yelping_since_year)
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
How many Yelp_Businesses are there in Arizona in total?
Arizona refers to state = 'AZ';
in Tempe refers to city = 'Tempe'; rated as 'Wonderful experience refers to stars > 3
medium length tip refers to tip_length = 'Medium';
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
beer_and_wine refers to attribute_value = 'beer_and_wine';
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); category refers to category_name;
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
users refer to user_id; uber votes for all of the review category refer to review_votes_funny = 'uber' AND review_votes_useful = 'uber' AND review_votes_cool = 'uber';
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
In users yelping since 2010 to 2012, how many of them has an low fans?
user yelping since 2010 to 2012 refers to user_yelping_since_year > = '2010' AND user_yelping_since_year < '2013'; low fans refers to user_fans = 'Low'
5 in the Elitestar rating refers to stars = 5;
uber number of fans refers to user_fans = 'uber';
active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
under the category "Food" refers to category_name = 'Food'
ID number refers to attribute_id
users refer to user_id; uber votes for all of the review category refer to review_votes_funny = 'uber' AND review_votes_useful = 'uber' AND review_votes_cool = 'uber';
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
Among the businesses in Scottsdale, list the attribute of the business with a high review count.
"Scottsdale" is the name of city; high review count refers to review_count = 'High'; attribute of the business refers to attribute_name
the most reviews refer to MAX(user_id);
average good review refers to review_count > = 3; Arizona refers to state = 'AZ'; business category refers to category_name
bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 1.0)
business number refers to business_id;
active businesses refers to active = 'true'; Phoenix refers to city = 'Phoenix';
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
the ID refers to business_id; active status refers to active; active = 'true' means the business is still running; active = 'false' means the business is closed or not running now
short reviews refer to tip_length = 'Short';
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
How many category id have low review count and rating more than 2?
rating more than 2 refers to stars > 2;
businesses refer to business_id; review_stars = 5.0; review_votes_funny = 'uber';
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
opening times of 7AM and closing times of 8PM refer to Business_Hours where opening_time = '7AM' and closing_time = '8PM'; active business refers to business_id where active = 'true';
actively running refers to active = 'true';
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
how long was the review refers to review_length; business number refers to business_id; user number refers to user_id;
user No. refers to user_id; short tip refers to tip_length = 'short'; category refers to category_name;
AZ refers to state = 'AZ'; stars < 3;
categories refers to category_name; in Arizona refers to state = 'AZ'
Yelp_Business no.1 refers to business_id = 1; on weekends refers to day_of_week = 'Saturday' or day_of_week = 'Sunday'; average business time refers to DIVIDE(SUBTRACT(closing_time, opening_time), 2)
Which year has the most elite users?
year has the most elite users refers to year_id with MAX(user_id);
less than 5 low compliment refers to number_of_compliments < 5
the most common type of compliments refers to MAX(COUNT(compliment_type))
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); category refers to category_name;
rating refers to stars; inactive refers to active = 'False'; average rating of inactive businesses = DIVIDE(SUM(stars), COUNT(business_id));
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
12 am refers to opening_time = '12AM'; 1 am refers to closing_time = '1AM'; on Saturday refers to day_of_week = 'Saturday'
longest business time refers to max(subtract(closing_time, opening_time)); on Mondays refers to day_of_week = 'Monday';  category "Shopping" refers to category_name = 'Shopping'
active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
Yelp_Business no.1 refers to business_id = 1; on weekends refers to day_of_week = 'Saturday' or day_of_week = 'Sunday'; average business time refers to DIVIDE(SUBTRACT(closing_time, opening_time), 2)
actively running refers to active = 'true';
Which businesses are no longer in business but have a low number of votes useful?
no longer in business refers to active = 'False'; low number of votes useful refers to review_votes_useful = 'Low';
short comment refers to tip_length = 'Short'; users who joined in 2010 refer to user_id where user_yelping_since_year = 2010;
businesses refer to business_id; review_stars = 5.0; review_votes_funny = 'uber';
state refers to city
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
active business refers to active = 'true'; not in Arizona refers to state ! = 'AZ'; category refers to category_name
active businesses refers to active = 'true'; underrated refers to review_count = 'Low';
actively running refers to active = 'TRUE'; Tolleson refers to city = 'Tolleson';
active businesses refers to active = 'true'; in Tempe refers to city = 'Tempe'; with stars greater than the 70% of average age of star rating refers to stars > DIVIDE(sum(stars), COUNT(business_id)) * 70%
highest number of reviews refers to SUBTRACT(MAX(COUNT(business_id), MIN(COUNT(business_id))))
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
In which year did the user who gave the most number of "5" star reviews join the Yelp?
year the user join the Yelp refers to user_yelping_since_year; star reviews refers to review_stars;
most popular and appealing refers to review_count = 'High' and max(stars); active business refers to active = 'true'; in Gilbert refers to city = 'Gilbert'
categories refers to category_name; Yelp_Business no.1 refers to business_id = 1
Arizona refers to state = 'AZ'; still running refers to active = 'true';
days from Monday to Saturday refer to day_id between 2 and 7; work the most days can be computed as MAX(COUNT(category_name where day_id between 2 and 7));
12 am refers to opening_time = '12AM'; 1 am refers to closing_time = '1AM'; on Saturday refers to day_of_week = 'Saturday'
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
users refer to user_id; review_votes_funny = 'uber';
business which received the most likes refers to business_id where MAX(likes);
opening hours refers to opening_time; category refers to category_name;
yearly average review = Divide( Count(business_id), Subtract('%Y'(CURRENT_TIME), user_yelping_since_year))
What is the average rating for the all Yelp businesses that open 24 hours?
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'; rating refers to stars; average rating = AVG(stars);
elite user for consecutively 5 years or more refers to user_id COUNT(year_id) > 5; Average star = AVG(likes)
Yelp_Business no.1 refers to business_id = 1
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
name of business refers to category_name;
automotive businesses refers to category_name = 'Automotive'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Automotive'), COUNT(business_id)), 1.0);
the most reviews refer to MAX(user_id);
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
in Chandler refers to city = 'Chandler'; attribute refers to attribute_name
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
How many "cool" compliments did user number 33 receive?
cool compliments refers to compliment_type = 'cool'; user number refers to user_id;
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
since year 2005 refers to year_id Between 2005 and 2014; increment percentage = Divide(Count(user_id(year_id < 2014)), Count (user_id(year_id = 2015))) * 100
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
active business ID refers to active = 'true'; category of Food refers to category_name = 'Food'; attribute of BYOB refers to attribute_name = 'BYOB'; high review count refers to review_count = 'High'
closed/not running refers to active = 'False'; most reviews refers to MAX(COUNT(user_id));
no longer in business refers to active = 'False'; low number of votes useful refers to review_votes_useful = 'Low';
yearly average review = Divide( Count(business_id), Subtract('%Y'(CURRENT_TIME), user_yelping_since_year))
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
avg(user_id) where user_yelping_since_year BETWEEN '2005' AND '2014';
What is the longest business time on Mondays for a Yelp_Business under the category "Shopping"?
longest business time refers to max(subtract(closing_time, opening_time)); on Mondays refers to day_of_week = 'Monday';  category "Shopping" refers to category_name = 'Shopping'
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
closed business refers to active = 'false'; in Avondale refers to city = 'Avondale'; 'wonderful experience' rating refers to stars > 3; percentage = divide(count(business_id where stars > 3), count(business_id))*100%
can be attributed to 'Good for Kids' refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
DIVIDE(COUNT(business_id where category_name = 'Food' and opening_time = '7AM' and closing_time = '8PM'), COUNT(business_id where opening_time = '7AM' and closing_time = '8PM')) as percentage;
active business refers to active = 'true'; category of Fashion refers to category = 'Fashion'
do not provide alcohol refers to attribute_name = 'Alcohol'and attribute_value = 'none'
in Mesa refers to city = 'Mesa'; alcohol attribute refers to attribute_name = 'Alcohol'
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
long refers to review_length = 'Long';
Arizona refers to state = 'AZ'; Elitestar rating of over 4 refers to stars > 4;
What is the category of the business with medium review length and highest review stars within business ID from 6 t0 9?
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
the most reviews refer to MAX(user_id);
in 2012 refers to actual_year = 2012;
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
long tip refers to tip_length = 'Long'; 2 likes refers to likes = 2; high number of fans refers to user_fans = 'High'
active businesses refers to active = 'true'; AZ is a state; medium review count refers to review_count = 'Medium'
DIVIDE(COUNT(business_id where review_count = 'Low' and active = 'true'), COUNT(business_id where review_count = 'Low' and active = 'false'));
longest business time refers to max(subtract(closing_time, opening_time)); on Mondays refers to day_of_week = 'Monday';  category "Shopping" refers to category_name = 'Shopping'
ID number refers to attribute_id
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
What is the active and inactive ratio of the business with the review count of low.
DIVIDE(COUNT(business_id where review_count = 'Low' and active = 'true'), COUNT(business_id where review_count = 'Low' and active = 'false'));
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
"Shopping Centers" is the category_name; high review count refers to review_count = 'High'
located in Phoenix refers to city = 'Phoenix'; Arizona refers to state = 'AZ'
in Arizona refers to state = 'AZ'; closes at 12PM refers to closing_time = '12PM'; on Sundays refers to day_of_week = 'Sunday'
short reviews refer to tip_length = 'Short';
state refers to city
"South Carolina" and "California" are both state; average review stars from users = Divide((Sum(review_stars(state = 'SC')) + Sum(review_stars(state = 'CA'))), Sum(stars))
user yelping since 2010 to 2012 refers to user_yelping_since_year > = '2010' AND user_yelping_since_year < '2013'; low fans refers to user_fans = 'Low'
name of business refers to category_name;
false
Among the users who received low compliments from other users, which users joined Yelp in 2012?
low compliments refers to number_of_compliments = 'Low'; joined Yelp in 2012 refers to user_yelping_since_year = 2012
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
closed at 8PM refers to closing_time = '8PM';
"Gilbert" is the name of city; highest star rating refers to Max(stars)
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
DIVIDE(COUNT(business_id where review_count = 'Low' and active = 'true'), COUNT(business_id where review_count = 'Low' and active = 'false'));
average review = Divide(Count(user_id), Count(business_id))
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
Please list the business IDs of the Yelp_Business that have a business time of longer than 12 hours on Sundays.
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); category refers to category_name;
medium reviews refers to review_length = 'Medium';
active businesses refers to active = 'true'; in Tempe refers to city = 'Tempe'; with stars greater than the 70% of average age of star rating refers to stars > DIVIDE(sum(stars), COUNT(business_id)) * 70%
medium tip length refers to tip_length = 'Medium'; percentage = divide(count(tips where tip_length = 'Medium'), count(tips))*100%; the time when users join Yelp refers to user_yelping_since_year
10 am refers to opening_time = '10AM'; 12 pm refers to closing_time = '12PM'; on Sunday refers to day_of_week = 'Sunday'
highest number of reviews refers to SUBTRACT(MAX(COUNT(business_id), MIN(COUNT(business_id))))
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
without attribute refers to attribute_value = 'None'; in Gilbert refers to city = 'Gilbert'
Tempe is a city; high review count refers to review_count = 'High'
joined yelp since 2004 refers to user_yelping_since_year = 2004;
What is the attribute value of an inactive business with a medium review count and 3.5 stars which is located at Phoenix, AZ?
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
rating more than 2 refers to stars > 2;
low number of compliments refers to number_of_compliments = 'Low'; percentage refers to DIVIDE(COUNT(number_of_compliments = 'Low'), COUNT(user_id)) * 100
users refer to user_id; review_votes_funny = 'uber';
Sunday refers to day_of_week = 'Sunday' where day_id = 1; category of Arts & Entertainment refers to category_name = 'Arts & Entertainment';
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
Arizona refers to state = 'AZ'; still running refers to active = 'true';
long tip refers to tip_length = 'Long'; 2 likes refers to likes = 2; high number of fans refers to user_fans = 'High'
with great experience refers to stars = 5
are still running refers to active = 'true'; the category of "Food" refers to category_name = 'Food'
high compliments refers to number_of_compliments = 'High'; type in photo refers to compliment_ID = 1
Which users become an elite in 2012?
in 2012 refers to actual_year = 2012;
5-star refers to stars = 5; in Ahwatukee refers to city = 'Ahwatukee'; business category refers to category_name
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
business number refers to business_id; business_id = 2; does not have refers to attribute_value = 'none';
category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars))
medium reviews refers to review_length = 'Medium';
user No. refers to user_id;
DIVIDE(COUNT(business_id where category_name = 'Food' and opening_time = '7AM' and closing_time = '8PM'), COUNT(business_id where opening_time = '7AM' and closing_time = '8PM')) as percentage;
in Anthem refers to city = 'Anthem'; the category of "Food" refers to category_name = 'Food'
in Casa Grande refers to city = 'Casa Grande'
users refer to user_id; uber votes for all of the review category refer to review_votes_funny = 'uber' AND review_votes_useful = 'uber' AND review_votes_cool = 'uber';
How many more "Chinese" than "Filipino" Yelp businesses?
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
category of mexican refers to category_name = 'Mexican'; star rating below 4 refers to stars < 4
business category refers to category_name; most 5 star reviews refers to MAX(COUNT(category_name WHERE star_reviews = 5));
10 am refers to opening_time = '10AM'; 12 pm refers to closing_time = '12PM'; on Sunday refers to day_of_week = 'Sunday'
in Glendale refers to city = 'Glendale'
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
opening hours before 7AM refer to opening_time < '7AM'; businesses refer to business_id;
business no. 14033 refers to business_id = 14033; good for supper refers to attribute_name = 'good_for_dinner'
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); average ratings = AVG(review_stars);
in Anthem refers to city = 'Anthem'; stars on average = avg(review_stars)
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
How many types of music does Yelp business No."1141" have?
types of music refers to attribute_name LIKE '%music%' WHERE attribute_value = 'true'; business No. refers to business_id;
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
in Glendale refers to city = 'Glendale'
user No. refers to user_id;
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 1.0)
highest review count refers to review_count = 'Uber'; average business review stars = Divide (Sum(review_stars), Count(user_id))
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
the most common type of compliments refers to MAX(COUNT(compliment_type))
long refers to review_length = 'Long';
List the category of the business with high review count but received 2 stars.
high review count refers to review_count = 'High'; received 2 stars refers to stars = 2; category refers to category_name
businesses in Arizona refer to business_id where state = 'Arizona'; average review less than 3 stars refers to AVG(review_stars) < 3.0;
posted more than 10 reviews refers to count(Reviews.user_id) > 10
9 am refers to opening_time = '9AM'; 9 pm refers to closing_time = '9PM'; every Saturday refers to day_of_week = 'Saturday'; location refers to city
the most reviews refer to MAX(user_id);
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
in Anthem refers to city = 'Anthem'; the category of "Food" refers to category_name = 'Food'
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
opening hours 10AM on Saturday refer to Business_Hours where opening_time = '10AM' and day_id = 6;
active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
year with yelp = Subtract ('%Y'(CURRENT TIME), user_yelping_since_year)
Give the number of "drive-thru" businesses in "Scottsdale" with business ID number less than "1000".
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
user no.3 refers to user_id = 3; in Arizona refers to state = 'AZ'; stars on average = avg(review_stars(user_id = 3))
category refers to category_name
type of compliments refers to compliment_type; user No. refers to user_id;
best elite refers to user_average_stars = 5; worse eliter refers to user_average_stars = 1: in 2013 refers to year_id = 2013; ratio = Divide(Count(user_id(user_average_stars = 5)),  Count(user_id(user_average_stars = 1)))
"South Carolina" and "California" are both state; average review stars from users = Divide((Sum(review_stars(state = 'SC')) + Sum(review_stars(state = 'CA'))), Sum(stars))
short comment refers to tip_length = 'Short'; users who joined in 2010 refer to user_id where user_yelping_since_year = 2010;
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
types of music refers to attribute_name LIKE '%music%' WHERE attribute_value = 'true'; business No. refers to business_id;
"Good for Kids" attribute refers to attribute_name = 'Good for Kids' AND attribute_value = 'true'; Calculation = DIVIDE(SUM(attribute_name = 'Good for Kids' AND attribute_value = 'true')), SUM(business_id) * 100
average review = Divide(Count(user_id), Count(business_id))
Provide the number of Yelp businesses in "Gilbert" which got a" high" review count.
"Gilbert" is the name of city; high review count refers to review_count = 'High'
short tips refers to tip_length = 'short'; most number of short tips refers to MAX(COUNT(tip_length = 'short')); category refers to category_name;
best elite refers to user_average_stars = 5; worse eliter refers to user_average_stars = 1: in 2013 refers to year_id = 2013; ratio = Divide(Count(user_id(user_average_stars = 5)),  Count(user_id(user_average_stars = 1)))
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
Scottsdale refers to city = 'Scottsdale'; positive comments refers to stars > 3; Elitestar rating refers to stars;
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
How many businesses with music_karaoke attribute are closed?
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
Yelp_Business no.1 refers to business_id = 1
active businesses refers to active = 'true'; Phoenix refers to city = 'Phoenix';
in Anthem refers to city = 'Anthem'; stars on average = avg(review_stars)
active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name
;
ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
opening hours refers to opening_time; category refers to category_name;
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
percentage refers to DIVIDE(COUNT(attribute_name = 'Accepts Credit Cards'), COUNT(business_id))*100%
What is the number of useful votes that the user 52592 received when reviewed for business number 2?
number of useful votes refers to review_votes_useful; business number refers to business_id;
"cool" type compliments refers to compliment_type = 'cool'; user No. 41717 refers to user_id = 41717
average ratings of at least 4 refers to user_average_stars > = 4; no fans or followers refers to user_fans = 'None'; percentage = divide(count(user_id where user_average_stars > = 4 and user_fans = 'None'), sum(user_id where user_average_stars > = 4))*100%
Arizona refers to state = 'AZ';
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'; rating refers to stars; average rating = AVG(stars);
AVG(user_yelping_since_year) where user_fans = 'uber';
high review count refers to review_count = 'High'
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
shopping business refers to category_name = 'Shopping'; opening time before 8AM refers to opening_time < '8AM';
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
user no.3 refers to user_id = 3; in Arizona refers to state = 'AZ'; stars on average = avg(review_stars(user_id = 3))
Please list the categories of the Yelp_Business that closes at 12PM on Sundays.
categories refers to category_name; closes at 12PM refers to closing_time = '12PM'; on Sundays refers to day_of_week = 'Sunday'
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); average ratings = AVG(review_stars);
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
photos type compliment refers to compliment_type = 'photos'; high cool votes refers to review_votes_cool = 'High'
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'
high review count refers to review_count = 'High'; received 2 stars refers to stars = 2; category refers to category_name
in Chandler refers to city = 'Chandler'; attribute refers to attribute_name
active business refers to active = 'true': 'Mesa' is the name of city; 'AZ' is the state; low review count refers to review_count = 'Low'; category refers to category_name
long refers to review_length = 'Long';
Please name one attribute that business number 2 does not have.
business number refers to business_id; business_id = 2; does not have refers to attribute_value = 'none';
rating refers to stars; inactive refers to active = 'False'; average rating of inactive businesses = DIVIDE(SUM(stars), COUNT(business_id));
since year 2005 refers to year_id Between 2005 and 2014; increment percentage = Divide(Count(user_id(year_id < 2014)), Count (user_id(year_id = 2015))) * 100
category of businesses refers to category_name; stars ratings are 5 refers to stars = 5
categories refers to category_name; Yelp_Business no.1 refers to business_id = 1
no longer in business refers to active = 'False'; low number of votes useful refers to review_votes_useful = 'Low';
medium reviews refers to review_length = 'Medium';
Tempe is a city; high review count refers to review_count = 'High'
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
AVG(user_yelping_since_year) where user_fans = 'uber';
business number refers to business_id;
Among all the users with the average ratings of at least 4 and above of all reviews, calculate the percent that have no fans or followers.
average ratings of at least 4 refers to user_average_stars > = 4; no fans or followers refers to user_fans = 'None'; percentage = divide(count(user_id where user_average_stars > = 4 and user_fans = 'None'), sum(user_id where user_average_stars > = 4))*100%
active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); category refers to category_name;
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
in Anthem refers to city = 'Anthem'; stars on average = avg(review_stars)
long tip refers to tip_length = 'Long'; 2 likes refers to likes = 2; high number of fans refers to user_fans = 'High'
attribute name which start with "music" refers to attribute_name LIKE 'music%'
users refer to user_id; review_votes_funny = 'uber';
closed at 8PM refers to closing_time = '8PM';
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
User No. 70271 only has given one tip to the Yelp business, which category was that business belonged to?
user No. refers to user_id; short tip refers to tip_length = 'short'; category refers to category_name;
shopping business refers to category_name = 'Shopping'; opening time before 8AM refers to opening_time < '8AM';
high compliments refers to number_of_compliments = ' High'; joined Yelp earliest refers to min(user_yelping_since_year)
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
;
business number refers to business_id; Scottsdale refers to city = 'Scottsdale'; day number refers to day_id;
long tip refers to tip_length = 'Long'; 2 likes refers to likes = 2; high number of fans refers to user_fans = 'High'
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
beer_and_wine refers to attribute_value = 'beer_and_wine';
in Chandler refers to city = 'Chandler'; attribute refers to attribute_name
How many reviews made by user whose ID is 3 are long?
long refers to review_length = 'Long';
opening hours refers to opening_time; earlier than 8AM refers to opening_time < '8AM';
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
categories refers to category_name; Yelp_Business no.1 refers to business_id = 1
Yelp user refers to user_id; average 5-star rating refers to user_average_stars = 5; yelping the longest refers to min(user_yelping_since_year)
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
users refer to user_id; review_votes_funny = 'uber';
opened during late afternoon refers to Business_Hours where opening_time ≥ '5PM'; active businesses refer to business_id where active = 'true';
active business refers to active = 'true': 'Mesa' is the name of city; 'AZ' is the state; low review count refers to review_count = 'Low'; category refers to category_name
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
How many businesses in Glendale city that are still running is opened from 8AM to 6PM?
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
medium tip length refers to tip_length = 'Medium'; percentage = divide(count(tips where tip_length = 'Medium'), count(tips))*100%; the time when users join Yelp refers to user_yelping_since_year
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
actively running refers to active = 'TRUE'; Tolleson refers to city = 'Tolleson';
located in Phoenix refers to city = 'Phoenix'; Arizona refers to state = 'AZ'
bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 1.0)
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
medium refers to number_of_compliments = 'Medium';
Among the businesses which have short length of review, which one located in Phoenix?
short length of review refers to review_length = 'Short'; in Phoenix refers to city = 'Phoenix'
high compliments refers to number_of_compliments = ' High'; joined Yelp earliest refers to min(user_yelping_since_year)
businesses with long length tips refer to business_id where tip_length = 'Long';
business number refers to business_id;
5 in the Elitestar rating refers to stars = 5;
Yelp_Business no.1 refers to business_id = 1; open on refers to opening_time; Tuesdays refers to day_of_week = 'Tuesday'
beer_and_wine refers to attribute_value = 'beer_and_wine';
yearly average review = Divide( Count(business_id), Subtract('%Y'(CURRENT_TIME), user_yelping_since_year))
actively running refers to active = 'TRUE'; Tolleson refers to city = 'Tolleson';
average good review refers to review_count > = 3; Arizona refers to state = 'AZ'; business category refers to category_name
'Phoenix' is the city; waiter service refers to attribute_name = 'waiter_services'
Calculate the increment percentage of elite user for each year since year 2005.
since year 2005 refers to year_id Between 2005 and 2014; increment percentage = Divide(Count(user_id(year_id < 2014)), Count (user_id(year_id = 2015))) * 100
became an elite user the same year they joined Yelp refers to user_yelping_since_year = year_id
Women's clothing refers to category_name = 'Women''s Clothing'; Men's clothing refers to category_name = 'Men''s Clothing'; percentage more = MULTIPLY(DIVIDE(SUBTRACT(SUM(category_name = 'Women''s Clothing'), SUM(category_name = 'Men''s Clothing')), COUNT(business_id)), 1.0);
categories refers to category_name; closes at 12PM refers to closing_time = '12PM'; on Sundays refers to day_of_week = 'Sunday'
opening hours refers to opening_time; earlier than 8AM refers to opening_time < '8AM';
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
state refers to city
category refers to category_name
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
DIVIDE(COUNT(business_id where review_count = 'Low' and active = 'true'), COUNT(business_id where review_count = 'Low' and active = 'false'));
Among the businesses without attribute, how many businesses located in Gilbert?
without attribute refers to attribute_value = 'None'; in Gilbert refers to city = 'Gilbert'
year has the most elite users refers to year_id with MAX(user_id);
average star less than 3 stars refers to user_average_stars < 3; in 2012 refers to user_yelping_since_year = 2012
Sunday refers to day_of_week = 'Sunday' where day_id = 1; opened from 9AM to 9PM refers to Business_Hours where opening_time = '9AM' and closing_time = '9PM'; DIVIDE(COUNT(opening_time = '9AM' and closing_time = '9PM' and day_of_week = 'Sunday'), COUNT(opening_time = NOT NULL and closing_time = NOT NULL and day_of_week = 'Sunday')) as percentage;
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
the most common type of compliments refers to MAX(COUNT(compliment_type))
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
joined yelp since 2004 refers to user_yelping_since_year = 2004;
business category refers to category_name; most 5 star reviews refers to MAX(COUNT(category_name WHERE star_reviews = 5));
actively running refers to active = 'true';
How many businesses have shopping centers and received high review count?
"Shopping Centers" is the category_name; high review count refers to review_count = 'High'
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
uber number of fans refers to user_fans = 'uber';
low compliments refers to number_of_compliments = 'Low'; joined Yelp in 2012 refers to user_yelping_since_year = 2012
business number refers to business_id; business_id = 2; does not have refers to attribute_value = 'none';
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
businesses in "Pets" category refers to category_name = 'Pets'; percentage refers to DIVIDE(COUNT(category_name = 'Pets'), COUNT(business_id)) * 100%
Sunday refers to day_of_week = 'Sunday' where day_id = 1; opened from 9AM to 9PM refers to Business_Hours where opening_time = '9AM' and closing_time = '9PM'; DIVIDE(COUNT(opening_time = '9AM' and closing_time = '9PM' and day_of_week = 'Sunday'), COUNT(opening_time = NOT NULL and closing_time = NOT NULL and day_of_week = 'Sunday')) as percentage;
active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name
List active business ids with opening times of 7AM and closing times of 8PM.
opening times of 7AM and closing times of 8PM refer to Business_Hours where opening_time = '7AM' and closing_time = '8PM'; active business refers to business_id where active = 'true';
Arizona refers to state = 'AZ';
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
active business ID refers to active = 'true'; category of Food refers to category_name = 'Food'; attribute of BYOB refers to attribute_name = 'BYOB'; high review count refers to review_count = 'High'
state refers to city
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
medium length of review refers to review_length = 'Medium'
Arizona refers to state = 'AZ'; still running refers to active = 'true';
percentage refers to DIVIDE(COUNT(attribute_name = 'Accepts Credit Cards'), COUNT(business_id))*100%
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
How many users became an elite user the same year they joined Yelp?
became an elite user the same year they joined Yelp refers to user_yelping_since_year = year_id
ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
started using Yelp since 2004 refers to user_yelping_since_year = '2004'; had high followers refers to user_fans = 'High'
active business refers to active = 'true'; not in Arizona refers to state ! = 'AZ'; category refers to category_name
rating more than 2 refers to stars > 2;
"Good for Kids" attribute refers to attribute_name = 'Good for Kids' AND attribute_value = 'true'; Calculation = DIVIDE(SUM(attribute_name = 'Good for Kids' AND attribute_value = 'true')), SUM(business_id) * 100
opening hours 10AM on Saturday refer to Business_Hours where opening_time = '10AM' and day_id = 6;
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
active business refers to active = 'true'; Casa Grande refers to city = 'Casa Grande'
category of mexican refers to category_name = 'Mexican'; star rating below 4 refers to stars < 4
in Anthem refers to city = 'Anthem'; stars on average = avg(review_stars)
How many businesses in AZ state have the beer_and_wine attribute?
beer_and_wine refers to attribute_value = 'beer_and_wine';
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
year with yelp = Subtract ('%Y'(CURRENT TIME), user_yelping_since_year)
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
name of business refers to category_name;
Yelp_Business no.1 refers to business_id = 1
active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
more appealing to users refers to MAX(review_count);
is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'
active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name
opened from 8AM to 6PM refers to Business_Hours where opening_time = '8AM' and closing_time = '6PM'; days refer to day_id;
How many businesses are opened for 24 hours?
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
average review = Divide(Count(user_id), Count(business_id))
Arizona refers to state = 'AZ'; Elitestar rating of over 4 refers to stars > 4;
active business refers to active = 'true': 'Mesa' is the name of city; 'AZ' is the state; low review count refers to review_count = 'Low'; category refers to category_name
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
became an elite user the same year they joined Yelp refers to user_yelping_since_year = year_id
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
active business refers to active = 'true'; not in Arizona refers to state ! = 'AZ'; category refers to category_name
opening hours refers to opening_time; category refers to category_name;
For all the Yelp businesses that allow customers bring their own beer, what percentage of them are in "Phoenix"?
bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 1.0)
businesses refer to business_id; review_stars = 5.0; review_votes_funny = 'uber';
opening hours before 7AM refer to opening_time < '7AM'; businesses refer to business_id;
2006 and 2007 refers to BETWEEN 2006 AND 2007; greater number in elite user refers to count(user_id)
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
no longer in business refers to active = 'False'; low number of votes useful refers to review_votes_useful = 'Low';
"cool" type compliments refers to compliment_type = 'cool'; user No. 41717 refers to user_id = 41717
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
false
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
on Sunday refers to day_of_week = 'Sunday'
List the city of the business where they open from 1 pm to 6 pm on Saturday.
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
type of compliments refers to compliment_type; user No. refers to user_id;
"Gilbert" is the name of city; high review count refers to review_count = 'High'
beer_and_wine refers to attribute_value = 'beer_and_wine';
Arizona refers to state = 'AZ'; still running refers to active = 'true';
AVG(user_yelping_since_year) where user_fans = 'uber';
category of mexican refers to category_name = 'Mexican'; star rating below 4 refers to stars < 4
how long was the review refers to review_length; business number refers to business_id; user number refers to user_id;
active business refers to active = 'true'; Casa Grande refers to city = 'Casa Grande'
attribute name which start with "music" refers to attribute_name LIKE 'music%'
AVG(user_yelping_since_year) where user_id from Elite;
How many 5 star businesses have uber review votes for funny?
businesses refer to business_id; review_stars = 5.0; review_votes_funny = 'uber';
businesses are not closed refers to active = 'true'
active business refers to active = 'true'; Casa Grande refers to city = 'Casa Grande'
beer_and_wine refers to attribute_value = 'beer_and_wine';
shopping business refers to category_name = 'Shopping'; opening time before 8AM refers to opening_time < '8AM';
categories refers to category_name; in Arizona refers to state = 'AZ'
the most common type of compliments refers to MAX(COUNT(compliment_type))
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
cool compliments refers to compliment_type = 'cool'; user number refers to user_id;
"Good for Kids" attribute refers to attribute_name = 'Good for Kids' AND attribute_value = 'true'; Calculation = DIVIDE(SUM(attribute_name = 'Good for Kids' AND attribute_value = 'true')), SUM(business_id) * 100
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
What is the ratio of having the best to worse elite user in 2013?
best elite refers to user_average_stars = 5; worse eliter refers to user_average_stars = 1: in 2013 refers to year_id = 2013; ratio = Divide(Count(user_id(user_average_stars = 5)),  Count(user_id(user_average_stars = 1)))
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
businesses with long length tips refer to business_id where tip_length = 'Long';
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
automotive businesses refers to category_name = 'Automotive'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Automotive'), COUNT(business_id)), 1.0);
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
business category refers to category_name; most 5 star reviews refers to MAX(COUNT(category_name WHERE star_reviews = 5));
opening hours refers to opening_time; category refers to category_name;
active business refers to active = 'true'; Casa Grande refers to city = 'Casa Grande'
under the category of "Food" refers to category_name = 'Food'; are good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
located in Phoenix refers to city = 'Phoenix'; Arizona refers to state = 'AZ'
Does Yelp business No."4960" have TV?
business No. refers to business_id; have TV refers to attribute_name = 'Has TV';
joined yelp since 2004 refers to user_yelping_since_year = 2004;
users refer to user_id; uber votes for all of the review category refer to review_votes_funny = 'uber' AND review_votes_useful = 'uber' AND review_votes_cool = 'uber';
percentage refers to DIVIDE(COUNT(attribute_name = 'Accepts Credit Cards'), COUNT(business_id))*100%
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
businesses are not closed refers to active = 'true'
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
in Arizona refers to state = 'AZ'; user no. 3 refers to user_id = 3
"ambience_romantic" attribute refers to attribute_name = 'ambience_romantic' AND attribute_value = 'true'
false
"Gilbert" is the name of city; high review count refers to review_count = 'High'
Identify the operating hours of businesses in Black Canyon City with review count greater than average.
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'
number of useful votes refers to review_votes_useful; business number refers to business_id;
close after 8PM refers to closing_time = '9PM' or closing_time = '10PM' closing_time = '11PM' closing_time = '12PM'; Mondays refers to day_of_week = 'Monday'
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'; rating refers to stars; average rating = AVG(stars);
average star less than 3 stars refers to user_average_stars < 3; in 2012 refers to user_yelping_since_year = 2012
active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
DIVIDE(COUNT(business_id where review_count = 'Low' and active = 'true'), COUNT(business_id where review_count = 'Low' and active = 'false'));
active business refers to active = 'true'; 'Wi-Fi' is the attribute_name; medium review count refers to review_count = 'Medium'
bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 1.0)
List out the state of businesses which have opening time at 1AM.
state refers to city
Sunday refers to day_of_week = 'Sunday' where day_id = 1; category of Arts & Entertainment refers to category_name = 'Arts & Entertainment';
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
"ambience_romantic" attribute refers to attribute_name = 'ambience_romantic' AND attribute_value = 'true'
with great experience refers to stars = 5
active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
"Scottsdale" is the name of city; high review count refers to review_count = 'High'; attribute of the business refers to attribute_name
user no.3 refers to user_id = 3; in Arizona refers to state = 'AZ'; stars on average = avg(review_stars(user_id = 3))
businesses in Arizona refer to business_id where state = 'Arizona'; average review less than 3 stars refers to AVG(review_stars) < 3.0;
How many Yelp_Business under the category of "Food" are good for kids?
under the category of "Food" refers to category_name = 'Food'; are good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
categories refers to category_name
"Gilbert" is the name of city; high review count refers to review_count = 'High'
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
AVG(user_yelping_since_year) where user_fans = 'uber';
business which received the most likes refers to business_id where MAX(likes);
since year 2005 refers to year_id Between 2005 and 2014; increment percentage = Divide(Count(user_id(year_id < 2014)), Count (user_id(year_id = 2015))) * 100
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
active business refers to active = 'true'; 'Pets' is the category_name
Among all attribute names, list down the ID and attribute name which start with "music".
attribute name which start with "music" refers to attribute_name LIKE 'music%'
categories refers to category_name; in Arizona refers to state = 'AZ'
DIVIDE(COUNT(business_id where category_name = 'Food' and opening_time = '7AM' and closing_time = '8PM'), COUNT(business_id where opening_time = '7AM' and closing_time = '8PM')) as percentage;
in Mesa refers to city = 'Mesa'; alcohol attribute refers to attribute_name = 'Alcohol'
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name
category of mexican refers to category_name = 'Mexican'; star rating below 4 refers to stars < 4
average review = Divide(Count(user_id), Count(business_id))
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
automotive businesses refers to category_name = 'Automotive'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Automotive'), COUNT(business_id)), 1.0);
How much time do businesses in El Mirage City, AZ State operate in average daily?
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
AVG(user_yelping_since_year) where user_fans = 'uber';
in Arizona refers to state = 'AZ'; closes at 12PM refers to closing_time = '12PM'; on Sundays refers to day_of_week = 'Sunday'
AZ refers to state = 'AZ'; stars < 3;
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); category refers to category_name;
year with yelp = Subtract ('%Y'(CURRENT TIME), user_yelping_since_year)
opening hours before 7AM refer to opening_time < '7AM'; businesses refer to business_id;
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
average review = Divide(Count(user_id), Count(business_id))
posted more than 10 reviews refers to count(Reviews.user_id) > 10
How many compliments received from medium users that Phoenix city achieved?
medium refers to number_of_compliments = 'Medium';
active businesses refers to active = 'true'; AZ is a state; medium review count refers to review_count = 'Medium'
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
medium reviews refers to review_length = 'Medium';
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
more appealing to users refers to MAX(review_count);
average review = Divide(Count(user_id), Count(business_id))
Tempe is a city; high review count refers to review_count = 'High'
business number refers to business_id; business_id = 2; does not have refers to attribute_value = 'none';
businesses in Arizona refer to business_id where state = 'Arizona'; average review less than 3 stars refers to AVG(review_stars) < 3.0;
How many businesses are not closed in the city of Mesa?
businesses are not closed refers to active = 'true'
the most reviews refer to MAX(user_id);
state refers to city
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
AVG(user_yelping_since_year) where user_id from Elite;
business number refers to business_id; business_id = 2; does not have refers to attribute_value = 'none';
closed business refers to active = 'false'; in Avondale refers to city = 'Avondale'; 'wonderful experience' rating refers to stars > 3; percentage = divide(count(business_id where stars > 3), count(business_id))*100%
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
ID of businesses refers to business_id; reviews with the lowest veracity refers to review_count = 'Low' AND stars > 3; Paradise Valley is a city
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
How many users who have received a low cool vote have also received at least 1 low cool vote for some of their reviews?
low cool vote for user refers to user_votes_cool = 'Low';  low cool vote for review refers to review_votes_cool = 'Low'
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
short reviews refer to tip_length = 'Short';
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
under the category "Food" refers to category_name = 'Food'
Women's clothing refers to category_name = 'Women''s Clothing'; Men's clothing refers to category_name = 'Men''s Clothing'; percentage more = MULTIPLY(DIVIDE(SUBTRACT(SUM(category_name = 'Women''s Clothing'), SUM(category_name = 'Men''s Clothing')), COUNT(business_id)), 1.0);
low compliments refers to number_of_compliments = 'Low'; joined Yelp in 2012 refers to user_yelping_since_year = 2012
categories refers to category_name
users refer to user_id; uber votes for all of the review category refer to review_votes_funny = 'uber' AND review_votes_useful = 'uber' AND review_votes_cool = 'uber';
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
bars refers to category_name = 'Bars';
Find the 5-star business in Ahwatukee, AZ and identify it's business category.
5-star refers to stars = 5; in Ahwatukee refers to city = 'Ahwatukee'; business category refers to category_name
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
most popular and appealing refers to review_count = 'High' and max(stars); active business refers to active = 'true'; in Gilbert refers to city = 'Gilbert'
good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
active businesses refers to active = 'true'; Phoenix refers to city = 'Phoenix';
active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name
active businesses refers to active = 'true'; in Tempe refers to city = 'Tempe'; with stars greater than the 70% of average age of star rating refers to stars > DIVIDE(sum(stars), COUNT(business_id)) * 70%
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
with great experience refers to stars = 5
opening hours 10AM on Saturday refer to Business_Hours where opening_time = '10AM' and day_id = 6;
Under which categories is Yelp_Business no. 1?
categories refers to category_name; Yelp_Business no.1 refers to business_id = 1
number of running business refers to COUNT(business_id) where active = 'true'; each review count includes review_count = 'High', review_count = 'Medium', review_count = 'Low';
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time; ratio can be computed as DIVIDE(COUNT(stars BETWEEN 3.5 and 5), COUNT(stars BETWEEN 1 and 2.5));
became an elite user the same year they joined Yelp refers to user_yelping_since_year = year_id
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
closed/not running refers to active = 'False'; most reviews refers to MAX(COUNT(user_id));
closed business refers to active = 'false'; in Avondale refers to city = 'Avondale'; 'wonderful experience' rating refers to stars > 3; percentage = divide(count(business_id where stars > 3), count(business_id))*100%
type of compliments refers to compliment_type; user No. refers to user_id;
opening hours before 7AM refer to opening_time < '7AM'; businesses refer to business_id;
review of 4 star and above refers to stars > 4; DIVIDE(SUM(stars > 4), COUNT(business_id)) = 0.65;
types of music refers to attribute_name LIKE '%music%' WHERE attribute_value = 'true'; business No. refers to business_id;
What is the percentage of businesses with "Good for Kids" attribute over the other attributes?
"Good for Kids" attribute refers to attribute_name = 'Good for Kids' AND attribute_value = 'true'; Calculation = DIVIDE(SUM(attribute_name = 'Good for Kids' AND attribute_value = 'true')), SUM(business_id) * 100
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
short tip refers to tip_length = 'Short'; business category refers to category_name
category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars))
under the category "Food" refers to category_name = 'Food'
active business refers to active = 'true'; Casa Grande refers to city = 'Casa Grande'
"Scottsdale" is the name of city; high review count refers to review_count = 'High'; attribute of the business refers to attribute_name
do not provide alcohol refers to attribute_name = 'Alcohol'and attribute_value = 'none'
12 am refers to opening_time = '12AM'; 1 am refers to closing_time = '1AM'; on Saturday refers to day_of_week = 'Saturday'
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
Among the active businesses in Arizona, how many businesses work after 12PM?
active businesses in Arizona refer to business_id where state = 'Arizona' and active = 'true'; work after 12PM refer to opening_time > '12PM';
photos type compliment refers to compliment_type = 'photos'; high cool votes refers to review_votes_cool = 'High'
;
percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix' END), COUNT(category_id)), 1.0);
without attribute refers to attribute_value = 'None'; in Gilbert refers to city = 'Gilbert'
5 star reviews refers to review_stars = 5; business No. refers to business_id;
ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
active businesses refers to active = 'true'; AZ is a state; medium review count refers to review_count = 'Medium'
opening times of 7AM and closing times of 8PM refer to Business_Hours where opening_time = '7AM' and closing_time = '8PM'; active business refers to business_id where active = 'true';
categories refers to category_name; in Arizona refers to state = 'AZ'
under the category of "Food" refers to category_name = 'Food'; are good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
What are the attribute numbers that are related to payment?
attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
businesses are not closed refers to active = 'true'
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
;
user No. refers to user_id;
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); category refers to category_name;
percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix' END), COUNT(category_id)), 1.0);
businesses with long length tips refer to business_id where tip_length = 'Long';
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
active business refers to active = 'true'; 'Wi-Fi' is the attribute_name; medium review count refers to review_count = 'Medium'
Please list the business IDs of all the Yelp_Businesses that are good for kids.
good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
actively running refers to active = 'TRUE'; Tolleson refers to city = 'Tolleson';
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
in Tempe refers to city = 'Tempe'; rated as 'Wonderful experience refers to stars > 3
businesses with long length tips refer to business_id where tip_length = 'Long';
ID number refers to attribute_id
active businesses in Arizona refer to business_id where state = 'Arizona' and active = 'true'; work after 12PM refer to opening_time > '12PM';
5 star reviews refers to review_stars = 5; business No. refers to business_id;
Sunday refers to day_of_week = 'Sunday' where day_id = 1; category of Arts & Entertainment refers to category_name = 'Arts & Entertainment';
categories refers to category_name; Yelp_Business no.1 refers to business_id = 1
average review = Divide(Count(user_id), Count(business_id))
How many active businesses are there in Phoenix?
active businesses refers to active = 'true'; Phoenix refers to city = 'Phoenix';
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
rating refers to stars; inactive refers to active = 'False'; average rating of inactive businesses = DIVIDE(SUM(stars), COUNT(business_id));
"Gilbert" is the name of city; high review count refers to review_count = 'High'
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
Tempe is a city; high review count refers to review_count = 'High'
long refers to review_length = 'Long';
opened during late afternoon refers to Business_Hours where opening_time ≥ '5PM'; active businesses refer to business_id where active = 'true';
in Chandler refers to city = 'Chandler'; attribute refers to attribute_name
Give the percentage of "Automotive" businesses among all the Yelp businesses.
automotive businesses refers to category_name = 'Automotive'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Automotive'), COUNT(business_id)), 1.0);
2006 and 2007 refers to BETWEEN 2006 AND 2007; greater number in elite user refers to count(user_id)
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
medium length of review refers to review_length = 'Medium'
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
rating refers to stars; inactive refers to active = 'False'; average rating of inactive businesses = DIVIDE(SUM(stars), COUNT(business_id));
10 am refers to opening_time = '10AM'; 12 pm refers to closing_time = '12PM'; on Sunday refers to day_of_week = 'Sunday'
user no.3 refers to user_id = 3; in Arizona refers to state = 'AZ'; stars on average = avg(review_stars(user_id = 3))
Women's clothing refers to category_name = 'Women''s Clothing'; Men's clothing refers to category_name = 'Men''s Clothing'; percentage more = MULTIPLY(DIVIDE(SUBTRACT(SUM(category_name = 'Women''s Clothing'), SUM(category_name = 'Men''s Clothing')), COUNT(business_id)), 1.0);
active business refers to active = 'true'; not in Arizona refers to state ! = 'AZ'; category refers to category_name
9 am refers to opening_time = '9AM'; 9 pm refers to closing_time = '9PM'; every Saturday refers to day_of_week = 'Saturday'; location refers to city
Provide the businesses name in Tempe city whose opening hours are earlier than 8AM.
opening hours refers to opening_time; earlier than 8AM refers to opening_time < '8AM';
average review = Divide(Count(user_id), Count(business_id))
started using Yelp since 2004 refers to user_yelping_since_year = '2004'; had high followers refers to user_fans = 'High'
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
Arizona refers to state = 'AZ'; Elitestar rating of over 4 refers to stars > 4;
medium tip length refers to tip_length = 'Medium'; percentage = divide(count(tips where tip_length = 'Medium'), count(tips))*100%; the time when users join Yelp refers to user_yelping_since_year
Yelp_Business no.1 refers to business_id = 1
since year 2012 refers to user_yelping_since_year = '2012'
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
state refers to city
low number of compliments refers to number_of_compliments = 'Low'; percentage refers to DIVIDE(COUNT(number_of_compliments = 'Low'), COUNT(user_id)) * 100
How many Yelp_Business close after 8PM on Mondays?
close after 8PM refers to closing_time = '9PM' or closing_time = '10PM' closing_time = '11PM' closing_time = '12PM'; Mondays refers to day_of_week = 'Monday'
low compliments refers to number_of_compliments = 'Low'; joined Yelp in 2012 refers to user_yelping_since_year = 2012
active businesses in Arizona refer to business_id where state = 'Arizona' and active = 'true'; work after 12PM refer to opening_time > '12PM';
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
user No. refers to user_id; short tip refers to tip_length = 'short'; category refers to category_name;
medium length of review refers to review_length = 'Medium'
in Mesa refers to city = 'Mesa'; alcohol attribute refers to attribute_name = 'Alcohol'
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
users refer to user_id; review_votes_funny = 'uber';
bars refers to category_name = 'Bars';
Among the Yelp_Businesses in Arizona, how many of them are still running?
Arizona refers to state = 'AZ'; still running refers to active = 'true';
"Shopping Centers" is the category_name; high review count refers to review_count = 'High'
ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix' END), COUNT(category_id)), 1.0);
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
state refers to city
Arizona refers to state = 'AZ';
bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 1.0)
automotive businesses refers to category_name = 'Automotive'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Automotive'), COUNT(business_id)), 1.0);
Among the businesses with a category of Food, what is the percentage of the business with greater than 3 stars?
category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars))
business that accept insurance refers to attribute_name = 'Accepts Insurance' AND attribute_value = 'true'
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
5 in the Elitestar rating refers to stars = 5;
Yelp user refers to user_id; average 5-star rating refers to user_average_stars = 5; yelping the longest refers to min(user_yelping_since_year)
AZ refers to state = 'AZ'; stars < 3;
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
less than 5 low compliment refers to number_of_compliments < 5
highest review count refers to review_count = 'Uber'; average business review stars = Divide (Sum(review_stars), Count(user_id))
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
business category refers to category_name; most 5 star reviews refers to MAX(COUNT(category_name WHERE star_reviews = 5));
Among the users whose fan is medium, how many users received high compliments from other users.
is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'
opening hours 10AM on Saturday refer to Business_Hours where opening_time = '10AM' and day_id = 6;
opening times of 7AM and closing times of 8PM refer to Business_Hours where opening_time = '7AM' and closing_time = '8PM'; active business refers to business_id where active = 'true';
active business ID refers to active = 'true'; categories refers to category_name; Glendale is a city; AZ is a state
running business refers to business where active = 'true';
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
ID number refers to attribute_id
long refers to review_length = 'Long';
photos type compliment refers to compliment_type = 'photos'; high cool votes refers to review_votes_cool = 'High'
types of music refers to attribute_name LIKE '%music%' WHERE attribute_value = 'true'; business No. refers to business_id;
What is the opening time of the active businesses in Chandler that has a medium review count.
active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
categories refers to category_name; closes at 12PM refers to closing_time = '12PM'; on Sundays refers to day_of_week = 'Sunday'
actively running business refers to active = 'true'; 'Gilbert' is the name of city; most review refers to review_count = 'Uber'
the most reviews refer to MAX(user_id);
active business ID refers to active = 'true'; categories refers to category_name; Glendale is a city; AZ is a state
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'; rating refers to stars; average rating = AVG(stars);
DIVIDE(COUNT(business_id where category_name = 'Food' and opening_time = '7AM' and closing_time = '8PM'), COUNT(business_id where opening_time = '7AM' and closing_time = '8PM')) as percentage;
high compliments refers to number_of_compliments = ' High'; joined Yelp earliest refers to min(user_yelping_since_year)
closed at 8PM refers to closing_time = '8PM';
long reviews refers to review_length = 'Long'; medium number of useful votes refers to review_votes_useful = 'medium';
high compliments refers to number_of_compliments = 'High'; type in photo refers to compliment_ID = 1
Based on business in Phoenix, calculate the percentage of business with low funny votes.
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
5-star refers to stars = 5; in Ahwatukee refers to city = 'Ahwatukee'; business category refers to category_name
attribute name which start with "music" refers to attribute_name LIKE 'music%'
review of 4 star and above refers to stars > 4; DIVIDE(SUM(stars > 4), COUNT(business_id)) = 0.65;
short length of review refers to review_length = 'Short'; in Phoenix refers to city = 'Phoenix'
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time; ratio can be computed as DIVIDE(COUNT(stars BETWEEN 3.5 and 5), COUNT(stars BETWEEN 1 and 2.5));
long refers to review_length = 'Long';
Yelp user refers to user_id; average 5-star rating refers to user_average_stars = 5; yelping the longest refers to min(user_yelping_since_year)
"Tempe" is the name of city; long review refers to review_length = 'Long'
in Arizona refers to state = 'AZ'; user no. 3 refers to user_id = 3
businesses are not closed refers to active = 'true'
Provide the list of user ID along with review star of which has the review length of medium with business ID of 35.
;
elite user for consecutively 5 years or more refers to user_id COUNT(year_id) > 5; Average star = AVG(likes)
number of useful votes refers to review_votes_useful; business number refers to business_id;
high review count refers to review_count = 'High'
Yelp_Business no.1 refers to business_id = 1; open on refers to opening_time; Tuesdays refers to day_of_week = 'Tuesday'
Arizona refers to state = 'AZ'; still running refers to active = 'true';
Tempe is a city; high review count refers to review_count = 'High'
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
user No. refers to user_id; short tip refers to tip_length = 'short'; category refers to category_name;
short tip refers to tip_length = 'Short'; business category refers to category_name
since year 2005 refers to year_id Between 2005 and 2014; increment percentage = Divide(Count(user_id(year_id < 2014)), Count (user_id(year_id = 2015))) * 100
How many businesses in Phoenix, Arizona is attributed to waiter service?
'Phoenix' is the city; waiter service refers to attribute_name = 'waiter_services'
user no.3 refers to user_id = 3; in Arizona refers to state = 'AZ'; stars on average = avg(review_stars(user_id = 3))
category refers to category_name
attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
active businesses refers to active = 'true'; Phoenix refers to city = 'Phoenix';
are still running refers to active = 'true'; the category of "Food" refers to category_name = 'Food'
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
attribute_value = 'beer_and_wine'
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
name of business refers to category_name;
List by ID the businesses with the reviews with the lowest veracity of Paradise Valley.
ID of businesses refers to business_id; reviews with the lowest veracity refers to review_count = 'Low' AND stars > 3; Paradise Valley is a city
category refers to category_name
5 star reviews refers to review_stars = 5; business No. refers to business_id;
"Good for Kids" attribute refers to attribute_name = 'Good for Kids' AND attribute_value = 'true'; Calculation = DIVIDE(SUM(attribute_name = 'Good for Kids' AND attribute_value = 'true')), SUM(business_id) * 100
cool compliments refers to compliment_type = 'cool'; user number refers to user_id;
"South Carolina" and "California" are both state; average review stars from users = Divide((Sum(review_stars(state = 'SC')) + Sum(review_stars(state = 'CA'))), Sum(stars))
;
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
Sunday refers to day_of_week = 'Sunday' where day_id = 1; category of Arts & Entertainment refers to category_name = 'Arts & Entertainment';
"Tempe" is the name of city; long review refers to review_length = 'Long'
highest number of reviews refers to SUBTRACT(MAX(COUNT(business_id), MIN(COUNT(business_id))))
How many businesses that are registered in the database can be attributed to 'Good for Kids'?
can be attributed to 'Good for Kids' refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
active businesses refers to active = 'true'; in Tempe refers to city = 'Tempe'; with stars greater than the 70% of average age of star rating refers to stars > DIVIDE(sum(stars), COUNT(business_id)) * 70%
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
"Good for Kids" attribute refers to attribute_name = 'Good for Kids' AND attribute_value = 'true'; Calculation = DIVIDE(SUM(attribute_name = 'Good for Kids' AND attribute_value = 'true')), SUM(business_id) * 100
most popular and appealing refers to review_count = 'High' and max(stars); active business refers to active = 'true'; in Gilbert refers to city = 'Gilbert'
active business refers to active = 'true': 'Mesa' is the name of city; 'AZ' is the state; low review count refers to review_count = 'Low'; category refers to category_name
"Good for Groups" and "Good for Dancing" are attribute_name; active business refers to active = true'
'Phoenix' is the city; waiter service refers to attribute_name = 'waiter_services'
high compliments refers to number_of_compliments = ' High'; joined Yelp earliest refers to min(user_yelping_since_year)
category refers to category_name; highest review stars refers to max(review_stars); business ID from 6 to 9 refers to business_id between 6 and 9
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
Please indicate the closing hours and business days of the businesses with the category named Doctors.
closing hours refer to closing_time; business days refer to day_id from Business_Hours;
category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars))
active business refers to active = 'true'; category of Fashion refers to category = 'Fashion'
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time; ratio can be computed as DIVIDE(COUNT(stars BETWEEN 3.5 and 5), COUNT(stars BETWEEN 1 and 2.5));
more appealing to users refers to MAX(review_count);
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
short comment refers to tip_length = 'Short'; users who joined in 2010 refer to user_id where user_yelping_since_year = 2010;
categories refers to category_name; in Arizona refers to state = 'AZ'
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
most popular and appealing refers to review_count = 'High' and max(stars); active business refers to active = 'true'; in Gilbert refers to city = 'Gilbert'
Women's clothing refers to category_name = 'Women''s Clothing'; Men's clothing refers to category_name = 'Men''s Clothing'; percentage more = MULTIPLY(DIVIDE(SUBTRACT(SUM(category_name = 'Women''s Clothing'), SUM(category_name = 'Men''s Clothing')), COUNT(business_id)), 1.0);
What are the opening and closing time of business id 1 for day id 2?
false
no longer in business refers to active = 'False'; low number of votes useful refers to review_votes_useful = 'Low';
in Arizona refers to state = 'AZ'; user no. 3 refers to user_id = 3
average review = Divide(Count(user_id), Count(business_id))
active business ID refers to active = 'true'; categories refers to category_name; Glendale is a city; AZ is a state
do not provide alcohol refers to attribute_name = 'Alcohol'and attribute_value = 'none'
how long was the review refers to review_length; business number refers to business_id; user number refers to user_id;
'Phoenix' is the city; waiter service refers to attribute_name = 'waiter_services'
category of businesses refers to category_name; stars ratings are 5 refers to stars = 5
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
2006 and 2007 refers to BETWEEN 2006 AND 2007; greater number in elite user refers to count(user_id)
List the closing time and day of week of active businesses in Tempe with stars greater than the 70% of average age of star rating.
active businesses refers to active = 'true'; in Tempe refers to city = 'Tempe'; with stars greater than the 70% of average age of star rating refers to stars > DIVIDE(sum(stars), COUNT(business_id)) * 70%
more appealing to users refers to MAX(review_count);
businesses with long length tips refer to business_id where tip_length = 'Long';
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
most popular and appealing refers to review_count = 'High' and max(stars); active business refers to active = 'true'; in Gilbert refers to city = 'Gilbert'
close after 8PM refers to closing_time = '9PM' or closing_time = '10PM' closing_time = '11PM' closing_time = '12PM'; Mondays refers to day_of_week = 'Monday'
bars refers to category_name = 'Bars';
photos type compliment refers to compliment_type = 'photos'; high cool votes refers to review_votes_cool = 'High'
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
5-star refers to stars = 5; in Ahwatukee refers to city = 'Ahwatukee'; business category refers to category_name
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
State the number of actively running Yelp businesses in "Tolleson".
actively running refers to active = 'TRUE'; Tolleson refers to city = 'Tolleson';
"cool" type compliments refers to compliment_type = 'cool'; user No. 41717 refers to user_id = 41717
business number refers to business_id;
business category refers to category_name; most 5 star reviews refers to MAX(COUNT(category_name WHERE star_reviews = 5));
businesses with long length tips refer to business_id where tip_length = 'Long';
year has the most elite users refers to year_id with MAX(user_id);
how long was the review refers to review_length; business number refers to business_id; user number refers to user_id;
in Chandler refers to city = 'Chandler'; attribute refers to attribute_name
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time;
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'; rating refers to stars; average rating = AVG(stars);
state refers to city
What is the closing and opening time of businesses located at Gilbert with highest star rating?
"Gilbert" is the name of city; highest star rating refers to Max(stars)
started using Yelp since 2004 refers to user_yelping_since_year = '2004'; had high followers refers to user_fans = 'High'
"Local Services" is the category_name; less than 3 stars refers to stars < 3; percentage = Divide(Count(business_id(stars < 3)), Count(business_id)) * 100
9 am refers to opening_time = '9AM'; 9 pm refers to closing_time = '9PM'; every Saturday refers to day_of_week = 'Saturday'; location refers to city
;
in 2012 refers to actual_year = 2012;
avg(user_id) where user_yelping_since_year BETWEEN '2005' AND '2014';
opened during late afternoon refers to Business_Hours where opening_time ≥ '5PM'; active businesses refer to business_id where active = 'true';
joined yelp since 2004 refers to user_yelping_since_year = 2004;
high compliments refers to number_of_compliments = ' High'; joined Yelp earliest refers to min(user_yelping_since_year)
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
For businesses with long length reviews, which state are they located?
businesses with long length tips refer to business_id where tip_length = 'Long';
opening hours refers to opening_time; category refers to category_name;
DIVIDE(COUNT(business_id where category_name = 'Food' and opening_time = '7AM' and closing_time = '8PM'), COUNT(business_id where opening_time = '7AM' and closing_time = '8PM')) as percentage;
under the category of "Food" refers to category_name = 'Food'; are good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'; rating refers to stars; average rating = AVG(stars);
2006 and 2007 refers to BETWEEN 2006 AND 2007; greater number in elite user refers to count(user_id)
short reviews refer to tip_length = 'Short';
longest business time refers to max(subtract(closing_time, opening_time)); on Mondays refers to day_of_week = 'Monday';  category "Shopping" refers to category_name = 'Shopping'
List the user ID, business ID with review length of the business which received the most likes in tips.
business which received the most likes refers to business_id where MAX(likes);
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
in Glendale refers to city = 'Glendale'
businesses with long length tips refer to business_id where tip_length = 'Long';
good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
how much time does this business open refers to SUBTRACT(closing_time, opening_time); DIVIDE(SUM(SUBTRACT(closing_time, opening_time)), SUM(Business.business_id))
closed/not running refers to active = 'False'; most reviews refers to MAX(COUNT(user_id));
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
business that accept insurance refers to attribute_name = 'Accepts Insurance' AND attribute_value = 'true'
businesses refer to business_id; review_stars = 5.0; review_votes_funny = 'uber';
became an elite user the same year they joined Yelp refers to user_yelping_since_year = year_id
For the only Yelp business in "Yuma" city, how many "medium" reviews did it get?
medium reviews refers to review_length = 'Medium';
Arizona refers to state = 'AZ'; Elitestar rating of over 4 refers to stars > 4;
shopping business refers to category_name = 'Shopping'; opening time before 8AM refers to opening_time < '8AM';
Yelp_Business no.1 refers to business_id = 1
opening hours refers to opening_time; earlier than 8AM refers to opening_time < '8AM';
active businesses refers to active = 'true'; underrated refers to review_count = 'Low';
"Gilbert" is the name of city; high review count refers to review_count = 'High'
user No. refers to user_id;
short length of review refers to review_length = 'Short'; in Phoenix refers to city = 'Phoenix'
high review count refers to review_count = 'High'; received 2 stars refers to stars = 2; category refers to category_name
in Casa Grande refers to city = 'Casa Grande'
What is the ratio between business in shopping category and business in pets category?
ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
less than 5 low compliment refers to number_of_compliments < 5
music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
in Arizona refers to state = 'AZ'; user no. 3 refers to user_id = 3
AZ refers to state = 'AZ'; stars < 3;
"Scottsdale" is the name of city; high review count refers to review_count = 'High'; attribute of the business refers to attribute_name
opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'
automotive businesses refers to category_name = 'Automotive'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Automotive'), COUNT(business_id)), 1.0);
categories refers to category_name; closes at 12PM refers to closing_time = '12PM'; on Sundays refers to day_of_week = 'Sunday'
active business refers to active = 'true'; 'Wi-Fi' is the attribute_name; medium review count refers to review_count = 'Medium'
actively running refers to active = 'true';
What is the closing time of business id 4 on Sunday?
on Sunday refers to day_of_week = 'Sunday'
running business refers to business where active = 'true';
low number of compliments refers to number_of_compliments = 'Low'; percentage refers to DIVIDE(COUNT(number_of_compliments = 'Low'), COUNT(user_id)) * 100
is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'
most popular and appealing refers to review_count = 'High' and max(stars); active business refers to active = 'true'; in Gilbert refers to city = 'Gilbert'
the most common type of compliments refers to MAX(COUNT(compliment_type))
categories refers to category_name
opening hours before 7AM refer to opening_time < '7AM'; businesses refer to business_id;
under the category "Food" refers to category_name = 'Food'
joined yelp since 2004 refers to user_yelping_since_year = 2004;
AVG(user_yelping_since_year) where user_id from Elite;
Count the active businesses that has an attribute of BYOB with high review count.
active business ID refers to active = 'true'; category of Food refers to category_name = 'Food'; attribute of BYOB refers to attribute_name = 'BYOB'; high review count refers to review_count = 'High'
operating hours refers to opening_time closing_time on day_id; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count > AVG(T1.review_count)
opened for 24/7 refers to Business_Hours WHERE opening_time = closing_time and business_id COUNT(day_id) = 7; business attribute refers to attribute_name
categories refers to category_name; in Arizona refers to state = 'AZ'
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
inactive business refers to active = 'FALSE'; 'AZ' is the state; 'Phoenix' is the name of city; medium review count refers to review_count = 'Medium'; 3.5 stars refers to stars = 3.5
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
closed at 8PM refers to closing_time = '8PM';
active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
highest review count refers to review_count = 'Uber'; average business review stars = Divide (Sum(review_stars), Count(user_id))
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
How many photos type compliment given from users with high cool votes?
photos type compliment refers to compliment_type = 'photos'; high cool votes refers to review_votes_cool = 'High'
ID number refers to attribute_id
businesses refer to business_id; review_stars = 5.0; review_votes_funny = 'uber';
user No. refers to user_id;
"Gilbert" is the name of city; high review count refers to review_count = 'High'
user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time; ratio can be computed as DIVIDE(COUNT(stars BETWEEN 3.5 and 5), COUNT(stars BETWEEN 1 and 2.5));
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
how long was the review refers to review_length; business number refers to business_id; user number refers to user_id;
business number refers to business_id;
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
How many businesses have the category named food? List those businesses and find the percentage of businesses with less than 2 stars.
businesses have the category named food refer to business_id where category_name = 'Food'; DIVIDE(COUNT(business_id where category_name = 'Food' and stars < 2), COUNT(business_id where category_name = 'Food')) as percentage;
year the user join the Yelp refers to user_yelping_since_year; star reviews refers to review_stars;
location of businesses refers to city and state; business hours from 8 am to 9 pm refers to opening_time = '8AM', closing_time = '9PM'; every Friday refers to day_of_week = 'Friday'
'Phoenix' is the city; waiter service refers to attribute_name = 'waiter_services'
in Glendale refers to city = 'Glendale'
medium refers to number_of_compliments = 'Medium';
under the category of "Food" refers to category_name = 'Food'; are good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
high review count refers to review_count = 'High'; received 2 stars refers to stars = 2; category refers to category_name
ID refers to business_id; category of "Diagnostic Imaging" refers to category_name = 'Diagnostic Imaging';
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
business category refers to category_name; most 5 star reviews refers to MAX(COUNT(category_name WHERE star_reviews = 5));
How many Yelp_Businesses do not provide alcohol?
do not provide alcohol refers to attribute_name = 'Alcohol'and attribute_value = 'none'
do not have fans refers to user_fans = 'None'; high number of compliment refers to number_of_compliments = 'High'
good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
business No. refers to business_id; have TV refers to attribute_name = 'Has TV';
ID number refers to attribute_id
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
short length of review refers to review_length = 'Short'; in Phoenix refers to city = 'Phoenix'
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
opening hours 10AM on Saturday refer to Business_Hours where opening_time = '10AM' and day_id = 6;
high review count refers to review_count = 'High'; received 2 stars refers to stars = 2; category refers to category_name
Based on all user compliments, find the percentage of low number of compliments on all compliments ID.
low number of compliments refers to number_of_compliments = 'Low'; percentage refers to DIVIDE(COUNT(number_of_compliments = 'Low'), COUNT(user_id)) * 100
opening hours before 7AM refer to opening_time < '7AM'; businesses refer to business_id;
;
closed business refers to active = 'false'; in Avondale refers to city = 'Avondale'; 'wonderful experience' rating refers to stars > 3; percentage = divide(count(business_id where stars > 3), count(business_id))*100%
in Anthem refers to city = 'Anthem'; the category of "Food" refers to category_name = 'Food'
good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix' END), COUNT(category_id)), 1.0);
active businesses refers to active = 'true'; in Chandler refers to city = 'Chandler'
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
beer_and_wine refers to attribute_value = 'beer_and_wine';
How many likes did short comment left by users who joined in 2010 get?
short comment refers to tip_length = 'Short'; users who joined in 2010 refer to user_id where user_yelping_since_year = 2010;
Women's clothing refers to category_name = 'Women''s Clothing'; Men's clothing refers to category_name = 'Men''s Clothing'; percentage more = MULTIPLY(DIVIDE(SUBTRACT(SUM(category_name = 'Women''s Clothing'), SUM(category_name = 'Men''s Clothing')), COUNT(business_id)), 1.0);
year the user join the Yelp refers to user_yelping_since_year; star reviews refers to review_stars;
active business refers to active = 'true';  'Scottsdale' is the name of city; stars greater than the 60% of average age of star rating refers to stars  > avg(stars) * 60%
category of food refers to category_name = 'Food'; calculation = DIVIDE(COUNT(stars > 3), SUM(stars))
located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
categories refers to category_name; Yelp_Business no.1 refers to business_id = 1
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
Sunday refers to day_of_week = 'Sunday' where day_id = 1; opened from 9AM to 9PM refers to Business_Hours where opening_time = '9AM' and closing_time = '9PM'; DIVIDE(COUNT(opening_time = '9AM' and closing_time = '9PM' and day_of_week = 'Sunday'), COUNT(opening_time = NOT NULL and closing_time = NOT NULL and day_of_week = 'Sunday')) as percentage;
5 in the Elitestar rating refers to stars = 5;
ID of businesses refers to business_id; reviews with the lowest veracity refers to review_count = 'Low' AND stars > 3; Paradise Valley is a city
How many users received high compliment type in photo?
high compliments refers to number_of_compliments = 'High'; type in photo refers to compliment_ID = 1
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
low number of compliments refers to number_of_compliments = 'Low'; percentage refers to DIVIDE(COUNT(number_of_compliments = 'Low'), COUNT(user_id)) * 100
1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
Sunday refers to day_of_week = 'Sunday' where day_id = 1; category of Arts & Entertainment refers to category_name = 'Arts & Entertainment';
Arizona refers to state = 'AZ'; Elitestar rating of over 4 refers to stars > 4;
;
open businesses refers to active = 'true'; long review refers to review_length = 'Long'
Sunday refers to day_of_week = 'Sunday' where day_id = 1; opened from 9AM to 9PM refers to Business_Hours where opening_time = '9AM' and closing_time = '9PM'; DIVIDE(COUNT(opening_time = '9AM' and closing_time = '9PM' and day_of_week = 'Sunday'), COUNT(opening_time = NOT NULL and closing_time = NOT NULL and day_of_week = 'Sunday')) as percentage;
users with a high number of fans refers to user_fans = 'High'; 2011 refers to actual_year = 2011; Calculation = DIVIDE(Elite.user_id where user_fans = 'High' AND actual_year = 2011, Elite.user_id where actual_year = 2011) * 100
year the user join the Yelp refers to user_yelping_since_year; star reviews refers to review_stars;