db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
public_review_platform
select t1.business_id from business as t1 inner join business_attributes as t2 on t1.business_id = t2.business_id inner join attributes as t3 on t2.attribute_id = t3.attribute_id where t1.city = 'mesa' and t3.attribute_name = 'alcohol'
Question: list the business located in mesa that have alcohol attribute. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, busines...
list the business located in mesa that have alcohol attribute.
public_review_platform
select cast(sum(case when t2.review_votes_funny = 'low' then 1 else 0 end) as real) * 100 / count(t1.business_id) from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.city = 'phoenix'
Question: based on business in phoenix, calculate the percentage of business with low funny votes. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attribute...
based on business in phoenix, calculate the percentage of business with low funny votes.
public_review_platform
select cast(sum(case when t2.category_name = 'shopping' then 1 else 0 end) as real) / sum(case when t2.category_name = 'pets' then 1 else 0 end) as radio from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id
Question: what is the ratio between business in shopping category and business in pets category? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes ...
what is the ratio between business in shopping category and business in pets category?
public_review_platform
select count(t2.business_id) from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id where t1.category_name = 'banks & credit unions'
Question: how many businesses are registered in the database under 'banks & credit unions' category? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attribu...
how many businesses are registered in the database under 'banks & credit unions' category?
public_review_platform
select count(business_id) from business where active = 'true' and city = 'casa grande'
Question: how many active businesses from casa grande are registered in the database? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribut...
how many active businesses from casa grande are registered in the database?
public_review_platform
select t1.opening_time from business_hours as t1 inner join days as t2 on t1.day_id = t2.day_id where t1.business_id = 12 and t2.day_of_week = 'monday'
Question: what time does the business with id no.12 open on monday? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id,...
what time does the business with id no.12 open on monday?
public_review_platform
select count(t2.business_id) from attributes as t1 inner join business_attributes as t2 on t1.attribute_id = t2.attribute_id where t1.attribute_name = 'good for kids' and t2.attribute_value = 'true'
Question: how many businesses that are registered in the database can be attributed to 'good for kids'? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attr...
how many businesses that are registered in the database can be attributed to 'good for kids'?
public_review_platform
select business_id from business where city = 'gilbert' and active = 'true' and review_count = 'high' order by stars desc limit 1
Question: identify the most popular and appealing active business in gilbert based on users' reviews. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attrib...
identify the most popular and appealing active business in gilbert based on users' reviews.
public_review_platform
select t1.business_id, t3.category_name from business as t1 inner join business_categories as t2 on t1.business_id = t2.business_id inner join categories as t3 on t2.category_id = t3.category_id where t1.city = 'ahwatukee' and t1.stars = 5
Question: find the 5-star business in ahwatukee, az and identify it's business category. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attri...
find the 5-star business in ahwatukee, az and identify it's business category.
public_review_platform
select cast(sum(case when stars > 3 then 1 else 0 end) as real) * 100 / count(stars) from business where city = 'avondale' and active = 'false'
Question: among all closed businesses in avondale, az what percent have obtained a 'wonderful experience' rating of the business. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, ...
among all closed businesses in avondale, az what percent have obtained a 'wonderful experience' rating of the business.
public_review_platform
select distinct t2.user_id from users as t1 inner join elite as t2 on t1.user_id = t2.user_id where t1.user_yelping_since_year = 2004
Question: identify the user who has been yelping since 2004. is he or she an yelp elite member? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -...
identify the user who has been yelping since 2004. is he or she an yelp elite member?
public_review_platform
select cast(sum(case when review_length = 'long' then 1 else 0 end) as real) * 100 / count(review_length) from reviews where review_stars = 5
Question: identify the percent of long reviews among all 5-star reviews given to businesses by the yelp users. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Busine...
identify the percent of long reviews among all 5-star reviews given to businesses by the yelp users.
public_review_platform
select cast(sum(case when user_fans = 'none' then 1 else 0 end) as real) * 100 / count(user_id) from users where user_average_stars >= 4
Question: 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. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week....
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.
public_review_platform
select count(business_id) from tips where business_id = 2 and tip_length = 'short'
Question: how many short tips were left for the business with id no.2? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_...
how many short tips were left for the business with id no.2?
public_review_platform
select user_id from users where user_average_stars = 5 order by user_yelping_since_year asc limit 1
Question: find the yelp user with the average 5-star rating of all reviews who has been yelping the longest. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business...
find the yelp user with the average 5-star rating of all reviews who has been yelping the longest.
public_review_platform
select t2.opening_time, t2.closing_time from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id inner join days as t3 on t2.day_id = t3.day_id where t1.city = 'black canyon city' group by t2.business_id having t1.review_count > avg(t1.review_count)
Question: identify the operating hours of businesses in black canyon city with review count greater than average. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Bus...
identify the operating hours of businesses in black canyon city with review count greater than average.
public_review_platform
select cast(sum(case when t1.compliment_type = 'cute' then 1 else 0 end) as real) * 100 / count(t2.user_id) from compliments as t1 inner join users_compliments as t2 on t1.compliment_id = t2.compliment_id where t2.number_of_compliments = 'high'
Question: among all the users who received the high number of compliments, what percent received the 'cute' type of compliment. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, ac...
among all the users who received the high number of compliments, what percent received the 'cute' type of compliment.
public_review_platform
select count(business_id) from business_attributes where attribute_value in ('none', 'no', 'false')
Question: mention the number of businesses that have no any attribute. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_...
mention the number of businesses that have no any attribute.
public_review_platform
select opening_time, closing_time from business_hours where business_id = 1 and day_id = 2
Question: what are the opening and closing time of business id 1 for day id 2? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, b...
what are the opening and closing time of business id 1 for day id 2?
public_review_platform
select distinct t1.city from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t2.review_length = 'medium'
Question: list out city name of businesses which have medium length of review. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, b...
list out city name of businesses which have medium length of review.
public_review_platform
select t2.closing_time from days as t1 inner join business_hours as t2 on t1.day_id = t2.day_id where t1.day_of_week = 'sunday' and t2.business_id = 4
Question: what is the closing time of business id 4 on sunday? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, attr...
what is the closing time of business id 4 on sunday?
public_review_platform
select distinct t1.business_id from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.city = 'phoenix' and t2.review_length = 'short'
Question: among the businesses which have short length of review, which one located in phoenix? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -...
among the businesses which have short length of review, which one located in phoenix?
public_review_platform
select count(t1.user_id) from users as t1 inner join users_compliments as t2 on t1.user_id = t2.user_id where t2.number_of_compliments = 'high' and t1.user_fans = 'medium'
Question: among the users whose fan is medium, how many users received high compliments from other users. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_At...
among the users whose fan is medium, how many users received high compliments from other users.
public_review_platform
select distinct t2.user_id from users as t1 inner join users_compliments as t2 on t1.user_id = t2.user_id where t1.user_yelping_since_year = 2012 and t2.number_of_compliments = 'low'
Question: among the users who received low compliments from other users, which users joined yelp in 2012? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_At...
among the users who received low compliments from other users, which users joined yelp in 2012?
public_review_platform
select count(t2.business_id) from business_attributes as t1 inner join business as t2 on t1.business_id = t2.business_id where t2.city = 'gilbert' and t1.attribute_value in ('none', 'no', 'false')
Question: among the businesses without attribute, how many businesses located in gilbert? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attr...
among the businesses without attribute, how many businesses located in gilbert?
public_review_platform
select count(t1.business_id) from business_attributes as t1 inner join business as t2 on t1.business_id = t2.business_id where t1.attribute_value = 'full_bar'
Question: among the businesses with average rating, how many business has attribute of full_bar. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes ...
among the businesses with average rating, how many business has attribute of full_bar.
public_review_platform
select distinct t1.state from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id where t2.opening_time = '1am'
Question: list out the state of businesses which have opening time at 1am. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, busin...
list out the state of businesses which have opening time at 1am.
public_review_platform
select t1.category_name from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id where t2.business_id = 5
Question: list out the category name of business id 5. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, attribute_va...
list out the category name of business id 5.
public_review_platform
select t2.user_id from compliments as t1 inner join users_compliments as t2 on t1.compliment_id = t2.compliment_id where t1.compliment_type = 'photos'
Question: list out the user id that has compliment type of photos. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, ...
list out the user id that has compliment type of photos.
public_review_platform
select cast(sum(case when t1.tip_length = 'medium' then 1 else 0 end) as real) * 100 / count(t1.tip_length), t2.user_yelping_since_year from tips as t1 inner join users as t2 on t1.user_id = t2.user_id
Question: calculate the percentage of medium tip length in the list. list out the time when users of medium tip length join yelp. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, ...
calculate the percentage of medium tip length in the list. list out the time when users of medium tip length join yelp.
public_review_platform
select cast(count(t1.city) as real) * 100 / ( select count(business_id) from business ), t2.attribute_value from business as t1 inner join business_attributes as t2 on t1.business_id = t2.business_id where t1.city = 'mesa'
Question: calculate the percentage of businesses who located in mesa. what is attribute value of these businesses. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Bu...
calculate the percentage of businesses who located in mesa. what is attribute value of these businesses.
public_review_platform
select distinct t1.state from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id where t2.closing_time = '12am'
Question: state the state of businesses which have closing time at 12am. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, busines...
state the state of businesses which have closing time at 12am.
public_review_platform
select count(t1.business_id) from business_attributes as t1 inner join business as t2 on t1.business_id = t2.business_id where t2.city = 'peoria' and t1.attribute_value = 'beer_and_wine'
Question: among the businesses which have attribute of beer_and_wine, how many business located in peoria? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_A...
among the businesses which have attribute of beer_and_wine, how many business located in peoria?
public_review_platform
select t2.user_id from users as t1 inner join users_compliments as t2 on t1.user_id = t2.user_id where t2.number_of_compliments = 'high' and t1.user_yelping_since_year = ( select min(user_yelping_since_year) from users )
Question: among the users who received high compliments from other users, which users joined yelp earliest? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_...
among the users who received high compliments from other users, which users joined yelp earliest?
public_review_platform
select business_id from reviews group by business_id order by count(user_id) desc limit 1
Question: which business id has the most reviews? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, attribute_value. ...
which business id has the most reviews?
public_review_platform
select year_id from elite group by year_id order by count(user_id) desc limit 1
Question: which year has the most elite users? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, attribute_value. Bus...
which year has the most elite users?
public_review_platform
select count(business_id) from reviews where review_stars = 5 and review_votes_funny = 'uber'
Question: how many 5 star businesses have uber review votes for funny? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_...
how many 5 star businesses have uber review votes for funny?
public_review_platform
select count(distinct user_id) from reviews where review_votes_funny = 'uber'
Question: how many users have uber review votes for funny from the fans? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, busines...
how many users have uber review votes for funny from the fans?
public_review_platform
select business_id from business_hours order by closing_time - opening_time limit 1
Question: which business id have the shortest business operating hours? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business...
which business id have the shortest business operating hours?
public_review_platform
select distinct business_id from business_hours where day_id >= 1 and day_id < 8 and opening_time = closing_time
Question: find out which business id are opened all the time. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, attri...
find out which business id are opened all the time.
public_review_platform
select t3.tip_length, sum(t3.likes) as likes from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id inner join tips as t3 on t2.business_id = t3.business_id where t1.category_name = 'hotels & travel' group by t3.tip_length
Question: does the length of the tip influence the number of likes for hotel and travel business category? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_A...
does the length of the tip influence the number of likes for hotel and travel business category?
public_review_platform
select count(t2.user_id) as user_ids, t2.user_average_stars from reviews as t1 inner join users as t2 on t1.user_id = t2.user_id where t1.review_votes_funny = 'uber' and t1.review_votes_useful = 'uber' and t1.review_votes_cool = 'uber'
Question: how many users manage to get uber votes for all of the review category? find out what are the user average star. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_...
how many users manage to get uber votes for all of the review category? find out what are the user average star.
public_review_platform
select cast(sum(case when t1.stars between 3.5 and 5 then 1 else 0 end) as real) / sum(case when t1.stars between 1 and 2.5 then 1 else 0 end) as ratio from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id
Question: what is the ratio of good to bad business star for a businesses that are opened all the time? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attr...
what is the ratio of good to bad business star for a businesses that are opened all the time?
public_review_platform
select t2.business_id, t3.category_name from reviews as t1 inner join business_categories as t2 on t1.business_id = t2.business_id inner join categories as t3 on t2.category_id = t3.category_id group by t2.business_id order by count(t1.user_id) desc limit 10
Question: list out 10 business id that are being reviewed the most by users and list out what are top 3 business categories. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actua...
list out 10 business id that are being reviewed the most by users and list out what are top 3 business categories.
public_review_platform
select count(business_id) from business where business_id in ( select distinct t1.business_id from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.state = 'az' group by t1.business_id having sum(t2.review_stars) / count(t2.user_id) < 3 )
Question: how many businesses in arizona having an average review less than 3 stars? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute...
how many businesses in arizona having an average review less than 3 stars?
public_review_platform
select cast((( select count(user_id) from users ) - ( select count(distinct user_id) from elite )) as real) * 100 / ( select count(user_id) from users )
Question: what is the percentage of user not becoming an elite user? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id...
what is the percentage of user not becoming an elite user?
public_review_platform
select distinct t3.compliment_type from users as t1 inner join users_compliments as t2 on t1.user_id = t2.user_id inner join compliments as t3 on t2.compliment_id = t3.compliment_id where t1.user_fans = 'uber'
Question: what are the most common compliments types received by user with uber number of fans? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -...
what are the most common compliments types received by user with uber number of fans?
public_review_platform
select cast(sum(t2.year_id - t1.user_yelping_since_year) as real) / count(t1.user_id) from users as t1 inner join elite as t2 on t1.user_id = t2.user_id where t1.user_fans = 'uber'
Question: what is the average year needed by a user with uber fans to become an elite user? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> at...
what is the average year needed by a user with uber fans to become an elite user?
public_review_platform
select cast(sum(t2.year_id - t1.user_yelping_since_year) as real) / count(t1.user_id) from users as t1 inner join elite as t2 on t1.user_id = t2.user_id
Question: what is the average year for a user to be upgraded to elite user? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, busi...
what is the average year for a user to be upgraded to elite user?
public_review_platform
select cast(sum(case when t1.active = 'true' then 1 else 0 end) as real) * 100 / count(t1.business_id) as act from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id where t1.city = 'mesa'
Question: how many business are opened for more than 8 hour in mesa and what is the percentage of the active businesses? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_ye...
how many business are opened for more than 8 hour in mesa and what is the percentage of the active businesses?
public_review_platform
select distinct t4.category_name from business_hours as t1 inner join business as t2 on t1.business_id = t2.business_id inner join business_categories as t3 on t2.business_id = t3.business_id inner join categories as t4 on t3.category_id = t4.category_id where t2.active = 'true' and t2.city = 'phoenix' and t1.opening_t...
Question: how many active businesses are opened during late afternoon in the phoenix city? list out the top 3 categories name for these businesses. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. ...
how many active businesses are opened during late afternoon in the phoenix city? list out the top 3 categories name for these businesses.
public_review_platform
select t3.user_id from attributes as t1 inner join business_attributes as t2 on t1.attribute_id = t2.attribute_id inner join reviews as t3 on t2.business_id = t3.business_id where t1.attribute_name = 'delivery' group by t3.user_id order by count(t2.business_id) desc limit 1
Question: which user has done the most review on a business attributed to delivery? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_...
which user has done the most review on a business attributed to delivery?
public_review_platform
select avg(t3.user_id) from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id inner join reviews as t3 on t1.business_id = t3.business_id where t1.active = 'true' group by t2.closing_time - t2.opening_time having sum(t2.closing_time - t2.opening_time) < 30
Question: what is the average number of reviews written for active businesses that operate not more than 30 hours a week? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_y...
what is the average number of reviews written for active businesses that operate not more than 30 hours a week?
public_review_platform
select distinct business_id from business_hours where opening_time = '8am' and closing_time = '6pm'
Question: how many business ids have opening hours from 8am to 6pm? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id,...
how many business ids have opening hours from 8am to 6pm?
public_review_platform
select distinct business_id from business_hours where day_id = 6 and opening_time = '10am'
Question: provide business ids with opening hours 10am on saturday. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id,...
provide business ids with opening hours 10am on saturday.
public_review_platform
select distinct day_id from business_hours where opening_time = '8am' and closing_time = '6pm'
Question: indicate the business id and days which are opened from 8am to 6pm. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, bu...
indicate the business id and days which are opened from 8am to 6pm.
public_review_platform
select count(business_id) from business where stars > 4
Question: how many businesses id are rated more than 4? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, attribute_v...
how many businesses id are rated more than 4?
public_review_platform
select distinct t1.category_name from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id inner join business_hours as t3 on t2.business_id = t3.business_id inner join days as t4 on t3.day_id = t4.day_id where t4.day_of_week = 'sunday' and t3.opening_time <> ''
Question: what are the categories of businesses that have opening time on sunday? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id...
what are the categories of businesses that have opening time on sunday?
public_review_platform
select distinct t4.day_of_week from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id inner join business_hours as t3 on t1.business_id = t3.business_id inner join days as t4 on t3.day_id = t4.day_id where t2.category_name = 'pets'
Question: please indicate the opening day of businesses whose category is pets. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, ...
please indicate the opening day of businesses whose category is pets.
public_review_platform
select distinct t3.opening_time, t3.day_id from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id inner join business_hours as t3 on t1.business_id = t3.business_id inner join days as t4 on t3.day_id = t4.day_id where t2.category_name = 'doctors'
Question: please indicate the closing hours and business days of the businesses with the category named doctors. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Busi...
please indicate the closing hours and business days of the businesses with the category named doctors.
public_review_platform
select t2.category_name from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id inner join business_hours as t3 on t1.business_id = t3.business_id inner join days as t4 on t3.day_id = t4.day_id group by t2.category_name order by count(t3.day_id) desc limit 1
Question: among the working days from monday to saturday, which businesses with the category names work the most days? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year...
among the working days from monday to saturday, which businesses with the category names work the most days?
public_review_platform
select t1.business_id, t3.closing_time from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id inner join business_hours as t3 on t1.business_id = t3.business_id inner join days as t4 on t3.day_id = t4.day_id where t2.category_name = 'arts & entertainment' and t4.day_of_week = 'sun...
Question: please indicate the business id have the closing time with the category of arts & entertainment on sunday. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. ...
please indicate the business id have the closing time with the category of arts & entertainment on sunday.
public_review_platform
select count(t1.business_id) from business as t1 inner join business_categories as t2 on t1.business_id = t2.business_id inner join categories as t3 on t2.category_id = t3.category_id where t3.category_name = 'djs' and t1.stars < 5
Question: in businesses with a category of 'djs', how many businesses are rated less than 5? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> a...
in businesses with a category of 'djs', how many businesses are rated less than 5?
public_review_platform
select distinct t4.business_id from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id inner join business_hours as t3 on t2.business_id = t3.business_id inner join business as t4 on t3.business_id = t4.business_id where t4.active = 'true' and t3.opening_time = '7am' and t3.closing...
Question: list active business ids with opening times of 7am and closing times of 8pm. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribu...
list active business ids with opening times of 7am and closing times of 8pm.
public_review_platform
select count(t1.business_id) from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id inner join business as t3 on t1.business_id = t3.business_id where t2.category_name = 'stadiums & arenas' and t3.stars = ( select max(stars) from business )
Question: how many businesses with the category named stadiums & arenas are rated highest? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> att...
how many businesses with the category named stadiums & arenas are rated highest?
public_review_platform
select count(distinct t1.category_id) from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id inner join business as t3 on t2.business_id = t3.business_id where t3.review_count = 'low' and t3.stars > 2
Question: how many category id have low review count and rating more than 2? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, bus...
how many category id have low review count and rating more than 2?
public_review_platform
select t1.business_id from business_hours as t1 inner join business_categories as t2 on t1.business_id = t2.business_id inner join categories as t3 on t2.category_id = t3.category_id where t3.category_name = 'accessories' and substr(t1.opening_time, -4, 2) * 1 < 7 and t1.opening_time like '%am'
Question: which businesses with the category name accessories have opening hours before 7am? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> a...
which businesses with the category name accessories have opening hours before 7am?
public_review_platform
select count(distinct t2.business_id) from business_hours as t1 inner join business as t2 on t1.business_id = t2.business_id inner join business_categories as t3 on t2.business_id = t3.business_id inner join categories as t4 on t3.category_id = t4.category_id where t2.active = 'true' and t2.state = 'az' and t1.opening_...
Question: among the active businesses in arizona, how many businesses work after 12pm? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribu...
among the active businesses in arizona, how many businesses work after 12pm?
public_review_platform
select t1.category_name from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id inner join tips as t3 on t2.business_id = t3.business_id where t3.user_id = 16328
Question: please provide the name of businesses with user id '16328'. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_i...
please provide the name of businesses with user id '16328'.
public_review_platform
select t3.business_id, cast((( select count(business_id) from business where stars < 2 ) - ( select count(business_id) from business where stars > 2 )) as real) * 100 / ( select count(stars) from business ) from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id inner join business...
Question: how many businesses have the category named food? list those businesses and find the percentage of businesses with less than 2 stars. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Year...
how many businesses have the category named food? list those businesses and find the percentage of businesses with less than 2 stars.
public_review_platform
select cast(sum(case when t3.category_name = 'food' then 1 else 0 end) as real) * 100 / count(t3.category_name) from business_categories as t1 inner join business as t2 on t1.business_id = t2.business_id inner join categories as t3 on t1.category_id = t3.category_id
Question: calculate the percentage of businesses with the category name food that are open from 7am to 8pm in the businesses with the same time. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Yea...
calculate the percentage of businesses with the category name food that are open from 7am to 8pm in the businesses with the same time.
public_review_platform
select sum(case when review_count = 'high' then 1 else 0 end) as high , sum(case when review_count = 'medium' then 1 else 0 end) as medium , sum(case when review_count = 'low' then 1 else 0 end) as low from business where city = 'cave creek' and active = 'true'
Question: write down the number of running business with each review count in cave creek city. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes ->...
write down the number of running business with each review count in cave creek city.
public_review_platform
select avg(user_id) from users where user_yelping_since_year >= 2005 and user_yelping_since_year <= 2015
Question: calculate the yearly average user who started using yelp from the year of 2005 to 2014. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes...
calculate the yearly average user who started using yelp from the year of 2005 to 2014.
public_review_platform
select cast(sum(case when active = 'true' then 1 else 0 end) as real) / sum(case when active = 'false' then 1 else 0 end) as radio from business where review_count = 'low'
Question: what is the active and inactive ratio of the business with the review count of low. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> ...
what is the active and inactive ratio of the business with the review count of low.
public_review_platform
select user_id from elite where year_id = 2006 limit 5
Question: list any five of user id who became elite user in 2006. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id, a...
list any five of user id who became elite user in 2006.
public_review_platform
select category_id, category_name from categories where category_name like 'p%' limit 5
Question: write down the any five of id and name of category that starts with alphabet 'p'. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> at...
write down the any five of id and name of category that starts with alphabet 'p'.
public_review_platform
select user_id, review_stars from reviews where business_id = 15 and review_length = 'medium'
Question: provide the list of user id along with review star of which has the review length of medium with business id of 35. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actu...
provide the list of user id along with review star of which has the review length of medium with business id of 35.
public_review_platform
select t2.business_id, t2.attribute_value from attributes as t1 inner join business_attributes as t2 on t1.attribute_id = t2.attribute_id where t1.attribute_name = 'payment_types_visa'
Question: list down the business id and attribute value of the attribute name of 'payment_types_visa'. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attri...
list down the business id and attribute value of the attribute name of 'payment_types_visa'.
public_review_platform
select t2.business_id, t3.active from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id inner join business as t3 on t2.business_id = t3.business_id where t1.category_name = 'diagnostic imaging'
Question: describe id and active status of the business under category of 'diagnostic imaging'. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -...
describe id and active status of the business under category of 'diagnostic imaging'.
public_review_platform
select t2.user_id, t2.user_yelping_since_year from reviews as t1 inner join users as t2 on t1.user_id = t2.user_id where t1.business_id = 143 and t1.review_stars = 5
Question: mention the user id and their year of joining yelp who had great experience on business id 143. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_At...
mention the user id and their year of joining yelp who had great experience on business id 143.
public_review_platform
select t3.user_id, t3.user_yelping_since_year from compliments as t1 inner join users_compliments as t2 on t1.compliment_id = t2.compliment_id inner join users as t3 on t2.user_id = t3.user_id where t1.compliment_type = 'profile' and t2.number_of_compliments = 'uber' limit 5
Question: among the user id with number in compliment of uber on profile, list any 5 user id and the year when they join yelp. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, act...
among the user id with number in compliment of uber on profile, list any 5 user id and the year when they join yelp.
public_review_platform
select t1.user_id, t1.business_id, t2.review_length from tips as t1 inner join reviews as t2 on t1.business_id = t2.business_id order by t1.likes desc limit 1
Question: list the user id, business id with review length of the business which received the most likes in tips. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Bus...
list the user id, business id with review length of the business which received the most likes in tips.
public_review_platform
select t2.user_id, t2.number_of_compliments from compliments as t1 inner join users_compliments as t2 on t1.compliment_id = t2.compliment_id inner join elite as t3 on t2.user_id = t3.user_id where t3.year_id between 2005 and 2014 and t1.compliment_type = 'photos'
Question: among the elite users of 10 consecutive year from 2005 to 2014, list down the user id and their number of compliment on photos. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> y...
among the elite users of 10 consecutive year from 2005 to 2014, list down the user id and their number of compliment on photos.
public_review_platform
select cast(sum(case when t2.opening_time = '9am' and t2.closing_time = '9pm' then 1 else 0 end) as real) * 100 / count(t1.day_id) from days as t1 inner join business_hours as t2 on t1.day_id = t2.day_id where t1.day_of_week = 'sunday'
Question: calculate the percentage of business which opened on sunday from 9am to 9pm based on the number of business opened on sunday. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> yea...
calculate the percentage of business which opened on sunday from 9am to 9pm based on the number of business opened on sunday.
public_review_platform
select t2.business_id, t3.day_of_week from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id inner join days as t3 on t2.day_id = t3.day_id where t1.city = 'black canyon city' and t1.active = 'true'
Question: write down the id and opening day of a week for the business which are running in black canyon city. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Busine...
write down the id and opening day of a week for the business which are running in black canyon city.
public_review_platform
select t2.user_id, t2.review_length from users as t1 inner join reviews as t2 on t1.user_id = t2.user_id where t1.user_yelping_since_year = 2004 and t1.user_average_stars = 5
Question: within the user who joined yelp in 2004, explore the user id with average star of 5 and it's review length on the business. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_...
within the user who joined yelp in 2004, explore the user id with average star of 5 and it's review length on the business.
public_review_platform
select distinct t2.business_id, t2.city from reviews as t1 inner join business as t2 on t1.business_id = t2.business_id where t1.review_stars >= 4 and ( select cast(( select count(distinct t1.user_id) from reviews as t1 inner join business as t2 on t1.business_id = t2.business_id where t1.review_stars >= 4 ) as real) *...
Question: which business id received the review of 4 star and above by 65% of user? describe their active status and city. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_...
which business id received the review of 4 star and above by 65% of user? describe their active status and city.
public_review_platform
select sum(case when city = 'glendale' then 1 else 0 end) - sum(case when city = 'mesa' then 1 else 0 end) as diff from business where active = 'true'
Question: calculate the difference between running business in glendale city and mesa city. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> at...
calculate the difference between running business in glendale city and mesa city.
public_review_platform
select sum(t2.likes) from users as t1 inner join tips as t2 on t1.user_id = t2.user_id where t1.user_yelping_since_year = 2010
Question: how many likes did short comment left by users who joined in 2010 get? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id,...
how many likes did short comment left by users who joined in 2010 get?
public_review_platform
select t2.tip_length from users as t1 inner join tips as t2 on t1.user_id = t2.user_id where t1.user_average_stars = 3 group by t2.tip_length order by count(t2.tip_length) desc limit 1
Question: for users with average ratings of 3, what kind of tip length they mostly left? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attri...
for users with average ratings of 3, what kind of tip length they mostly left?
public_review_platform
select sum(t2.likes) as likes from business as t1 inner join tips as t2 on t1.business_id = t2.business_id where t1.city = 'goodyear'
Question: sum up the likes get by short reviews on businesses located in city goodyear. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attrib...
sum up the likes get by short reviews on businesses located in city goodyear.
public_review_platform
select distinct t1.state from business as t1 inner join tips as t2 on t1.business_id = t2.business_id where t2.tip_length = 'long'
Question: for businesses with long length reviews, which state are they located? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id,...
for businesses with long length reviews, which state are they located?
public_review_platform
select sum(t2.closing_time - t2.opening_time) from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id where t1.city = 'el mirage' and t1.state = 'az'
Question: how much time do businesses in el mirage city, az state operate in average daily? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> at...
how much time do businesses in el mirage city, az state operate in average daily?
public_review_platform
select t3.day_id - t2.day_id from business as t1 inner join business_hours as t2 on t1.business_id = t2.business_id inner join days as t3 on t2.day_id = t3.day_id where t1.state = 'sc'
Question: list down the closing day of businesses located at sc state. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_...
list down the closing day of businesses located at sc state.
public_review_platform
select distinct t3.category_name from business as t1 inner join business_categories as t2 on t1.business_id = t2.business_id inner join categories as t3 on t2.category_id = t3.category_id where t1.stars = 5
Question: list down the category of businesses whose stars ratings are 5. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, busine...
list down the category of businesses whose stars ratings are 5.
public_review_platform
select distinct t2.state from business_attributes as t1 inner join business as t2 on t1.business_id = t2.business_id where t1.attribute_value = 'beer_and_wine'
Question: what are the states of businesses with attribute of beer and wine located? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute...
what are the states of businesses with attribute of beer and wine located?
public_review_platform
select count(t2.user_id) from compliments as t1 inner join users_compliments as t2 on t1.compliment_id = t2.compliment_id where t1.compliment_type = 'photos' and t2.number_of_compliments = 'medium'
Question: how many user's compliment in photo has medium in number? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, business_id,...
how many user's compliment in photo has medium in number?
public_review_platform
select t3.business_id from attributes as t1 inner join business_attributes as t2 on t1.attribute_id = t2.attribute_id inner join business as t3 on t2.business_id = t3.business_id where t1.attribute_name = 'wi-fi' and t2.attribute_value = 'true' and t3.state = 'sc'
Question: among businesses with 'wi-fi' attribute, which businesses id are located at sc state? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -...
among businesses with 'wi-fi' attribute, which businesses id are located at sc state?
public_review_platform
select count(t2.business_id) from attributes as t1 inner join business_attributes as t2 on t1.attribute_id = t2.attribute_id where t1.attribute_name = 'ambience_romantic' and t2.attribute_value = 'true'
Question: sum up the number of business with 'ambience_romantic' attribute. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Attributes -> attribute_id, busi...
sum up the number of business with 'ambience_romantic' attribute.
public_review_platform
select cast(sum(case when attribute_name = 'good for kids' then 1 else 0 end) as real) * 100 / count(t2.business_id) from attributes as t1 inner join business_attributes as t2 on t1.attribute_id = t2.attribute_id where t2.attribute_value = 'true'
Question: what is the percentage of businesses with 'good for kids' attribute over the other attributes? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_id, actual_year. Business_Att...
what is the percentage of businesses with 'good for kids' attribute over the other attributes?