Chinastark/bird_dataset huggingface dataset:
Database: public_review_platform
Question: Is the Yelp business No. 14033 good for supper?
Evidence: business no. 14033 refers to business_id = 14033; good for supper refers to attribute_name = 'good_for_dinner'
SQL: 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
Database: public_review_platform
Question: How long is the Yelp business No. 15098 opened on Monday?
Evidence: Yelp business No. 15098 refers to business_id = '15098'; Monday refers to day_of_week = 'Monday'
SQL: 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
Database: public_review_platform
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.
Evidence: located in "Phoenix" refers to city = 'Phoenix'; received a "5" star review refers to review_stars = '5'; "uber" number of votes for funny refers to review_votes_funny = 'Uber'
SQL: 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'
Database: public_review_platform
Question: Which city is the business that got a "medium" length tip with "3" likes located in?
Evidence: medium length tip refers to tip_length = 'Medium';
SQL: 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
Database: public_review_platform
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?
Evidence: in "2010" refers to user_yelping_since_year = '2010'; average of "4.5" stars review refers to user_average_stars = '4.5'; uber number of fans refers to user_average_stars = '4.5'; "funny" compliments refers to compliment_type = 'funny'
SQL: 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'
Database: public_review_platform
Question: How many "cool" type compliments does user No. 41717 get?
Evidence: "cool" type compliments refers to compliment_type = 'cool'; user No. 41717 refers to user_id = 41717
SQL: 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
Database: public_review_platform
Question: Does Yelp business No."11825" have a "parking lot"?
Evidence: business No."11825" refers to business_id = '12476'; have a "parking lot" refers to attribute_value = 'parking_lot'
SQL: 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'
Database: public_review_platform
Question: Is the payment in mastercard possible for the Yelp business No."12476"?
Evidence: Yelp business No."12476" refers to business_id = '12476'; payment in mastercard refers to attribute_value = 'payment_types_mastercard'
SQL: 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'
Database: public_review_platform
Question: What is the percentage for the Yelp businesses in "Pets" category of all businesses?
Evidence: businesses in "Pets" category refers to category_name = 'Pets'; percentage refers to DIVIDE(COUNT(category_name = 'Pets'), COUNT(business_id)) * 100%
SQL: 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
Database: public_review_platform
Question: How many times is the number of "Women's Clothing" Yelp businesses to "Men's Clothing"?
Evidence: "Women's Clothing" Yelp businesses refers to  category_name = 'Women''s Clothing'; "Men's Clothing" refers to category_name = 'Men''s Clothing'; times refers to DIVIDE(COUNT(category_name = 'Women''s Clothing'), COUNT(category_name = 'Men''s Clothing'))
SQL: 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
Database: public_review_platform
Question: Write down the ID, active status and city of the business which are in CA state.
Evidence: the ID refers to business_id; active status refers to active; active = 'true' means the business is still running; active = 'false' means the business is closed or not running now
SQL: SELECT business_id, active, city FROM Business WHERE state = 'CA' AND active = 'true'
Database: public_review_platform
Question: Calculate the percentage of running business among all business.
Evidence: running business refers to active = 'true'; percentage refers to DIVIDE(COUNT(active = 'true'), COUNT(business_id)) * 100%
SQL: SELECT CAST(SUM(CASE WHEN active = 'true' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(business_id) FROM Business
Database: public_review_platform
Question: Among all attribute names, list down the ID and attribute name which start with "music".
Evidence: attribute name which start with "music" refers to attribute_name LIKE 'music%'
SQL: SELECT attribute_id, attribute_name FROM Attributes WHERE attribute_name LIKE 'music%'
Database: public_review_platform
Question: Between 2006 and 2007, which year ID had the greater number in elite user?
Evidence: 2006 and 2007 refers to BETWEEN 2006 AND 2007; greater number in elite user refers to count(user_id)
SQL: SELECT year_id FROM Elite WHERE year_id IN (2006, 2007) GROUP BY year_id ORDER BY COUNT(user_id) DESC LIMIT 1
Database: public_review_platform
Question: Based on all user compliments, find the percentage of low number of compliments on all compliments ID.
Evidence: low number of compliments refers to number_of_compliments = 'Low'; percentage refers to DIVIDE(COUNT(number_of_compliments = 'Low'), COUNT(user_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN number_of_compliments = 'Low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(user_id) FROM Users_compliments
Database: public_review_platform
Question: List down the business ID and user ID who got uber for cool votes.
Evidence: got uber for cool votes refers to review_votes_cool = 'Uber'
SQL: SELECT business_id, user_id FROM Reviews WHERE review_votes_cool = 'Uber'
Database: public_review_platform
Question: Write the user ID, business ID and tips length of who started using Yelp since 2004 and had high followers.
Evidence: started using Yelp since 2004 refers to user_yelping_since_year = '2004'; had high followers refers to user_fans = 'High'
SQL: 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'
Database: public_review_platform
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.
Evidence: review votes of funny refers to review_votes_funny = 'Uber'; cool hit uber refers to review_votes_cool = 'Uber'; user year of joining Yelp refers to user_yelping_since_year
SQL: 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'
Database: public_review_platform
Question: Under the attribute name of "music_playlist", describe the attribute ID, business ID, city and inactive status.
Evidence: active status refers to active; active = 'true' means the business is still running; active = 'false' means the business is inactive or not running now
SQL: 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'
Database: public_review_platform
Question: Calculate the percentage of business with attribute name of "Accepts Credit Cards".
Evidence: percentage refers to DIVIDE(COUNT(attribute_name = 'Accepts Credit Cards'), COUNT(business_id))*100%
SQL: 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
Database: public_review_platform
Question: Among the stopped businesses in San Tan Valley city, list down the user ID and review length of who had great experience.
Evidence: stop businesses refers to active = 'false'; great experience refers to review_stars = 5


SQL: 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
Database: public_review_platform
Question: Mention the user average star, elite year and the compliment type of user ID 6027 whereby number of compliments reach uber.
Evidence: number of compliments reach uber refers to number_of_compliments = 'Uber'; elite year refers to year_id; user average star refers to user_average_stars
SQL: 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 = T5.year_id WHERE T3.number_of_compliments = 'Uber' AND T3.user_id = 6027
Database: public_review_platform
Question: Under the category name of "Coffee & Tea", mention any 5 business ID , their state and city.
SQL: 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
Database: public_review_platform
Question: Describe category name which had above 10% in comparing with all business and categories.
Evidence: above 10% refers to DIVIDE(COUNT(Business_Categories.business_id = category_id), COUNT(category_id)) * 100% > 10%
SQL: 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
Database: public_review_platform
Question: For the business with great experience existed in Sun Lakes city, provide the user ID who gave review on it and user followers.
Evidence: with great experience refers to stars = 5
SQL: 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
Database: public_review_platform
Question: Compare the number of business between the category of "Men's Clothing" and "Women's Clothing".
Evidence: category of "Men's Clothing" refers to category_name = 'Men''s Clothing'; "Women's Clothing" refers to category_name = 'Women''s Clothing'
SQL: 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
Database: public_review_platform
Question: Among highest quality user of under ID 100, mention compliment type which got highest compliment number and user's followers.
Evidence: highest quality user refers to number_of_compliments = 'Uber'; user of under ID 100 refers to user_id < 100 ;
SQL: 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
Database: public_review_platform
Question: List all the businesses that closed at 8PM.
Evidence: closed at 8PM refers to closing_time = '8PM';
SQL: SELECT DISTINCT business_id FROM Business_Hours WHERE closing_time = '8PM'
Database: public_review_platform
Question: How many 2 stars rated business located in Phoenix, Arizona?
Evidence: located in Phoenix refers to city = 'Phoenix'; Arizona refers to state = 'AZ'
SQL: SELECT COUNT(business_id) FROM Business WHERE city = 'Phoenix' AND state = 'AZ' AND stars = 2
Database: public_review_platform
Question: How many businesses in Tempe are rated as 'Wonderful experience?
Evidence: in Tempe refers to city = 'Tempe'; rated as 'Wonderful experience refers to stars > 3
SQL: SELECT COUNT(business_id) FROM Business WHERE city = 'Phoenix' AND stars > 3
Database: public_review_platform
Question: List all the users with average star less than 3 stars in 2012
Evidence: average star less than 3 stars refers to user_average_stars < 3; in 2012 refers to user_yelping_since_year = 2012
SQL: SELECT user_id FROM Users WHERE user_yelping_since_year = 2012 AND user_average_stars < 3
Database: public_review_platform
Question: Find the percentage of 5 stars rated business.
Evidence: percentage refers to DIVIDE(COUNT(stars = 5), COUNT(business_id)) * 100%
SQL: SELECT CAST(SUM(CASE WHEN stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(stars) FROM Business
Database: public_review_platform
Question: Calculate difference between business that have the highest number of reviews and business that have the lowest number of reviews.
Evidence: highest number of reviews refers to SUBTRACT(MAX(COUNT(business_id), MIN(COUNT(business_id))))
SQL: 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
Database: public_review_platform
Question: List all the tires businesses that are opened everyday.
Evidence: tires businesses refers to category_name = 'Tires'; opened everyday refers to COUNT(distinct opening_time) = 7;
SQL: 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 COUNT(day_id) = 7
Database: public_review_platform
Question: Which users become an elite in 2012?
Evidence: in 2012 refers to actual_year = 2012;
SQL: 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
Database: public_review_platform
Question: List the business ID of shopping business that have 4 stars ratings.
Evidence: shopping business refers to category_name = 'Shopping'; 4 stars ratings refers to stars = 4
SQL: 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
Database: public_review_platform
Question: How many business have low check-in on Sunday at 10AM?
Evidence: on Sunday refers to day_of_week = 'Sunday'; low check-in at 10AM refers to label_time_10 = 'Low'
SQL: 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'
Database: public_review_platform
Question: How many businesses in Glendale are reviewed by user with the ID of 20241?
Evidence: in Glendale refers to city = 'Glendale'
SQL: 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
Database: public_review_platform
Question: State the locations of all Pet Services business.
Evidence: location refers to city; Pet Services business refers to category_name = 'Pet Services'
SQL: 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'
Database: public_review_platform
Question: How many photos type compliment given from users with high cool votes?
Evidence: photos type compliment refers to compliment_type = 'photos'; high cool votes refers to review_votes_cool = 'High'
SQL: 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'
Database: public_review_platform
Question: How many closed businesses that have more than 10 attributes?
Evidence: closed refers to active = 'false'; more than 10 attributes refers to count(attribute_id) > 10
SQL: 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 )
Database: public_review_platform
Question: List the business located in Mesa that have alcohol attribute.
Evidence: in Mesa refers to city = 'Mesa'; alcohol attribute refers to attribute_name = 'Alcohol'
SQL: 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'
Database: public_review_platform
Question: Based on business in Phoenix, calculate the percentage of business with low funny votes.
Evidence: in Chandelier refers to city = 'Chandelier'; percentage = divide(count(business_id where review_votes_funny = 'Low'), count(business_id)); business with low funny votes refers to review_votes_funny = 'Low'
SQL: 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'
Database: public_review_platform
Question: What is the ratio between business in shopping category and business in pets category?
Evidence: ratio = divide(count(business_id where category_name = 'Shopping'), count(business_id where category_name = 'Pets'))
SQL: 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
Database: public_review_platform
Question: How many businesses are registered in the database under 'Banks & Credit Unions' category?
Evidence: category refers to category_name
SQL: 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'
Database: public_review_platform
Question: How many active businesses from Casa Grande are registered in the database?
Evidence: active business refers to active = 'true'; Casa Grande refers to city = 'Casa Grande'
SQL: SELECT COUNT(business_id) FROM Business WHERE active = 'true' AND city = 'Casa Grande'
Database: public_review_platform
Question: What time does the business with ID no.12 open on Monday?
Evidence: open time refers to opening_time; on Monday refers to day_of_week = 'Monday'; business with ID no. refers to business_id 


SQL: 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'
Database: public_review_platform
Question: How many businesses that are registered in the database can be attributed to 'Good for Kids'?
Evidence: can be attributed to 'Good for Kids' refers to attribute_name = 'Good for Kids' and attribute_value = 'true'
SQL: 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'
Database: public_review_platform
Question: Identify the most popular and appealing active business in Gilbert based on users' reviews.
Evidence: most popular and appealing refers to review_count = 'High' and max(stars); active business refers to active = 'true'; in Gilbert refers to city = 'Gilbert'
SQL: SELECT business_id FROM Business WHERE city = 'Gilbert' AND active = 'true' AND review_count = 'High' ORDER BY stars DESC LIMIT 1
Database: public_review_platform
Question: Find the 5-star business in Ahwatukee, AZ and identify it's business category.
Evidence: 5-star refers to stars = 5; in Ahwatukee refers to city = 'Ahwatukee'; business category refers to category_name
SQL: 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
Database: public_review_platform
Question: Among all closed businesses in Avondale, AZ what percent have obtained a 'wonderful experience' rating of the business.
Evidence: closed business refers to active = 'false'; in Avondale refers to city = 'Avondale'; 'wonderful experience' rating refers to stars > 3; percentage = divide(count(business_id where stars > 3), count(business_id))*100%
SQL: 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'
Database: public_review_platform
Question: Identify the user who has been yelping since 2004. Is he or she an Yelp Elite member?
Evidence: has been yelping since 2004 refers to user_yelping_since_year = 2004
SQL: 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
Database: public_review_platform
Question: Identify the percent of long reviews among all 5-star reviews given to businesses by the Yelp users.
Evidence: percentage = divide(count(business_id where review_length = 'Long' and review_stars = 5), count(business_id)) * 100%; long reviews refers to review_length = 'Long'; 5-star review refers to review_stars = 5
SQL: 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
Database: public_review_platform
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.
Evidence: average ratings of at least 4 refers to user_average_stars > = 4; no fans or followers refers to user_fans = 'None'; percentage = divide(count(user_id where user_average_stars > = 4 and user_fans = 'None'), sum(user_id where user_average_stars > = 4))*100%
SQL: 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
Database: public_review_platform
Question: How many short tips were left for the business with ID no.2?
Evidence: short tip refers to tip_length = 'Short'; business category refers to category_name
SQL: SELECT COUNT(business_id) FROM Tips WHERE business_id = 2 AND tip_length = 'Short'