Chinastark/bird_dataset huggingface dataset:
Database: public_review_platform
Note: businesses names refers to business_id; length of user review is long refers to review_length = 'Long'; business_id BETWEEN 1 AND 20;
Question: Please list the businesses names whose length of user review is long with business id from 1 to 20.
SQL: SELECT categories.category_name FROM reviews INNER JOIN business ON reviews.business_id = business.business_id INNER JOIN business_categories ON business.business_id = business_categories.business_id INNER JOIN categories ON business_categories.category_id = categories.category_id WHERE reviews.review_length LIKE 'Long' AND business_categories.category_id BETWEEN 1 AND 20 GROUP BY categories.category_name
Database: public_review_platform
Note: fashion refers to category_name = 'Fashion'; Scottsdale refers to city = 'Scottsdale';
Question: Please provide the attribute values ​​of the bussinesses with fashion in Scottsdale.
SQL: SELECT business_attributes.attribute_value FROM business INNER JOIN business_attributes ON business.business_id = business_attributes.business_id INNER JOIN business_categories ON business.business_id = business_categories.business_id INNER JOIN categories ON business_categories.category_id = categories.category_id WHERE categories.category_name LIKE 'Fashion' AND business.city LIKE 'Scottsdale'
Database: public_review_platform
Note: medium refers to number_of_compliments = 'Medium';
Question: How many compliments received from medium users that Phoenix city achieved?
SQL: SELECT count(users_compliments.number_of_compliments) FROM users_compliments INNER JOIN reviews ON users_compliments.user_id = reviews.user_id INNER JOIN business ON reviews.business_id = business.business_id WHERE business.city LIKE 'Phoenix' AND users_compliments.number_of_compliments LIKE 'Medium'
Database: public_review_platform
Note: opening hours refers to opening_time; earlier than 8AM refers to opening_time < '8AM';
Question: Provide the businesses name in Tempe city whose opening hours are earlier than 8AM.
SQL: SELECT categories.category_name FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id INNER JOIN business_hours ON business.business_id = business_hours.business_id WHERE business.city LIKE 'Tempe' AND business_hours.opening_time < '8AM'
Database: public_review_platform
Note: still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
Question: How many businesses in Glendale city that are still running is opened from 8AM to 6PM?
SQL: SELECT count(categories.category_name) FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id INNER JOIN business_hours ON business.business_id = business_hours.business_id WHERE business.city LIKE 'Glendale' AND business_hours.opening_time LIKE '8AM' AND business_hours.closing_time LIKE '6PM'
Database: public_review_platform
Note: percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix' END), COUNT(category_id)), 1.0);
Question: How many businesses are there in Phoenix city? Find the percentage of businesses in Phoenix city in the total city.
SQL: SELECT sum(CASE WHEN business.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS "num" , cast(sum(CASE WHEN business.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / count(business.city) FROM business_categories INNER JOIN categories ON business_categories.category_id = categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id
Database: public_review_platform
Note: category refers to category_name; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'active Life'), SUM(review_count = 'LOW')), 1.0);
Question: How many cities have businesses with active life category? Find the percentage of the city where the review count that is low in total review count.
SQL: SELECT sum(CASE WHEN categories.category_name LIKE 'Active Life' THEN 1 ELSE 0 END) AS "num" , cast(sum(CASE WHEN business.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / ( SELECT count(business.review_count) FROM business_categories INNER JOIN categories ON business_categories.category_id = categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id WHERE business.review_count LIKE 'Low' ) FROM business_categories INNER JOIN categories ON business_categories.category_id = categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id
Database: public_review_platform
Note: active businesses refers to active = 'true'; Phoenix refers to city = 'Phoenix';
Question: How many active businesses are there in Phoenix?
SQL: SELECT count(business_id) FROM business WHERE city LIKE 'Phoenix' AND active LIKE 'TRUE'
Database: public_review_platform
Note: Scottsdale refers to city = 'Scottsdale'; rated refers to stars; rated as wonderful experience refers to stars > 3;
Question: How many businesses in Scottsdale are rated as "wonderful experience"?
SQL: SELECT count(business_id) FROM business WHERE city LIKE 'Scottsdale' AND stars > 3
Database: public_review_platform
Note: rating refers to stars; inactive refers to active = 'False'; average rating of inactive businesses = DIVIDE(SUM(stars), COUNT(business_id));
Question: What is the average rating of inactive businesses?
SQL: SELECT cast(sum(stars) AS REAL) / count(business_id) AS "average" FROM business WHERE active LIKE 'FALSE'
Database: public_review_platform
Note: beer_and_wine refers to attribute_value = 'beer_and_wine';
Question: How many businesses in AZ state have the beer_and_wine attribute?
SQL: SELECT count(business.business_id) FROM business INNER JOIN business_attributes ON business.business_id = business_attributes.business_id WHERE business_attributes.attribute_value LIKE 'beer_and_wine' AND business.state LIKE 'AZ'
Database: public_review_platform
Note: most business refers to MAX(business_id); full_bar refers to attribute_value = 'full_bar';
Question: Which city has the most businesses whose attribute is full_bar?
SQL: SELECT business.city FROM business INNER JOIN business_attributes ON business.business_id = business_attributes.business_id WHERE business_attributes.attribute_value LIKE 'full_bar' GROUP BY business.city
Database: public_review_platform
Note: fashion industry refers to category_name = 'Fashion';
Question: How many businesses in the fashion industry are rated 5 stars?
SQL: SELECT count(business.business_id) FROM business INNER JOIN business_categories ON business.business_id = business_categories.business_id INNER JOIN categories ON business_categories.category_id = categories.category_id WHERE business.stars = 5 AND categories.category_name LIKE 'Fashion'
Database: public_review_platform
Note: highest number of businesses refers to MAX(business_id); food industry refers to category_name = 'Food'; number of reviews is high refers to review_count = 'High';
Question: Which city has the highest number of businesses in the food industry whose number of reviews is high?
SQL: SELECT business.city FROM business INNER JOIN business_categories ON business.business_id = business_categories.business_id INNER JOIN categories ON business_categories.category_id = categories.category_id WHERE business.review_count LIKE 'High' AND categories.category_name LIKE 'Food' GROUP BY business.city
Database: public_review_platform
Note: stars > 3;
Question: Please list all business IDs in Mesa city that review stars of over 3.
SQL: SELECT business.business_id FROM business INNER JOIN reviews ON business.business_id = reviews.business_id WHERE business.city LIKE 'Mesa' AND reviews.review_stars > 3 GROUP BY business.business_id
Database: public_review_platform
Note: least number of businesses refers to MIN(business_id); funny votes is low refers to review_votes_funny = 'Low';
Question: Which city has the least number of businesses whose amount of funny votes is low?
SQL: SELECT business.city FROM business INNER JOIN reviews ON business.business_id = reviews.business_id WHERE reviews.review_votes_funny LIKE 'low' GROUP BY business.city
Database: public_review_platform
Note: Real Estate sector refers to category_name = 'Real Estate'; rating of 5 refers to stars = 5; Chandler refers to city = 'Chandler'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Real Estate' and stars = 5), COUNT(business_id)), 100);
Question: What percentage of businesses are in the Real Estate sector and have the rating of 5 out of all businesses in Chandler?
SQL: SELECT cast(sum(CASE WHEN business.stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / count(business.business_id) AS "percentage" FROM business INNER JOIN business_categories ON business.business_id = business_categories.business_id INNER JOIN categories ON business_categories.category_id = categories.category_id WHERE business.city LIKE 'Chandler' AND categories.category_name LIKE 'Real Estate'
Database: public_review_platform
Note: users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
Question: How many users who started yelping since 2012 have sent a high number of funny votes?
SQL: SELECT count(user_id) FROM users WHERE user_yelping_since_year = 2012 AND user_votes_funny LIKE 'High'
Database: public_review_platform
Note: number of useful votes refers to review_votes_useful; business number refers to business_id;
Question: What is the number of useful votes that the user 52592 received when reviewed for business number 2?
SQL: SELECT review_votes_useful FROM reviews WHERE user_id = 52592 AND business_id = 2
Database: public_review_platform
Note: attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
Question: What are the attribute numbers that are related to payment?
SQL: SELECT attribute_id FROM attributes WHERE attribute_name LIKE '%payment%'
Database: public_review_platform
Note: how long was the review refers to review_length; business number refers to business_id; user number refers to user_id;
Question: How long was the review for business number 2 that user number 612 wrote?
SQL: SELECT review_length FROM reviews WHERE user_id = 612 AND review_stars = 5 AND business_id = 2
Database: public_review_platform
Note: actively running refers to active = 'true';
Question: How many businesses are actively running in Gilbert City?
SQL: SELECT count(business_id) FROM business WHERE city LIKE 'Gilbert' AND active LIKE 'True'
Database: public_review_platform
Note: low quality of reviews refers to review_count = 'low';
Question: How many businesses in the AZ state got low quality of reviews?
SQL: SELECT count(business_id) FROM business WHERE state LIKE 'AZ' AND review_count LIKE 'Low'
Database: public_review_platform
Note: business numbers refers to business_id; great experience review stars refers to review_stars = 5;
Question: Please state any three business numbers in AZ state that have received the "Great experience" review stars.
SQL: SELECT DISTINCT business.business_id FROM reviews INNER JOIN business ON reviews.business_id = business.business_id WHERE business.state LIKE 'AZ' AND reviews.review_stars = 5 LIMIT 3
Database: public_review_platform
Note: business number refers to business_id; business_id = 2; does not have refers to attribute_value = 'none';
Question: Please name one attribute that business number 2 does not have.
SQL: SELECT attributes.attribute_name FROM attributes INNER JOIN business_attributes ON attributes.attribute_id = business_attributes.attribute_id WHERE business_attributes.attribute_value LIKE 'none' LIMIT 1
Database: public_review_platform
Note: cool compliments refers to compliment_type = 'cool'; user number refers to user_id;
Question: How many "cool" compliments did user number 33 receive?
SQL: SELECT count(compliments.compliment_type) FROM users_compliments INNER JOIN compliments ON users_compliments.compliment_id = compliments.compliment_id WHERE users_compliments.user_id = 33 AND compliments.compliment_type LIKE 'cool'
Database: public_review_platform
Note: opening hours refers to opening_time; business number refers to business_id; Friday refers to day_of_week = 'Friday';
Question: What are the opening hours of business number 53 on Friday?
SQL: SELECT business_hours.closing_time - business_hours.opening_time AS "opening hours" FROM business_hours INNER JOIN days ON business_hours.day_id = days.day_id WHERE days.day_of_week LIKE 'Friday' AND business_hours.business_id = 53
Database: public_review_platform
Note: business number refers to business_id; attributes that business have refers to attribute_value = 'true';
Question: What are the attributes that business number 56 have?
SQL: SELECT attributes.attribute_name FROM attributes INNER JOIN business_attributes ON attributes.attribute_id = business_attributes.attribute_id WHERE business_attributes.attribute_value LIKE 'TRUE' AND business_attributes.business_id = 56
Database: public_review_platform
Note: business number refers to business_id;
Question: What are the categories that business number 15 belongs to?
SQL: SELECT categories.category_name FROM business_categories INNER JOIN categories ON business_categories.category_id = categories.category_id WHERE business_categories.business_id = 15
Database: public_review_platform
Note: category refers to category_name;
Question: How many businesses are there in Scottsdale city under the category of "Beauty & Spas"?
SQL: SELECT count(business_categories.business_id) FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id WHERE business.city LIKE 'Scottsdale' AND categories.category_name LIKE 'Beauty & Spas'
Database: public_review_platform
Note: user numbers refers to user_id; Uber number refers to number_of_compliments = 'Uber'; cute compliments refers to compliment_type = 'cute';
Question: Please list any two user numbers that have an "Uber" number of cute compliments.
SQL: SELECT users_compliments.user_id FROM users_compliments INNER JOIN compliments ON users_compliments.compliment_id = compliments.compliment_id WHERE users_compliments.number_of_compliments LIKE 'Uber' AND compliments.compliment_type LIKE 'cute' LIMIT 2
Database: public_review_platform
Note: Accessories category refers to category_name = 'Accessories'; wonderful experience review refers to stars > 3;
Question: How many businesses operating in the "Accessories" category have received a "wonderful experience" review from users?
SQL: SELECT count(business_categories.business_id) FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id WHERE business.stars > 3 AND categories.category_name LIKE 'Accessories'
Database: public_review_platform
Note: business number refers to business_id; Scottsdale refers to city = 'Scottsdale'; day number refers to day_id;
Question: How long does business number 12 in Scottsdale stay open on day number 3?
SQL: SELECT business_hours.closing_time - business_hours.opening_time AS "hour" FROM business INNER JOIN business_hours ON business.business_id = business_hours.business_id WHERE business.business_id = 12 AND business.city LIKE 'Scottsdale' AND business_hours.day_id = 3
Database: public_review_platform
Note: do not open on Thursday refers to day_of_week = 'Thursday' AND label_time_4 = 'None';
Question: How many businesses in AZ state do not open on Thursday?
SQL: SELECT count(business.business_id) FROM business INNER JOIN checkins ON business.business_id = checkins.business_id INNER JOIN days ON checkins.day_id = days.day_id WHERE checkins.label_time_4 LIKE 'None' AND business.state LIKE 'AZ' AND days.day_of_week LIKE 'Thursday'
Database: public_review_platform
Note: Scottsdale refers to city = 'Scottsdale';
Question: How many businesses of Yelp are in Scottsdale?
SQL: SELECT count(business_id) FROM business WHERE city LIKE 'Scottsdale'
Database: public_review_platform
Note: Arizona refers to state = 'AZ'; still running refers to active = 'true';
Question: Among the Yelp_Businesses in Arizona, how many of them are still running?
SQL: SELECT count(business_id) FROM business WHERE state LIKE 'AZ' AND active LIKE 'True'
Database: public_review_platform
Note: Scottsdale refers to city = 'Scottsdale'; positive comments refers to stars > 3; elitestar rating refers to stars;
Question: How many Yelp_Businesses in Scottsdale have received positive comments in the Elitestar rating?
SQL: SELECT count(business_id) FROM business WHERE city LIKE 'Scottsdale' AND stars > 3
Database: public_review_platform
Note: more appealing to users refers to MAX(review_count);
Question: Which city has more Yelp_Business that's more appealing to users, Scottsdale or Anthem?
SQL: SELECT city FROM business ORDER BY review_count DESC LIMIT 1
Database: public_review_platform
Note: Arizona refers to state = 'AZ'; elitestar rating of over 4 refers to stars > 4;
Question: How many Yelp_Businesses in Arizona have a Elitestar rating of over 4?
SQL: SELECT count(business_id) FROM business WHERE state LIKE 'AZ' AND stars > 4
Database: public_review_platform
Note: Arizona refers to state = 'AZ';
Question: How many Yelp_Businesses are there in Arizona in total?
SQL: SELECT count(business_id) FROM business WHERE state LIKE 'AZ'
Database: public_review_platform
Note: 5 in the elitestar rating refers to stars = 5;
Question: Please list the cities of the Yelp_Businesses that have gotten a 5 in the Elitestar rating.
SQL: SELECT city FROM business WHERE stars = 5 GROUP BY city
Database: public_review_platform
Question: How many reviews have the user whose ID is 3 posted?
SQL: SELECT count(review_length) FROM reviews WHERE user_id = 3
Database: public_review_platform
Note: long refers to review_length = 'Long';
Question: How many reviews made by user whose ID is 3 are long?
SQL: SELECT count(review_length) FROM reviews WHERE user_id = 3 AND review_length LIKE 'Long'
Database: public_review_platform
Note: long reviews refers to review_length = 'Long'; medium number of useful votes refers to review_votes_useful = 'medium';
Question: Among the long reviews made by user ID 3, how many of them have received a medium number of useful votes?
SQL: SELECT count(review_length) FROM reviews WHERE user_id = 3 AND review_length LIKE 'Long' AND review_votes_useful LIKE 'Medium'
Database: public_review_platform
Note: since year 2012 refers to user_yelping_since_year = '2012';
Question: How many users have joined Yelp since the year 2012?
SQL: SELECT count(user_id) FROM users WHERE user_yelping_since_year = 2012
Database: public_review_platform
Note: high number of followers refers to user_fans = 'High';
Question: Please list the IDs of the users who have a high number of followers.
SQL: SELECT user_id FROM users WHERE user_fans LIKE 'High' GROUP BY user_id
Database: public_review_platform
Note: do not provide alcohol refers to attribute_name = 'Alcohol'and attribute_value = 'none';
Question: How many Yelp_Businesses do not provide alcohol?
SQL: SELECT count(attributes.attribute_id) FROM attributes INNER JOIN business_attributes ON attributes.attribute_id = business_attributes.attribute_id WHERE attributes.attribute_name LIKE 'Alcohol' AND business_attributes.attribute_value LIKE 'none'
Database: public_review_platform
Note: Arizona refers to state = 'AZ'; do not provide alcohol refers to attribute_name = 'Alcohol' and attribute_value = 'none';
Question: Among the Yelp_Businesses in Arizona, how many of them do not provide alcohol?
SQL: SELECT count(business_attributes.business_id) FROM attributes INNER JOIN business_attributes ON attributes.attribute_id = business_attributes.attribute_id INNER JOIN business ON business_attributes.business_id = business.business_id WHERE attributes.attribute_name LIKE 'Alcohol' AND business_attributes.attribute_value LIKE 'none' AND business.state LIKE 'AZ'
Database: public_review_platform
Note: good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true';
Question: Please list the business IDs of all the Yelp_Businesses that are good for kids.
SQL: SELECT business_attributes.business_id FROM attributes INNER JOIN business_attributes ON attributes.attribute_id = business_attributes.attribute_id WHERE attributes.attribute_name LIKE 'Good for Kids' AND business_attributes.attribute_value LIKE 'TRUE'
Database: public_review_platform
Note: category of "Shopping" refers to category_name = 'Shopping';
Question: How many Yelp_Business falls under the category of "Shopping"?
SQL: SELECT count(categories.category_id) FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id WHERE categories.category_name LIKE 'Shopping'
Database: public_review_platform
Note: categories refers to category_name; Yelp_business no.1 refers to business_id = 1;
Question: Under which categories is Yelp_Business no. 1?
SQL: SELECT categories.category_name FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id WHERE business_categories.business_id = 1
Database: public_review_platform
Note: are still running refers to active = 'true'; the category of "Food" refers to category_name = 'Food';
Question: Among the Yelp_Businesses which are still running, how many of them fall under the category of "Food"?
SQL: SELECT count(business.business_id) FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id INNER JOIN tips ON business.business_id = tips.business_id WHERE categories.category_name LIKE 'Food' AND business.active LIKE 'TRUE'
Database: public_review_platform
Note: in Anthem refers to city = 'Anthem'; the category of "Food" refers to category_name = 'Food';
Question: How many Yelp_Business in Anthem are under the category of "Food"?
SQL: SELECT count(business.business_id) FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id WHERE categories.category_name LIKE 'Food' AND business.city LIKE 'Anthem'
Database: public_review_platform
Note: under the category "Food" refers to category_name = 'Food';
Question: Please list the business ID of the Yelp_Business with the highest Elitestar rating under the category "Food".
SQL: SELECT business_categories.business_id FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id WHERE categories.category_name LIKE 'Food' ORDER BY business.stars DESC LIMIT 1
Database: public_review_platform
Note: under the category of "Food" refers to category_name = 'Food'; are good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true';
Question: How many Yelp_Business under the category of "Food" are good for kids?
SQL: SELECT count(business.stars) FROM categories INNER JOIN business_categories ON categories.category_id = business_categories.category_id INNER JOIN business ON business_categories.business_id = business.business_id INNER JOIN business_attributes ON business.business_id = business_attributes.business_id INNER JOIN attributes ON business_attributes.attribute_id = attributes.attribute_id WHERE categories.category_name LIKE 'Food' AND attributes.attribute_name LIKE 'Good for Kids' AND business_attributes.attribute_value LIKE 'TRUE'
Database: public_review_platform
Note: in Arizona refers to state = 'AZ'; user no. 3 refers to user_id = 3;
Question: How many Yelp_Business in Arizona has user no. 3 reviewed?
SQL: SELECT count(business.business_id) FROM reviews INNER JOIN business ON reviews.business_id = business.business_id WHERE business.state LIKE 'AZ' AND reviews.user_id = 3