db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
college_completion
List the all the institutes from the state with the most number of American Indian in 2007.
institutes refers to chronname; American Indian refers to race = 'Ai'; most number of American Indian refers to MAX(COUNT(race = 'Ai')); in 2007 refers to year = '2007';
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2007 AND T2.race = 'Ai' GROUP BY T1.chronname ORDER BY COUNT(T1.chronname) DESC LIMIT 1
college_completion
What is the number of female graduates between 2011 to 2013 from the state where 'Gateway Community College' is located?
female refers to gender = 'F'; graduates refers to grad_cohort; between 2011 to 2013 refers to year BETWEEN 2011 AND 2013; Gateway Community College refers to chronname = 'Gateway Community College';
SELECT COUNT(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year BETWEEN 2011 AND 2013 AND T1.chronname = 'Gateway Community College' AND T2.gender = 'F'
college_completion
List all the public institutes from the state with the least number of graduate cohort in 2013.
public refers to control = 'Public'; institutes refers to chronname; least number of graduate cohort refers to MIN(grad_cohort); in 2013 refers to year = 2013;
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2013 AND T1.control = 'Public' ORDER BY T2.grad_cohort LIMIT 1
college_completion
What is the number of female graduate for all students cohort from Oakwood University in 2013?
female refers to gender = 'F'; graduates refers to grad_cohort; Oakwood University refers to chronname = 'Oakwood University'; in 2013 refers to year = 2013; all sutdents refer to rae = 'X';
SELECT COUNT(*) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T2.gender = 'F' AND T2.race = 'X' AND T1.chronname = 'Oakwood University'
college_completion
In 2012, how many Asian female graduates were seeking another type of degree or certificate at the 4-year institution at University of Alaska at Anchorage?
In 2012 refers to year = 2012; Asian refers to race = 'A'; female refers to gender = 'F'; graduates refers to grad_cohort; seeking another type of degree or certificate at a 4-year institution refers to cohort = '4y other'; University of Alaska at Anchorage refers to chronname = 'University of Alaska at Anchorage';
SELECT COUNT(*) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.gender = 'F' AND T2.race = 'A' AND T1.chronname = 'University of Alaska at Anchorage' AND T2.cohort = '4y other'
college_completion
From which institute is harder to graduate for a bachelor, Amridge University or Auburn University?
institute refers to chronname; harder to graduate for a bachelor refers to MIN(grad_100_value); Amridge University refers to chronname = 'Amridge University'; Auburn University refers to chronname = 'Auburn University';
SELECT chronname FROM institution_details WHERE chronname IN ('Amridge University', 'Auburn University') ORDER BY grad_100_value LIMIT 1
college_completion
How many institutes are private and not-for profit?
private and not for profit refers to control = 'Private not-for-profit';
SELECT COUNT(*) FROM institution_details WHERE control = 'Private not-for-profit'
college_completion
How many students that graduated from Lincoln College in 2011 belong to the cohort type of Bachelor's/equivalent seeking cohort at 4-year institutions?
Lincoln College refers to chronname = 'Lincoln College'; in 2011 refers to year = 2011; Bachelor's/equivalent seeking cohort at 4-year institutions refers to cohort = '4y bach';
SELECT COUNT(T1.unitid) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Lincoln College' AND T2.year = 2011 AND T2.cohort = '4y bach'
college_completion
How many students graduated from Central Alabama Community College in 2011 in total?
Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2011 refers to year = 2011;
SELECT T2.grad_cohort FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011
college_completion
Which institute has the highest percentage of male White students graduating in 2011 within 150 percent of normal/expected time?
male refers to gender = 'M'; white refers to race = 'w'; in 2011 refers to year = 2011; graduating within 150 percent of normal/expected time refers to grad_150;
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' AND T2.grad_150 = ( SELECT MAX(T2.grad_150) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' )
college_completion
Give the web site address for "Swarthmore College".
website address refers to site; Swarthmore College refers to chronname = 'Swarthmore College';
SELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Swarthmore College' THEN site ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL
college_completion
Which state is "Mercer University" located in?
Mercer University refers to chronname = 'Mercer University';
SELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Mercer University' THEN state ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL
college_completion
Which city is "Rensselaer Polytechnic Institute" located in?
Rensselaer Polytechnic Institute refers to chronname = 'Rensselaer Polytechnic Institute';
SELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Rensselaer Polytechnic Institute' THEN city ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL
college_completion
Tell the abbreviation for "Delaware" state.
abbreviation for state refers to state_abbr;
SELECT T FROM ( SELECT DISTINCT CASE WHEN state = 'Delaware' THEN state_abbr ELSE NULL END AS T FROM state_sector_grads ) WHERE T IS NOT NULL
college_completion
How many 2-year public schools are there in "California"?
2-year refers to level = '2-year'; public refers to control = 'public'; California refers to state = 'California';
SELECT COUNT(stateid) FROM state_sector_details WHERE state = 'California' AND level = '2-year' AND control = 'Public'
college_completion
Give the post name of "Idaho" state.
post name refers to state_post;
SELECT T FROM ( SELECT DISTINCT CASE WHEN state = 'Idaho' THEN state_post ELSE NULL END AS T FROM state_sector_details ) WHERE T IS NOT NULL
college_completion
Tell the name of school in "NJ" that could get the bachelor's degree with highest students number.
name of school refers to chronname; NJ refers to state_abbr = 'NJ'; bachelor's degree refers to level = '4-year'; highest students number refers to MAX(student_count);
SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'NJ' AND T1.level = '4-year' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'NJ' AND T1.level = '4-year' )
college_completion
Give the web site address for the school in "PA" state with the highest latitude.
web site address refers to site; PA refers to state_abbr = 'PA'; highest latitude refers to MAX(lat_y);
SELECT DISTINCT T1.site FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' AND T1.lat_y = ( SELECT MAX(T1.lat_y) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' )
college_completion
Tell the number of 4-year public schools in UT whose graduation rate exceeds the average for the state.
4-year refers to level = '4-year'; public refers to control = 'Public'; UT refers to state_abbr = 'UT'; graduation rate exceeds the average for the state refers to awards_per_value > awards_per_state_value;
SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'UT' AND T1.level = '4-year' AND T1.control = 'Public' AND T1.awards_per_value > T1.awards_per_state_value
college_completion
How many 2-year private nonprofit schools in "CT" whose graduation rate falls below the average for the state?
2-year refers to level = '2-year'; private nonprofit refers to control = 'Private not-for-profit'; CT refers to state_abbr = 'CT'; graduation rate falls below the average for the state refers to awards_per_value < awards_per_natl_value;
SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'CT' AND T2.level = '2-year' AND T1.control = 'Private not-for-profit' AND T1.awards_per_value < T1.awards_per_natl_value
college_completion
Give the name of the 4-year public school in "ID" with the lowest graduation 100 value.
name of the school refers to chronname; 4-year refers to level = '4-year'; public refers to control = 'Public'; ID refers to state_abbr = 'ID'; lowest graduation 100 value refers to MIN(grad_100_value);
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'ID' AND T1.level = '4-year' AND T1.control = 'Public' GROUP BY T1.chronname ORDER BY SUM(T1.grad_100_value) ASC LIMIT 1
college_completion
Give the cohort name for the school with biggest cohort size.
biggest cohort size refers to MAX(cohort_size); cohort = '4y bach' means bachelor's or equivalent-seeking cohort at 4-year institutions; cohort = '4y other' means students seeking another type of degree or certificate at a 4-year institution; cohort = '2y all' means degree-seeking students at 2-year institutions;
SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.cohort_size = ( SELECT MAX(T1.cohort_size) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid )
college_completion
Tell the number of 4-year private not-for-profit schools in the home state of "Brevard Community College".
4-year refers to level = '4-year'; private not-for-profit refers to control = 'Private not-for-profit'; Brevard Community College refers to chronname = 'Brevard Community College';
SELECT COUNT(T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T2.level = '4-year' AND T2.control = 'Private not-for-profit' AND T1.chronname = 'Brevard Community College'
college_completion
For the state which has the 113 2-year public schools, tell the number of graduated Asian students who seeks another type of degree or certificate at a 2-year institution in 2013.
schools_count = 113; 2-year refers to level = '2-year'; public refers to control = 'public'; Asian refers to race = 'A'; seeks another type of degree or certificate at a 2-year institution refers to cohort = '2y all'; in 2013 refers to year = 2013;
SELECT COUNT(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.level = '2-year' AND T2.control = 'Public' AND T2.gender = 'B' AND T2.race = 'A' AND T2.cohort = '2y all' AND T1.schools_count = 113
college_completion
Give the state and name of institutions in year of data release from 2010 to 2012 with black students.
name of institutions refers to chronname; year of data release refers to year; from '2010' to '2012' refers to year BETWEEN 2010 AND 2012; Black refers to race = 'B';
SELECT DISTINCT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'B' AND T2.year BETWEEN 2010 AND 2012
college_completion
List down the states in 2011 with a national sector average of 20 and below.
in 2011 refers to year = '2011'; national sector average of 20 and below refers to awards_per_natl_value < 20;
SELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.year = 2011 AND T1.awards_per_natl_value <= 20
college_completion
Among the race of all students, what is the control of institution and level of institution with highest number of students?
highest number of students refers to student_count; all students refer to race = 'X'.
SELECT DISTINCT T1.control, T1.level FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' )
college_completion
Among the states with a public school count of 20 and below, list their race.
public refers to control = 'Public'; school_count < 20;
SELECT DISTINCT T2.race FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count <= 20 AND T1.control = 'Public'
college_completion
List the basic of the institution in 2012 with race of all male students.
in 2012 refers to year = '2012'; male refers to gender = 'M'; all students refer to race = 'X'.
SELECT DISTINCT T1.basic, T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2012 AND T2.gender = 'M' AND t2.race = 'X'
college_completion
In Alaska with school count of 1 from year 2011 to 2013, how many of the students are white?
Alaska refers to state = 'Alaska'; from year 2011 to 2013 refers to year BETWEEN '2011' AND '2013'; white refers to race = 'W';
SELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count = 1 AND T2.year BETWEEN 2011 AND 2013 AND T2.race = 'W' AND T1.state = 'Alaska'
college_completion
List the site of institution within the student count of 500 to 1000 that has the recent year of data release.
recent year of data release refers to newest year;
SELECT DISTINCT T1.site FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.student_count BETWEEN 500 AND 1000 AND T2.year = ( SELECT MAX(T2.year) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid )
college_completion
What is the state name of male graduate in 2011 from a private for profit institution with black students?
male refers to gender = 'M'; in 2011 refers to year = '2011'; private for profit refers to control = 'Private for-profit'; black refers to race = 'B';
SELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.gender = 'M' AND T2.race = 'B' AND T1.control = 'Private for-profit' AND T2.year = 2011
college_completion
In female students in year 2012, how many of them from a state with number of schools ranges from 10 to 20?
female refers to gender = 'F'; number of schools refers to schools_count; schools_count BETWEEN 10 AND 20;
SELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.gender = 'F' AND schools_count BETWEEN 10 AND 20 AND T2.year = 2012
college_completion
List the race of institutions in Alabama with number of students greater than the 90% of average number of students of all institutions?
Alabama refers to state = 'Alabama'; number of students greater than the 90% of average = MULTIPLY(AVG(student_count), 90%) < student_count;
SELECT DISTINCT T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.student_count > ( SELECT AVG(T1.student_count) * 0.9 FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' ) AND T1.state = 'Alabama'
college_completion
In year 2010 at schools located in Hawaii, what is the percentage of schools offers an associate's degree?
Hawaii refers to state = 'Hawaii'; associate's degree refers to level = '2-year'; percentage = MULTIPLY(DIVIDE(SUM(level = '2-year' ), count(level)), 1.0);
SELECT CAST(SUM(CASE WHEN T2.level = '2-year' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.level) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.state = 'Hawaii' AND T2.year = 2010
college_completion
In the state of Connecticut, what is the name of the instution with the highest percent rank for freshman retention percentage within the sector?
name of the institution refers to chronname;  highest percent rank for freshman retention percentage within the sector refers to MAX(retain_percentile);
SELECT chronname FROM institution_details WHERE state = 'Connecticut' AND retain_percentile = ( SELECT MAX(retain_percentile) FROM institution_details WHERE state = 'Connecticut' )
college_completion
What is the website address of the institution with the highest number of White degree-seeking students at 2-year institutions in 2008?
website address refers to site; White refers to race = 'W'; degree-seeking students at 2-year institutions refers to cohort = '2y all'; in 2008 refers to year = '2008';
SELECT T1.site FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'W' AND T2.cohort = '2y all' AND T2.year = 2008 ORDER BY T2.grad_cohort DESC LIMIT 1
college_completion
What is the name of the school with the highest number of first-time, full-time, degree-seeking female students in the cohort being tracked, minus any exclusions who were seeking another type of degree or certificate at a 4-year institution?
name of the school refers to chronname; highest number of first-time, full-time, degree-seeking female students in the cohort being tracked, minus any exclusions refers to MAX(grad_cohort WHERE gender = 'F'); seeking another type of degree or certificate at a 4-year institution refers to cohort = '4y other';
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.gender = 'F' AND T2.cohort = '4y other' ORDER BY T2.grad_cohort DESC LIMIT 1
college_completion
Among the Ivy League Schools in 2013, which schools have the highest number of Black students who graduated within 150 percent of normal/expected time who were seeking a bachelor's/equivalent cohort at 4-year institutions?
Ivy League Schools refers to chronname = 'Brown University' or chronname = 'Columbia University' or chronname = 'Cornell University' or chronname = 'Dartmouth College' or chronname = 'Harvard University' or chronname = 'Princeton University' or chronname = 'University of Pennsylvania' or chronname = 'Yale University'; in 2013 refers to year = '2013'; highest number of Black students who graduated within 150 percent of normal/expected time refers to MAX(grad_150 WHERE race = 'B'); seeking a bachelor's/equivalent cohort at 4-year institutions refers to cohort = '4y bach';
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) AND T2.year = 2013 AND T2.race = 'B' AND T2.cohort = '4y bach' ORDER BY T2.grad_cohort DESC LIMIT 1
college_completion
What is the name of the school with the highest difference in the average completion rate for the national in which it belongs? Indicate the state appropriations to higher education in fiscal year 2011 per resident to which the school belongs.
name of the school refers to chronname; highest difference in the average completion rate for the national in which it belongs = MAX(SUBTRACT(awards_per_value, awards_per_natl_value)); state appropriations to higher education in fiscal year 2011 per resident to which the school belongs refers to state_appr_value;
SELECT T1.chronname, T2.state_appr_value FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state ORDER BY T1.awards_per_value - T2.awards_per_natl_value DESC LIMIT 1
public_review_platform
How many Yelp businesses are there in 'AZ' with less than "3" stars?
AZ refers to state = 'AZ'; stars < 3;
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars < 3
public_review_platform
What is the quantity of the closed or not running Yelp Businesses in 'AZ'?
closed or not running refers to active = 'False'; AZ refers to state = 'AZ';
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'False'
public_review_platform
How many long reviews does user No. 36139 give for the Yelp businesses?
long reviews refers to review_length = 'long'; user No. refers to user_id;
SELECT COUNT(review_length) FROM Reviews WHERE user_id = 36139 AND review_length LIKE 'long'
public_review_platform
How many users have "uber" number of fans?
uber number of fans refers to user_fans = 'uber';
SELECT COUNT(user_id) FROM Users WHERE user_fans LIKE 'Uber'
public_review_platform
How many Yelp businesses are opened 24 hours?
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true';
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 LIKE 'Open 24 Hours' AND T2.attribute_value LIKE 'TRUE'
public_review_platform
How many "bars" are there in the Yelp business?
bars refers to category_name = 'Bars';
SELECT COUNT(T1.category_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.category_name LIKE 'Bars'
public_review_platform
How many more "buffets" than "gyms" in Yelp business?
buffets refers to category_name = 'Buffets'; gyms refers to category_name = 'Gyms'; difference = SUBTRACT(SUM(category_name = 'Buffets'), SUM(category_name = 'Gyms'));
SELECT SUM(CASE WHEN T1.category_name LIKE 'Buffets' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.category_name LIKE 'Gyms' THEN 1 ELSE 0 END) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id
public_review_platform
What business category is the Yelp business which got the most 5 star reviews in?
business category refers to category_name; most 5 star reviews refers to MAX(COUNT(category_name WHERE star_reviews = 5));
SELECT T1.category_name 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 T4.review_stars = 5 GROUP BY T1.category_name ORDER BY COUNT(T1.category_name) DESC LIMIT 1
public_review_platform
In which year did the user who gave the most number of "5" star reviews join the Yelp?
year the user join the Yelp refers to user_yelping_since_year; star reviews refers to review_stars;
SELECT T2.user_yelping_since_year FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.review_stars = 5 GROUP BY T2.user_yelping_since_year ORDER BY COUNT(T1.review_stars) DESC LIMIT 1
public_review_platform
For the user who gave the most number of long reviews, what is his/her averge ratings of all review?
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); average ratings = AVG(review_stars);
SELECT CAST(SUM(T1.review_stars) AS REAL) / COUNT(T1.review_stars) FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.review_length LIKE 'Long' GROUP BY T1.user_id ORDER BY COUNT(T1.review_length) DESC LIMIT 1
public_review_platform
User No. 70271 only has given one tip to the Yelp business, which category was that business belonged to?
user No. refers to user_id; short tip refers to tip_length = 'short'; category refers to category_name;
SELECT T4.category_name FROM Tips 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.user_id = 70271
public_review_platform
There was only one tip that user No. 69722 gave to the Yelp business, what was the ratings of that business?
short tip refers to tip_lenghth = 'short'; user No. refers to user_id; ratings refers to stars; stars = 5 means great experience; stars = 4 means good experience; stars = 3 means average experience; stars = 2 means bad experience; stars = 1 means terrible experience;
SELECT T2.stars FROM Tips AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.user_id = 69722
public_review_platform
Give the percentage of "Automotive" businesses among all the Yelp businesses.
automotive businesses refers to category_name = 'Automotive'; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Automotive'), COUNT(business_id)), 1.0);
SELECT CAST(SUM(CASE WHEN T2.category_name LIKE 'Automotive' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) AS "percentage" FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id
public_review_platform
What percentage more for the "Women's Clothing" Yelp businesses to "Men's Clothing"?
Women's clothing refers to category_name = 'Women''s Clothing'; Men's clothing refers to category_name = 'Men''s Clothing'; percentage more = MULTIPLY(DIVIDE(SUBTRACT(SUM(category_name = 'Women''s Clothing'), SUM(category_name = 'Men''s Clothing')), COUNT(business_id)), 1.0);
SELECT CAST(SUM(CASE WHEN T2.category_name LIKE 'Women''s Clothing' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) - CAST(SUM(CASE WHEN T2.category_name LIKE 'Men''s Clothing' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) AS "more percentage" FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id
public_review_platform
Give the number of users who joined Yelp since "2004".
joined yelp since 2004 refers to user_yelping_since_year = 2004;
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2004
public_review_platform
How many users who have joined Yelp since "2005" but have no fans?
joined Yelp since 2005 refers to user_yelping_since_year = 2005; no fans refers to user_fans = 'None';
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2005 AND user_fans LIKE 'None'
public_review_platform
State the number of actively running Yelp businesses in "Tolleson".
actively running refers to active = 'TRUE'; Tolleson refers to city = 'Tolleson';
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Tolleson' AND active LIKE 'TRUE'
public_review_platform
What is the number of reviews from user No. "21679"?
user No. refers to user_id;
SELECT COUNT(review_length) FROM Reviews WHERE user_id = 21679
public_review_platform
How many "5" star reviews does the Yelp business No. "10682" get?
5 star reviews refers to review_stars = 5; business No. refers to business_id;
SELECT COUNT(review_length) FROM Reviews WHERE business_id = 10682 AND review_stars = 5
public_review_platform
For the only Yelp business in "Yuma" city, how many "medium" reviews did it get?
medium reviews refers to review_length = 'Medium';
SELECT COUNT(T2.review_length) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Yuma' AND T2.review_length LIKE 'Medium'
public_review_platform
Does Yelp business No."4960" have TV?
business No. refers to business_id; have TV refers to attribute_name = 'Has TV';
SELECT DISTINCT CASE WHEN T1.attribute_name LIKE 'Has TV' THEN 'yes' ELSE 'no' END FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.business_id = 4960
public_review_platform
Give the number of "dogs allowed" Yelp businesses.
number of Yelp businesses refers to business_id; dogs allowed refers to attribute_name = 'Dogs Allowed' AND attribute_value = 'true';
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 LIKE 'Dogs Allowed' AND T2.attribute_value LIKE 'TRUE'
public_review_platform
Tell the number of "hair removal" Yelp businesses.
hair removal refers to category_name = 'Hair Removal';
SELECT COUNT(T1.category_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.category_name LIKE 'Hair Removal'
public_review_platform
How many more "Chinese" than "Filipino" Yelp businesses?
Chinese refers to category_name = 'Chinese'; Filipino refers to category_name = 'Filipino'; how many more = SUBTRACT(SUM(category_name = 'Chinese'), SUM(category_name = 'Filipino'));
SELECT SUM(CASE WHEN T1.category_name LIKE 'Chinese' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.category_name LIKE 'Filipino' THEN 1 ELSE 0 END) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id
public_review_platform
User No."63469" has got "1" like for a tip to the Yelp business, which city is that business located in?
user No. refers to user_id;
SELECT T1.city FROM Business AS T1 INNER JOIN Tips AS T2 ON T1.business_id = T2.business_id WHERE T2.likes = 1 AND T2.user_id = 63469
public_review_platform
How many types of music does Yelp business No."1141" have?
types of music refers to attribute_name LIKE '%music%' WHERE attribute_value = 'true'; business No. refers to business_id;
SELECT COUNT(T1.attribute_name) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T2.business_id = 1141
public_review_platform
How many "cute" type of compliments does user No. 57400 get?
type of compliments refers to compliment_type; user No. refers to user_id;
SELECT COUNT(T1.compliment_type) FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.compliment_type LIKE 'cute' AND T2.user_id = 57400
public_review_platform
Who has got the most number of "funny" type of compliments? Give the user ID.
type of compliments refers to compliment_type; most number of funny type of compliments refers to MAX(COUNT(number of compliments = 'high' WHERE compliment_type = 'funny'));
SELECT user_id FROM Users_Compliments WHERE compliment_id IN ( SELECT compliment_id FROM Compliments WHERE compliment_type LIKE 'funny' )
public_review_platform
List the names of business in AZ with a rating of 5.
AZ refers to state = 'AZ'; rating refers to stars;
SELECT business_id FROM Business WHERE state LIKE 'AZ' AND stars = 5
public_review_platform
How many active businesses of city are underrated?
active businesses refers to active = 'true'; underrated refers to review_count = 'Low';
SELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'Low' AND active LIKE 'TRUE'
public_review_platform
How many user ids from 1 to 20 have no fan users and have low ratings?
user_id BETWEEN 1 AND 20; no fan users refers to user_fans = 'None'; low ratings refers to user_review_count = 'Low';
SELECT COUNT(user_id) FROM Users WHERE user_id BETWEEN 1 AND 20 AND user_fans LIKE 'None' AND user_review_count LIKE 'Low'
public_review_platform
Indicate the opening hours of businesses are with category in fashion.
opening hours refers to opening_time; category refers to category_name;
SELECT T4.opening_time 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 LIKE 'Fashion'
public_review_platform
How many businesses operating in the shopping business have opening times before 8AM?
shopping business refers to category_name = 'Shopping'; opening time before 8AM refers to opening_time < '8AM';
SELECT COUNT(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 Business_Hours AS T4 ON T3.business_id = T4.business_id WHERE T4.opening_time < '8AM' AND T1.category_name LIKE 'Shopping'
public_review_platform
How many businesses with the category are open from Monday to Thursday?
open from Monday to Thursday refers to day_of_week BETWEEN Monday AND Thursday and day_id BETWEEN 2 AND 5;
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 INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id INNER JOIN Days AS T5 ON T4.day_id = T5.day_id WHERE T5.day_of_week LIKE 'Monday' OR T5.day_of_week LIKE 'Tuesday' OR T5.day_of_week LIKE 'Wednesday' OR T5.day_of_week LIKE 'Thursday'
public_review_platform
Please indicate the review count of the "active life" businesses in Phoenix.
active life refers to category_name = 'Active Life'; Phoenix refers to city = 'Phoenix';
SELECT COUNT(*) 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 = 'Active Life' AND T3.city = 'Phoenix'
public_review_platform
Please list the businesses name with a rating less than 5 whose category name is men's clothing.
businesses name refers to business_id; rating refers to stars; stars < 5;
SELECT 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 LIKE 'Men''s Clothing' AND T3.stars < 5
public_review_platform
Please list the businesses names whose length of user review is long with business id from 1 to 20.
businesses names refers to business_id; length of user review is long refers to review_length = 'Long'; business_id BETWEEN 1 AND 20;
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 'Long' AND T3.category_id BETWEEN 1 AND 20 GROUP BY T4.category_name
public_review_platform
Please provide the attribute values ​​of the bussinesses with fashion in Scottsdale.
fashion refers to category_name = 'Fashion'; Scottsdale refers to city = 'Scottsdale';
SELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T4.category_name LIKE 'Fashion' AND T1.city LIKE 'Scottsdale'
public_review_platform
How many compliments received from medium users that Phoenix city achieved?
medium refers to number_of_compliments = 'Medium';
SELECT COUNT(T1.number_of_compliments) FROM Users_Compliments AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.city LIKE 'Phoenix' AND T1.number_of_compliments LIKE 'Medium'
public_review_platform
Provide the businesses name in Tempe city whose opening hours are earlier than 8AM.
opening hours refers to opening_time; earlier than 8AM refers to opening_time < '8AM';
SELECT T1.category_name 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 T3.city LIKE 'Tempe' AND T4.opening_time < '8AM'
public_review_platform
How many businesses in Glendale city that are still running is opened from 8AM to 6PM?
still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
SELECT COUNT(T1.category_name) 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 T3.city LIKE 'Glendale' AND T4.opening_time LIKE '8AM' AND T4.closing_time LIKE '6PM'
public_review_platform
How many businesses are there in Phoenix city? Find the percentage of businesses in Phoenix city in the total city.
percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix' END), COUNT(category_id)), 1.0);
SELECT SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS "num" , CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.city) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id
public_review_platform
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.
category refers to category_name; percentage = MULTIPLY(DIVIDE(SUM(category_name = 'Active Life'), SUM(review_count = 'LOW')), 1.0);
SELECT SUM(CASE WHEN T2.category_name LIKE 'Active Life' THEN 1 ELSE 0 END) AS "num" , CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / ( SELECT COUNT(T3.review_count) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T3.review_count LIKE 'Low' ) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id
public_review_platform
How many active businesses are there in Phoenix?
active businesses refers to active = 'true'; Phoenix refers to city = 'Phoenix';
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Phoenix' AND active LIKE 'TRUE'
public_review_platform
How many businesses in Scottsdale are rated as "wonderful experience"?
Scottsdale refers to city = 'Scottsdale'; rated refers to stars; rated as wonderful experience refers to stars > 3;
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale' AND stars > 3
public_review_platform
How many businesses in AZ state have the beer_and_wine attribute?
beer_and_wine refers to attribute_value = 'beer_and_wine';
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T2.attribute_value LIKE 'beer_and_wine' AND T1.state LIKE 'AZ'
public_review_platform
Which city has the most businesses whose attribute is full_bar?
most business refers to MAX(business_id); full_bar refers to attribute_value = 'full_bar';
SELECT T1.city FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T2.attribute_value LIKE 'full_bar' GROUP BY T1.city
public_review_platform
How many businesses in the fashion industry are rated 5 stars?
fashion industry refers to category_name = 'Fashion';
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 T1.stars = 5 AND T3.category_name LIKE 'Fashion'
public_review_platform
Which city has the highest number of businesses in the food industry whose number of reviews is high?
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';
SELECT T1.city 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.review_count LIKE 'High' AND T3.category_name LIKE 'Food' GROUP BY T1.city
public_review_platform
Please list all business IDs in Mesa city that review stars of over 3.
stars > 3;
SELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Mesa' AND T2.review_stars > 3 GROUP BY T1.business_id
public_review_platform
What percentage of businesses are in the Real Estate sector and have the rating of 5 out of all businesses in Chandler?
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);
SELECT CAST(SUM(CASE WHEN T1.stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) 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 T1.city LIKE 'Chandler' AND T3.category_name LIKE 'Real Estate'
public_review_platform
How many users who started yelping since 2012 have sent a high number of funny votes?
users who started yelping in 2012 refers to user_yelping_since_year = '2012'; high number of funny votes refers to user_votes_funny = 'High';
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2012 AND user_votes_funny LIKE 'High'
public_review_platform
What is the number of useful votes that the user 52592 received when reviewed for business number 2?
number of useful votes refers to review_votes_useful; business number refers to business_id;
SELECT review_votes_useful FROM Reviews WHERE user_id = 52592 AND business_id = 2
public_review_platform
What are the attribute numbers that are related to payment?
attribute numbers refers to attribute_id; related to payment refers to attribute_name like '%payment%';
SELECT attribute_id FROM Attributes WHERE attribute_name LIKE '%payment%'
public_review_platform
How long was the review for business number 2 that user number 612 wrote?
how long was the review refers to review_length; business number refers to business_id; user number refers to user_id;
SELECT review_length FROM Reviews WHERE user_id = 612 AND review_stars = 5 AND business_id = 2
public_review_platform
How many businesses are actively running in Gilbert City?
actively running refers to active = 'true';
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Gilbert' AND active LIKE 'True'
public_review_platform
How many businesses in the AZ state got low quality of reviews?
low quality of reviews refers to review_count = 'low';
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND review_count LIKE 'Low'
public_review_platform
Please state any three business numbers in AZ state that have received the "Great experience" review stars.
business numbers refers to business_id; great experience review stars refers to review_stars = 5;
SELECT DISTINCT T2.business_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' AND T1.review_stars = 5 LIMIT 3
public_review_platform
Please name one attribute that business number 2 does not have.
business number refers to business_id; business_id = 2; does not have refers to attribute_value = 'none';
SELECT T1.attribute_name FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'none' LIMIT 1
public_review_platform
How many "cool" compliments did user number 33 receive?
cool compliments refers to compliment_type = 'cool'; user number refers to user_id;
SELECT COUNT(T2.compliment_type) FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.user_id = 33 AND T2.compliment_type LIKE 'cool'