db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
public_review_platform | select count(business_id) from business_attributes where attribute_id = 1 and attribute_value = 'beer_and_wine' | Question: how many businesses id sell beer and wine? | 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_valu... | how many businesses id sell beer and wine? |
public_review_platform | select count(attribute_id) from business_attributes where business_id = 2 | Question: how many attributes id owned by business 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, business_id, attribute_... | how many attributes id owned by business id 2? |
public_review_platform | select count(t1.user_id) from users_compliments as t1 inner join compliments as t2 on t1.compliment_id = t2.compliment_id where t1.number_of_compliments like 'high' and t2.compliment_id = 1 | Question: how many users received high compliment type in photo? | 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, at... | how many users received high compliment type in photo? |
public_review_platform | select count(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 like 'phoenix' and t3.attribute_name like 'waiter_service' and t2.attribute_id = 2 | Question: how many businesses in phoenix, arizona is attributed to waiter service? | 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_i... | how many businesses in phoenix, arizona is attributed to waiter service? |
public_review_platform | select t5.attribute_name from business_hours as t1 inner join days as t2 on t1.day_id = t2.day_id inner join business as t3 on t1.business_id = t3.business_id inner join business_attributes as t4 on t3.business_id = t4.business_id inner join attributes as t5 on t4.attribute_id = t5.attribute_id where t2.day_id like '1'... | Question: find out which business is opened for 24/7 and list out what is the business 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... | find out which business is opened for 24/7 and list out what is the business attribute. |
public_review_platform | select t3.business_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 inner join reviews as t4 on t3.business_id = t4.business_id where t1.category_name like 'fashion' and t1.category_id = 7 group by t3.business_i... | Question: which business in fashion category has the most 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, business_id, a... | which business in fashion category has the most review? |
public_review_platform | select distinct t4.category_name from reviews 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.state like 'az' and t1.review_stars >= 3 | Question: list out which business category that are most likely to have average good review in arizona? | 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... | list out which business category that are most likely to have average good review in arizona? |
public_review_platform | select cast(sum(case when t1.user_average_stars = 1 then 1 else 0 end) as real) / count(t2.user_id) , sum(case when t1.user_average_stars = 5 then 1 else 0 end) * 1.0 / count(t2.user_id) from users as t1 inner join elite as t2 on t1.user_id = t2.user_id where t2.year_id = 2013 | Question: what is the ratio of having the best to worse elite user in 2013? | 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 ratio of having the best to worse elite user in 2013? |
public_review_platform | select cast(count(case when year_id < 2014 then 1 else null end) as real) * 100 / count(case when year_id = 2005 then 1.0 else null end) as increment from elite | Question: calculate the increment percentage of elite user for each year since year 2005. | 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... | calculate the increment percentage of elite user for each year since year 2005. |
public_review_platform | select count(t1.business_id) , strftime('%y', 'now') - t2.user_yelping_since_year from reviews as t1 inner join users as t2 on t1.user_id = t2.user_id where t1.user_id = 3 | Question: how many business have been reviewed by user id 3 and how long have this user been with 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, actual_year. Business_Attr... | how many business have been reviewed by user id 3 and how long have this user been with yelp? |
public_review_platform | select count(review_stars) / (strftime('%y', 'now') - t1.user_yelping_since_year) from users as t1 inner join reviews as t2 on t1.user_id = t2.user_id where t1.user_id = 3 | Question: what is the yearly average review done by user id 3? | 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 yearly average review done by user id 3? |
public_review_platform | select cast(count(t1.user_id) as real) / count(distinct t1.business_id) from reviews as t1 inner join elite as t2 on t1.user_id = t2.user_id | Question: what is the average number of review received by each business given that the user is an elite? | 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... | what is the average number of review received by each business given that the user is an elite? |
public_review_platform | select t2.user_average_stars, count(t3.likes) from elite as t1 inner join users as t2 on t1.user_id = t2.user_id inner join tips as t3 on t3.user_id = t2.user_id group by t1.user_id having count(t1.user_id) > 5 | Question: list out the user who is an elite user for consecutively 5 years or more and what is the user average star? how many likes does this user gets? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_... | list out the user who is an elite user for consecutively 5 years or more and what is the user average star? how many likes does this user gets? |
public_review_platform | select t2.category_id from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id inner join reviews as t3 on t3.business_id = t1.business_id where t2.category_name = 'hotels & travel' group by t2.category_id order by count(t2.category_id) desc limit 1 | Question: find out which hotel and travel business having the most review? calculate the standard deviation of the review star for this business. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Ye... | find out which hotel and travel business having the most review? calculate the standard deviation of the review star for this business. |
public_review_platform | select cast(sum(t2.review_stars) as real) / count(t1.business_id) from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id | Question: what is the correlation between the review starts and business 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_id, ... | what is the correlation between the review starts and business stars? |
public_review_platform | select count(business_id) from business where active like 'true' | Question: how many of the businesses are active? | 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. B... | how many of the businesses are active? |
public_review_platform | select business_id from business where city like 'phoenix' and review_count like 'low' | Question: list down the business id with a low review count 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 -> attribute_id, business... | list down the business id with a low review count in phoenix. |
public_review_platform | select count(business_id) from business where state like 'az' and review_count like 'high' and active like 'true' | Question: what is the total number of active business in az with a high review count? | 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... | what is the total number of active business in az with a high review count? |
public_review_platform | select business_id from business where city like 'tempe' and stars between 3 and 4 | Question: list down the business id with a star range from 3 to 4, located at tempe. | 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... | list down the business id with a star range from 3 to 4, located at tempe. |
public_review_platform | select count(user_id) from users where user_yelping_since_year between 2010 and 2012 and user_fans like 'low' | Question: in users yelping since 2010 to 2012, how many of them has an low 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,... | in users yelping since 2010 to 2012, how many of them has an low fans? |
public_review_platform | select review_length from reviews where user_id = 60776 and business_id = 1 | Question: what is the review length of user 60776 to business with business id 1? | 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 is the review length of user 60776 to business with business id 1? |
public_review_platform | select t3.attribute_name 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.review_count like 'high' and t1.city like 'scottsdale' group by t3.attribute_name | Question: among the businesses in scottsdale, list the attribute of the business with a high review count. | 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 in scottsdale, list the attribute of the business with a high review count. |
public_review_platform | select count(t1.business_id) from business as t1 inner join business_categories on t1.business_id = business_categories.business_id inner join categories as t3 on business_categories.category_id = t3.category_id where t3.category_name like 'automotive' and t1.stars < 3 | Question: in businesses with a category of automotive, how many of them has an star rating below 3? | 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_Attribut... | in businesses with a category of automotive, how many of them has an star rating below 3? |
public_review_platform | select t1.business_id, t1.stars from business as t1 inner join business_categories on t1.business_id = business_categories.business_id inner join categories as t3 on business_categories.category_id = t3.category_id where t1.active like 'true' and t3.category_name like 'pets' | Question: list the active business id and its stars of the businesses fall under the category of 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_Attri... | list the active business id and its stars of the businesses fall under the category of pets. |
public_review_platform | select t3.attribute_name 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 order by t1.stars desc limit 1 | Question: what is the attribute of the business with highest star rating? | 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... | what is the attribute of the business with highest star rating? |
public_review_platform | select t4.category_name from reviews 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 t1.review_length like 'short' and t2.business_id between 5 and 10 order by ... | Question: what is the category of the business with short review length and highest review stars within business id from 5 t0 10? | 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, ... | what is the category of the business with short review length and highest review stars within business id from 5 t0 10? |
public_review_platform | select count(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 t3.attribute_name like 'wi-fi' and t1.active like 'true' and t1.review_count like 'medium' | Question: count the active businesses that has an attribute of wi-fi with medium review count. | 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 ->... | count the active businesses that has an attribute of wi-fi with medium review count. |
public_review_platform | select 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 like 'gilbert' order by t1.stars desc limit 1 | Question: what is the closing and opening time of businesses located at gilbert with highest star rating? | 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... | what is the closing and opening time of businesses located at gilbert with highest star rating? |
public_review_platform | select 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.review_count = 'low' and t1.city = 'mesa' and t1.active = 'true' and t1.state = 'az' | Question: among the active businesses located at mesa, az, list the category and attributes of business with a low review count. | 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, a... | among the active businesses located at mesa, az, list the category and attributes of business with a low review count. |
public_review_platform | select t3.category_name from business as t1 inner join business_categories on t1.business_id = business_categories.business_id inner join categories as t3 on business_categories.category_id = t3.category_id where t1.active like 'false' and t1.state like 'az' | Question: list the categories of inactive businesses in az. | 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, attribu... | list the categories of inactive businesses in az. |
public_review_platform | select t1.city 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 t2.closing_time like '9pm' and t2.opening_time like '9am' and t3.day_of_week like 'saturday' group by t1.city | Question: find the location of businesses that has business hours from 9 am to 9 pm every 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_Attribut... | find the location of businesses that has business hours from 9 am to 9 pm every saturday. |
public_review_platform | select t2.attribute_value 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.state like 'az' and t1.review_count like 'medium' and t1.active like 'false' and t1.city like 'phoenix' and t1.stars = 3.5 | Question: what is the attribute value of an inactive business with a medium review count and 3.5 stars which is located at phoenix, az? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> yea... | what is the attribute value of an inactive business with a medium review count and 3.5 stars which is located at phoenix, az? |
public_review_platform | select t2.opening_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 like 'surprise' and t1.active like 'true' and t1.review_count like 'low' group by t2.opening_time | Question: what is the opening time of the active businesses in surprise that has a low review count. | 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... | what is the opening time of the active businesses in surprise that has a low review count. |
public_review_platform | select cast(sum(case when t1.stars < 3 then 1 else 0 end) as real) * 100 / count(t1.stars) as 'percentage' from business as t1 inner join business_categories on t1.business_id = business_categories.business_id inner join categories as t3 on business_categories.category_id = t3.category_id where t3.category_name like 'l... | Question: among the businesses with a category of local services, what is the percentage of the business with 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, a... | among the businesses with a category of local services, what is the percentage of the business with less than 3 stars? |
public_review_platform | select t2.closing_time, 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 like 'scottsdale' and t1.active like 'true' and t1.stars > 0.6 * ( select avg(t1.stars) from business as t1 inner join business_hours... | Question: list the closing time and day of week of active businesses in scottsdale with stars greater than the 60% of average age of star rating. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Ye... | list the closing time and day of week of active businesses in scottsdale with stars greater than the 60% of average age of star rating. |
public_review_platform | select count(user_id) from users where user_yelping_since_year = 2004 and user_fans like 'none' | Question: how many users have no followers in 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 -> attribute_id, business_id, attribute_value... | how many users have no followers in 2014? |
public_review_platform | select user_id from users_compliments where number_of_compliments like 'low' group by user_id order by count(number_of_compliments) > 5 limit 5 | Question: list at least 5 users that has received less than 5 low compliments fromother 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 ->... | list at least 5 users that has received less than 5 low compliments fromother users. |
public_review_platform | select count(user_id) from users where user_average_stars = 4 limit 10 | Question: list at least 10 users id that has 4 as an average ratings of all reviews sent. | 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... | list at least 10 users id that has 4 as an average ratings of all reviews sent. |
public_review_platform | select t1.city 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 t2.opening_time like '10am' and t2.closing_time like '12pm' and t3.day_of_week like 'sunday' | Question: what city does the business have a business hour from 10 am to 12 pm 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 -> attr... | what city does the business have a business hour from 10 am to 12 pm on sunday? |
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 t2.attribute_value like 'true' and t1.attribute_name like 'open 24 hours' | Question: how many businesses are opened for 24 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_id, attribute_va... | how many businesses are opened for 24 hours? |
public_review_platform | select t2.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 t2.attribute_value like 'true' and t1.attribute_name like 'good for dancing' and t1.attribute_name like 'good for groups' limit 5 | Question: list at least 5 active business id that are good for groups and dancing. | 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_i... | list at least 5 active business id that are good for groups and dancing. |
public_review_platform | select t1.business_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.city like 'ahwatukee' and t1.active like 'true' and t3.day_of_week like 'sunday' | Question: among the active businesses in ahwatukee, which of them are still open in 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 -> at... | among the active businesses in ahwatukee, which of them are still open in sunday? |
public_review_platform | select t3.category_name from business as t1 inner join business_categories on t1.business_id = business_categories.business_id inner join categories as t3 on business_categories.category_id = t3.category_id where t1.active like 'true' and t1.state not like 'az' | Question: list the categories of all active businesses that were not in arizona. | 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,... | list the categories of all active businesses that were not in arizona. |
public_review_platform | select t3.category_name from business as t1 inner join business_categories on t1.business_id = business_categories.business_id inner join categories as t3 on business_categories.category_id = t3.category_id where t1.stars = 2 and t1.review_count like 'high' | Question: list the category of the business with high review count but received 2 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 -> attri... | list the category of the business with high review count but received 2 stars. |
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 t2.attribute_value = 'true' and t1.attribute_name = 'ambience_romantic' | Question: how many businesses have a romantic ambiance? | 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 have a romantic ambiance? |
public_review_platform | select t1.city 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 t2.closing_time like '6pm' and t2.opening_time like '1pm' and t3.day_of_week like 'saturday' | Question: list the city of the business where they open from 1 pm to 6 pm 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 -> attribu... | list the city of the business where they open from 1 pm to 6 pm on saturday. |
public_review_platform | select count(t1.user_fans) from users as t1 inner join tips as t2 on t1.user_id = t2.user_id order by count(t2.likes) desc limit 1 | Question: what is the total number of fans or followers who received most likes of their comments in 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, actual_year. Bu... | what is the total number of fans or followers who received most likes of their comments in the business? |
public_review_platform | select t1.city 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 t2.closing_time = '1am' and t2.opening_time = '12am' and t3.day_of_week = 'saturday' | Question: what city does the business came from where they received a high volume of check-ins from 12 am to 1 am 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, act... | what city does the business came from where they received a high volume of check-ins from 12 am to 1 am on saturday. |
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 inner join business as t3 on t2.business_id = t3.business_id where t1.category_name = 'shopping centers' and t3.review_count = 'high' | Question: how many businesses have shopping centers and received high review count? | 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 have shopping centers and received high review count? |
public_review_platform | select count(t1.business_id) from business_attributes as t1 inner join attributes as t2 on t1.attribute_id = t2.attribute_id where t2.attribute_name = 'accepts insurance' and t1.attribute_value = 'true' | Question: how many businesses accept insurance? | 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. Bu... | how many businesses accept insurance? |
public_review_platform | select 1.0 * (( select sum(t1.stars) from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.state = 'sc' ) + ( select sum(t1.stars) from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.state = 'ca' )) / ( select sum(t1.stars) from business as t1 inne... | Question: calculate the average review star from users in businesses located in south carolina and california 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. ... | calculate the average review star from users in businesses located in south carolina and california state. |
public_review_platform | select sum(case when t3.day_of_week = 'monday' then 1 else 0 end) - sum(case when t3.day_of_week = 'tuesday' then 1 else 0 end) as diff 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 t2.opening_time = '10am' and t2.closing_time... | Question: compare and get the difference of the number of businesses that are open in monday and tuesday from 10 am to 9 pm. | 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... | compare and get the difference of the number of businesses that are open in monday and tuesday from 10 am to 9 pm. |
public_review_platform | select attribute_id from attributes where attribute_name = 'accepts insurance' | Question: state the id number for the attribute named 'accepts insurance'? | 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... | state the id number for the attribute named 'accepts insurance'? |
public_review_platform | select count(business_id) from business where active = 'true' and city = 'phoenix' | Question: how many actively running yelp businesses are there located in 'phoenix' 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 -> attri... | how many actively running yelp businesses are there located in 'phoenix' city? |
public_review_platform | select count(business_id) from business where stars = 4 and city = 'mesa' | Question: give the number of '4' stars yelp businesses in '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 -> attribute_id, business_... | give the number of '4' stars yelp businesses in 'mesa' city. |
public_review_platform | select count(business_id) from business where review_count = 'high' and city = 'gilbert' | Question: provide the number of yelp businesses in 'gilbert' which got a' high' review count. | 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 -> ... | provide the number of yelp businesses in 'gilbert' which got a' high' review count. |
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.active = 'true' and t1.city = 'gilbert' and t1.review_count = 'uber' | Question: which actively running yelp business in 'gilbert' has got the most reviews? give the business id. | 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_... | which actively running yelp business in 'gilbert' has got the most reviews? give the business id. |
public_review_platform | select count(t2.review_length) from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.city = 'tempe' and t1.stars = '3.5' and t1.review_count = 'uber' and t2.review_length = 'long' | Question: for the yelp business in 'tempe' city which got '3.5' stars and review count as 'uber', how many 'long' reviews did it 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_... | for the yelp business in 'tempe' city which got '3.5' stars and review count as 'uber', how many 'long' reviews did it get? |
public_review_platform | select t3.attribute_name 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 t1.review_count = 'uber' and t3.attribute_name = 'noise level' | Question: how is the 'noise level' for the only yelp business in mesa which got a 'uber' review count? | 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... | how is the 'noise level' for the only yelp business in mesa which got a 'uber' review count? |
public_review_platform | select t1.attribute_value from business_attributes as t1 inner join attributes as t2 on t1.attribute_id = t2.attribute_id where t2.attribute_name = 'good_for_dinner' and t1.business_id = 14033 | Question: is the yelp business no. 14033 good for supper? | 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... | is the yelp business no. 14033 good for supper? |
public_review_platform | select substr(t1.closing_time, 1, 2) + 12 - substr(t1.opening_time, 1, 2) as yysj from business_hours as t1 inner join days as t2 on t1.day_id = t2.day_id where t2.day_of_week = 'monday' and t1.business_id = 15098 | Question: how long is the yelp business no. 15098 opened 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,... | how long is the yelp business no. 15098 opened on monday? |
public_review_platform | select 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_stars = 5 and t2.review_votes_funny = 'uber' | Question: for the yelp businesses which received a '5' star review with 'uber' number of votes for funny, which one is located in 'phoenix'? give the business id. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id... | for the yelp businesses which received a '5' star review with 'uber' number of votes for funny, which one is located in 'phoenix'? give the business id. |
public_review_platform | select t1.city from business as t1 inner join tips as t2 on t1.business_id = t2.business_id where t2.tip_length = 'medium' and t2.likes = 3 | Question: which city is the business that got a 'medium' length tip with '3' likes located in? | 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 ->... | which city is the business that got a 'medium' length tip with '3' likes located in? |
public_review_platform | select count(t2.user_id) 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_yelping_since_year = 2010 and t1.user_average_stars = 4.5 and t1.user_fans = 'uber' and t3.compliment_type = 'funny' | Question: for the user who joined yelp in '2010', with an average of '4.5' stars review and has got uber number of fans, how many 'funny' compliments has he/she received from other users? | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compli... | for the user who joined yelp in '2010', with an average of '4.5' stars review and has got uber number of fans, how many 'funny' compliments has he/she received from other users? |
public_review_platform | select count(t2.number_of_compliments) from compliments as t1 inner join users_compliments as t2 on t1.compliment_id = t2.compliment_id where t1.compliment_type = 'cool' and t2.user_id = 41717 | Question: how many 'cool' type compliments does user no. 41717 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, business_id,... | how many 'cool' type compliments does user no. 41717 get? |
public_review_platform | select t1.attribute_value from business_attributes as t1 inner join attributes as t2 on t1.attribute_id = t2.attribute_id where t1.business_id = 11825 and t2.attribute_name = 'parking_lot' | Question: does yelp business no.'11825' have a 'parking lot'? | 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... | does yelp business no.'11825' have a 'parking lot'? |
public_review_platform | select t1.attribute_value from business_attributes as t1 inner join attributes as t2 on t1.attribute_id = t2.attribute_id where t1.business_id = 12476 and t2.attribute_name = 'payment_types_mastercard' | Question: is the payment in mastercard possible for the yelp business no.'12476'? | 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... | is the payment in mastercard possible for the yelp business no.'12476'? |
public_review_platform | select cast(sum(case when t2.category_name = 'pets' then 1 else 0 end) as real) * 100 / count(t2.category_name) from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id | Question: what is the percentage for the yelp businesses in 'pets' category of all 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. Business_Attributes ->... | what is the percentage for the yelp businesses in 'pets' category of all businesses? |
public_review_platform | select cast(sum(case when t2.category_name = 'women''s clothing' then 1 else 0 end) as real) / sum(case when t2.category_name = 'men''s clothing' then 1 else 0 end) as times from business_categories as t1 inner join categories as t2 on t1.category_id = t2.category_id | Question: how many times is the number of 'women's clothing' yelp businesses to 'men's clothing'? | 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... | how many times is the number of 'women's clothing' yelp businesses to 'men's clothing'? |
public_review_platform | select business_id, active, city from business where state = 'ca' and active = 'true' | Question: write down the id, active status and city of the business which are in ca 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 -> att... | write down the id, active status and city of the business which are in ca state. |
public_review_platform | select cast(sum(case when active = 'true' then 1 else 0 end) as real) * 100 / count(business_id) from business | Question: calculate the percentage of running business among all 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, actual_year. Business_Attributes -> attribute_id, busin... | calculate the percentage of running business among all business. |
public_review_platform | select attribute_id, attribute_name from attributes where attribute_name like 'music%' | Question: among all attribute names, list down the id and attribute name which start with 'music'. | 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... | among all attribute names, list down the id and attribute name which start with 'music'. |
public_review_platform | select year_id from elite where year_id in (2006, 2007) group by year_id order by count(user_id) desc limit 1 | Question: between 2006 and 2007, which year id had the greater number in 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... | between 2006 and 2007, which year id had the greater number in elite user? |
public_review_platform | select cast(sum(case when number_of_compliments = 'low' then 1 else 0 end) as real) * 100 / count(user_id) from users_compliments | Question: based on all user compliments, find the percentage of low number of compliments on all compliments id. | 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... | based on all user compliments, find the percentage of low number of compliments on all compliments id. |
public_review_platform | select business_id, user_id from reviews where review_votes_cool = 'uber' | Question: list down the business id and user id who got uber for cool 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_Attributes -> attribute_id, bus... | list down the business id and user id who got uber for cool votes. |
public_review_platform | select t1.user_id, t2.business_id, t2.tip_length from users as t1 inner join tips as t2 on t1.user_id = t2.user_id where t1.user_yelping_since_year = 2004 and t1.user_fans = 'high' | Question: write the user id, business id and tips length of who started using yelp since 2004 and had high followers. | 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.... | write the user id, business id and tips length of who started using yelp since 2004 and had high followers. |
public_review_platform | select t1.business_id, t1.active, t3.user_id, t3.user_yelping_since_year from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id inner join users as t3 on t2.user_id = t3.user_id where t2.review_votes_cool = 'uber' and t2.review_votes_funny = 'uber' and t2.review_length = 'long' | Question: among the review votes of funny and cool hit uber with long review length, describe the business id, active status, user id and user year of joining yelp. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_... | among the review votes of funny and cool hit uber with long review length, describe the business id, active status, user id and user year of joining yelp. |
public_review_platform | select t1.attribute_id, t2.business_id, t3.city 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 = 'music_playlist' and t3.active = 'false' | Question: under the attribute name of 'music_playlist', describe the attribute id, business id, city and inactive status. | 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... | under the attribute name of 'music_playlist', describe the attribute id, business id, city and inactive status. |
public_review_platform | select cast(sum(case when t1.attribute_name = 'accepts credit cards' then 1 else 0 end) as real) * 100 / count(t1.attribute_name) from attributes as t1 inner join business_attributes as t2 on t1.attribute_id = t2.attribute_id | Question: calculate the percentage of business with attribute name of 'accepts credit cards'. | 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 percentage of business with attribute name of 'accepts credit cards'. |
public_review_platform | select t2.user_id, t2.review_length from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.city = 'san tan valley' and t1.active = 'false' and t2.review_stars = 5 | Question: among the stopped businesses in san tan valley city, list down the user id and review length of who had great experience. | 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 the stopped businesses in san tan valley city, list down the user id and review length of who had great experience. |
public_review_platform | select t2.user_average_stars, t1.year_id, t4.compliment_type, t3.number_of_compliments from elite as t1 inner join users as t2 on t1.user_id = t2.user_id inner join users_compliments as t3 on t2.user_id = t3.user_id inner join compliments as t4 on t3.compliment_id = t4.compliment_id inner join years as t5 on t1.year_id... | Question: mention the user average star, elite year and the compliment type of user id 6027 whereby number of compliments reach uber. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> year_... | mention the user average star, elite year and the compliment type of user id 6027 whereby number of compliments reach uber. |
public_review_platform | select t2.business_id, t3.state, t3.city 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 = 'coffee & tea' limit 5 | Question: under the category name of 'coffee & tea', mention any 5 business id , their state 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_year. Business_Attri... | under the category name of 'coffee & tea', mention any 5 business id , their state and city. |
public_review_platform | select t1.category_name from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id group by t2.category_id having count(t2.business_id) > ( select count(t3.business_id) from business_categories as t3 ) * 0.1 | Question: describe category name which had above 10% in comparing with all business and 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, actual_year. Business_Attribut... | describe category name which had above 10% in comparing with all business and categories. |
public_review_platform | select t3.user_id, t3.user_fans from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id inner join users as t3 on t2.user_id = t3.user_id where t1.city = 'sun lakes' and t1.stars = 5 | Question: for the business with great experience existed in sun lakes city, provide the user id who gave review on it and user followers. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> y... | for the business with great experience existed in sun lakes city, provide the user id who gave review on it and user followers. |
public_review_platform | select sum(case when t1.category_name = 'men''s clothing' then 1 else 0 end) - sum(case when t1.category_name = 'women''s clothing' then 1 else 0 end) as diff from categories as t1 inner join business_categories as t2 on t1.category_id = t2.category_id | Question: compare the number of business between the category of 'men's clothing' and 'women's clothing'. | 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... | compare the number of business between the category of 'men's clothing' and 'women's clothing'. |
public_review_platform | select t1.compliment_type, t3.user_fans 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 t2.number_of_compliments = 'uber' and t2.user_id < 100 | Question: among highest quality user of under id 100, mention compliment type which got highest compliment number and user's followers. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -> yea... | among highest quality user of under id 100, mention compliment type which got highest compliment number and user's followers. |
public_review_platform | select distinct business_id from business_hours where closing_time = '8pm' | Question: list all the businesses that closed at 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 -> attribute_id, business_id, attribute_val... | list all the businesses that closed at 8pm. |
public_review_platform | select count(business_id) from business where city = 'phoenix' and state = 'az' and stars = 2 | Question: how many 2 stars rated business located in phoenix, arizona? | 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 2 stars rated business located in phoenix, arizona? |
public_review_platform | select count(business_id) from business where city = 'phoenix' and stars > 3 | Question: how many businesses in tempe are rated as 'wonderful experience? | 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... | how many businesses in tempe are rated as 'wonderful experience? |
public_review_platform | select user_id from users where user_yelping_since_year = 2012 and user_average_stars < 3 | Question: list all the users with average star less than 3 stars 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_Attributes -> attribute_id, busines... | list all the users with average star less than 3 stars in 2012 |
public_review_platform | select cast(sum(case when stars = 5 then 1 else 0 end) as real) * 100 / count(stars) from business | Question: find the percentage of 5 stars rated 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, actual_year. Business_Attributes -> attribute_id, business_id, attribute_... | find the percentage of 5 stars rated business. |
public_review_platform | select ( select count(business_id) from reviews group by business_id order by count(business_id) desc limit 1 ) - ( select count(business_id) from reviews group by business_id order by count(business_id) asc limit 1 ) as diff | Question: calculate difference between business that have the highest number of reviews and business that have the lowest number of reviews. | Tables: Attributes -> attribute_id, attribute_name. Categories -> category_id, category_name. Compliments -> compliment_id, compliment_type. Days -> day_id, day_of_week. Years -... | calculate difference between business that have the highest number of reviews and business that have the lowest number of reviews. |
public_review_platform | select distinct t2.business_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 inner join business_hours as t4 on t3.business_id = t4.business_id where t1.category_name = 'tires' group by t2.business_id having cou... | Question: list all the tires businesses that are opened everyday. | 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 all the tires businesses that are opened everyday. |
public_review_platform | select distinct t1.user_id from elite as t1 inner join years as t2 on t1.year_id = t2.year_id where t2.actual_year = 2012 | Question: which users become an elite 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_Attributes -> attribute_id, business_id, attribute_value. Bus... | which users become an elite in 2012? |
public_review_platform | select 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 = 'shopping' and t1.stars = 4 | Question: list the business id of shopping business that have 4 stars ratings. | 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 the business id of shopping business that have 4 stars ratings. |
public_review_platform | select count(t2.business_id) from days as t1 inner join checkins as t2 on t1.day_id = t2.day_id where t1.day_of_week = 'sunday' and t2.label_time_10 = 'low' | Question: how many business have low check-in on sunday at 10am? | 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, at... | how many business have low check-in on sunday at 10am? |
public_review_platform | select count(t1.business_id) from business as t1 inner join reviews as t2 on t1.business_id = t2.business_id where t1.city = 'glendale' and t2.user_id = 20241 | Question: how many businesses in glendale are reviewed by user with the id of 20241? | 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 glendale are reviewed by user with the id of 20241? |
public_review_platform | select t1.city 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 = 'pet services' | Question: state the locations of all pet services 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, actual_year. Business_Attributes -> attribute_id, business_id, attribu... | state the locations of all pet services business. |
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 inner join compliments as t3 on t2.compliment_id = t3.compliment_id inner join reviews as t4 on t1.user_id = t4.user_id where t3.compliment_type = 'photos' and t4.review_votes_cool = 'high' | Question: how many photos type compliment given from users with high cool 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_Attributes -> attribute_id,... | how many photos type compliment given from users with high cool votes? |
public_review_platform | select count(*) from business where business_id in ( select t1.business_id from business as t1 inner join business_attributes as t2 on t1.business_id = t2.business_id where t1.active = 'false' group by t1.business_id having count(distinct t2.attribute_id) > 10 ) | Question: how many closed businesses that have more than 10 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_Attributes -> attribute_id, business... | how many closed businesses that have more than 10 attributes? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.