db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
0
673
SQL
stringlengths
23
804
question_id
int64
0
9.43k
difficulty
stringclasses
1 value
college_completion
What's the number of male Hispanic students who graduated from Central Alabama Community College in 2011 within 100 percent of normal/expected time?
male refers to gender = 'M'; Hispanic students refers to race = 'H'; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2011 refers to year = 2011; number of students who graduated within 100 percent of normal/expected time refers to grad_100;
SELECT SUM(T2.grad_100) 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 AND T2.gender = 'M' AND T2.race = 'H'
3,700
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
3,701
college_completion
Which cohort had the higher percentage of students who graduated from Central Alabama Community College in 2011 within 150 percent of normal/expected time, female White students or male White students?
amount of percentage = SUM(grad_150 WHERE gender = 'F') as female; percentage = SUM(grad_150 WHERE gender = 'M') as male; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2011 refers to year = 2011; graduated within 150 percent of normal/expected time refers to grad_150; female refers to gender = 'F'; White refers to race = 'w'; male refers to gender = 'M';
SELECT IIF(SUM(CASE WHEN T2.gender = 'F' THEN T2.grad_150 ELSE 0 END) > SUM(CASE WHEN T2.gender = 'M' THEN T2.grad_150 ELSE 0 END), 'female White students', 'male White students') FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011 AND T2.race = 'W'
3,702
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' )
3,703
college_completion
Please list the names of the institutes with the percentage of male White students graduating in 2011 within 150 percent of normal/expected time over 20.
names of the institutes refers to chronname; male refers to gender = 'M'; white refers to race = 'w'; in 2011 refers to year = 2011; percentage of students graduating within 150 percent of normal/expected time over 20 refers to grad_150>20;
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.grad_150 > 20 THEN T1.chronname ELSE NULL END AS T FROM institution_details T1 INNER JOIN institution_grads T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' ) WHERE T IS NOT NULL
3,704
college_completion
How many students for both genders graduated from a 2-year institute in Alabama in 2011?
2-year institute refers to cohort = '2y all'; Alabama refers to state = 'Alabama'; in 2011 refers to year = 2011; T2.gender = 'B' means both genders;
SELECT SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.cohort = '2y all' AND T2.year = 2011 AND T1.state = 'Alabama'
3,705
college_completion
How many more students in total graduated from Central Alabama Community College in 2012 than in 2011?
how many more = SUBTRACT(SUM(grad_cohort WHERE year = 2012)), (sum(grad_cohort WHERE year = 2011)); Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2012 refers to year = 2012; in 2011 refers to year = 2011;
SELECT SUM(CASE WHEN T2.year = 2012 THEN T2.grad_cohort ELSE 0 END) - SUM(CASE WHEN T2.year = 2011 THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College'
3,706
college_completion
Among the institutes in the state of Alabama whose percent rank for median SAT value within sector is 77, how many of them have over 500 graduates in total in 2011?
percent rank for median SAT value within sector refers to med_sat_percentile; over 500 graduates refers to grad_cohort > 500; in 2011 refers to year = 2011;
SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T1.med_sat_percentile = '100' AND T2.year = 2011 AND T2.grad_cohort > 500
3,707
college_completion
Among the public institutes in the state of Alabama, how many of them have over 30 students who graduated within 100 percent of normal/expected time in 2011?
public refers to control = 'Public'; over 30 students who graduated within 100 percent of normal/expected time refers to grad_100 > 30; in 2011 refers to year = 2011;
SELECT COUNT(T1.chronname) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T1.control = 'Public' AND T2.year = 2011 AND T2.grad_100 > 30
3,708
college_completion
Please list the names of the institutes in the state of Alabama whose all graduates in total exceeded 500 in 2011?
names of the institutes refers to chronname; graduates refers to grad_cohort; grad_cohort > 500; in 2011 refers to year = 2011; all students refer to race = 'X'.
SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T2.race = 'X' AND T2.grad_cohort > 500
3,709
college_completion
What's the average number of graduates for Central Alabama Community College in the 3 consecutive years from 2011 to 2013?
graduates refers to grad_cohort; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; average number of graduates for 3 consecutive years = DIVIDE(SUM(SUM(grad_cohort WHERE year = 2011), SUM(grad_cohort WHERE year = 2012), SUM(grad_cohort WHERE year = 2013)), 3);
SELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year IN (2011, 2012, 2013) AND T2.gender = 'B' AND T2.race = 'X'
3,710
college_completion
What is the average percentage of students graduating within 100 percent of normal/expected time for Central Alabama Community College?
average = DIVIDE(SUM(grad_100_rate), (SUM(grad_100), SUM(grad_150))); percentage of students graduating within 100 percent of normal/expected time refers to grade_100_rate; Central Alabama Community College refers to chronname = 'Central Alabama Community College';
SELECT AVG(T2.grad_100_rate) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College'
3,711
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
3,712
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
3,713
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
3,714
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
3,715
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'
3,716
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
3,717
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' )
3,718
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' )
3,719
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
3,720
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
3,721
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
3,722
college_completion
Which 4-year private for-profit school in "KY" has the highest graudation 150 value? Give the ID for the school.
4-year refers to level = '4-year'; private for profit refers to control = 'Private for-profit'; KY refers to state_abbr = 'KY'; highest graduation 150 value refers to MAX(grad_150_value); ID of the school refers to unitid;
SELECT T1.chronname, T1.unitid FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'KY' AND T1.level = '4-year' AND T1.control = 'Private for-profit' GROUP BY T1.chronname ORDER BY SUM(T1.grad_150_value) DESC LIMIT 1
3,723
college_completion
What was the number of female Hispanic students who graduated within 100 percent of expected time for "Pennsylvania State University-Altoona"?
female refers to gender = 'F'; Hispanic refers to race = 'H'; graduated within 100 percent of expected time refers to grad_100; Pennsylvania State University-Altoona refers to chronname = 'Pennsylvania State University-Altoona';
SELECT SUM(T2.grad_100) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Pennsylvania State University-Altoona' AND T2.gender = 'F' AND T2.race = 'H'
3,724
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 )
3,725
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'
3,726
college_completion
Give the total number of all graduated students from a 2-year public schools in Alabama in 2011.
number of graduated students refers to grad_cohort; 2-year refers to level = '2-year'; public refers to control = 'Public'; Alabama refers to state = 'Alabama'; in 2011 refers to year = '2011'; reace = 'X' means all students.
SELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T1.level = '2-year' AND T1.control = 'Public' AND T2.race = 'X'
3,727
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
3,728
college_completion
What is the percentage of the number of 4-year public schools from Madison Area Technical College's home state in the Alabama?
percentage = MULTIPLY(DIVIDE(SUM(chronname = 'Madison Area Technical College'), SUM(state = 'Alabama')), 100); 4-year refers to level = '4-year'; public refers to control = 'Public'; Madison Area Technical College refers to chronname = 'Madison Area Technical College'; home state in the United States refers to state;
SELECT CAST(COUNT(DISTINCT CASE WHEN T1.state = ( SELECT T1.state FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T1.chronname = 'Madison Area Technical College' ) AND T1.level = '4-year' AND T1.control = 'Public' THEN T1.chronname ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT CASE WHEN T2.state = 'Alabama' THEN T1.chronname ELSE NULL END) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state
3,729
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
3,730
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
3,731
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' )
3,732
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'
3,733
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'
3,734
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'
3,735
college_completion
What is the institution's name of american students within the number of degree-seeking students in the cohort that ranges from 1 to 3?
institution's name refers to chronname; american refers to race = 'Ai'; number of degree-seeking students in the cohort refers to grad_cohort; grad_cohort < = 3;
SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.grad_cohort BETWEEN 1 AND 3 AND T2.race = 'Ai'
3,736
college_completion
Among the states that start with letter A and attained a national sector average of 16.5, give the number of degree-seeking students in the cohort of those students in 2012 .
state that starts with letter A refers to state LIKE 'A%'; national sector average of 16.5 refers to awards_per_natl_value = 16.5; number of degree-seeking students in the cohort refers to grad_cohort; in 2012 refers to year = '2012';
SELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.state LIKE 'A%' AND T1.awards_per_natl_value = 16.5 AND T2.year = 2012
3,737
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 )
3,738
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
3,739
college_completion
Among the black students in 2011, list the institution site and name of those who has 20 t0 30 degree-seeking students in the cohort.
black refers to race = 'B'; in 2011 refers to year = '2011'; institution name refers to chronname; 20 to 30 degree-seeking students in the cohort refers to grad_cohort BWEEN 20 AND 30;
SELECT DISTINCT T1.site, T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.race = 'B' AND T2.grad_cohort BETWEEN 20 AND 30
3,740
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
3,741
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'
3,742
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
3,743
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' )
3,744
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
3,745
college_completion
In Harvard University, which year recorded the highest number of first-time, full-time, degree-seeking students in the cohort being tracked, minus any exclusions?
Harvard University refers to chronname = 'Harvard University'; highest number of first-time, full-time, degree-seeking students in the cohort being tracked, minus any exclusions refers to MAX(grad_cohort);
SELECT T2.year FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Harvard University' GROUP BY T2.year ORDER BY SUM(T2.grad_cohort) DESC LIMIT 1
3,746
college_completion
In the state with the highest state appropriations to higher education in fiscal year 2011 per resident, which institution has the lowest number of undergraduates in 2010?
highest state appropriations to higher education in fiscal year 2011 per resident refers to MAX(state_appr_value); lowest number of undergraduates refers to MIN(student_count); in 2010 refers to year = 2010;
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T1.student_count = ( SELECT MIN(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T3.year = 2010 ) AND T3.year = 2010 GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) DESC LIMIT 1
3,747
college_completion
In Yale University, what is the average number of Black students per year who were bachelor's/equivalent-seeking cohort at 4-year institutions between 2002 to 2005?
Yale University refers to chronname = 'Yale University'; average = DIVIDE(COUNT(race = 'B' WHERE cohort = '4y bach AND year BETWEEN 2002 AND 2005), 3); Black refers to race = 'B'; bachelor's/equivalent-seeking cohort at 4-year institutions refers to cohort = '4y bach'; between 2002 to 2005 refers to year BETWEEN '2002' AND '2005';
SELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Yale University' AND T2.year BETWEEN 2002 AND 2005 AND T2.race = 'B' AND T2.cohort = '4y bach'
3,748
college_completion
Among the Ivy League Schools, which school have the highest number of Hispanic graduates of all time?
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'; highest number of hispanic graduates refers to MAX(grad_cohort WHERE race = 'H');
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.race = 'H' GROUP BY T1.chronname ORDER BY SUM(T2.grad_cohort) DESC LIMIT 1
3,749
college_completion
How many 4-year public institutions are there in the state of Florida? Give all of their names.
4-year refers to level = '4-year'; public refers to control = 'Public'; names refers to chronname;
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 WHERE T2.level = '4-year' AND T2.control = 'Public' AND T2.state = 'Florida'
3,750
college_completion
Between the Ivy League Schools, which school's state have the lowest sate appropriations to higher education in fiscal year 2011 per resident?
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'; lowest state appropriations to higher education in fiscal year 2011 per resident refers to MIN(state_appr_value);
SELECT T1.state FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) ASC LIMIT 1
3,751
college_completion
In the state with the highest number of schools, how many institutions have a percentage of no less than 90 of undergraduates who attend full-time? List all of the institutions' names.
highest number of schools refers to MAX(schools_count); percentage of no less than 90 of undergraduates who attend full-time refers to ft_pct > 90; institutions' names refers to chronname;
SELECT COUNT(t1.unitid), t1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON t1.state = t2.state WHERE t1.ft_pct > 90 ORDER BY t2.schools_count DESC LIMIT 1
3,752
college_completion
What is the average SAT value for incoming students in all of the schools located in the state with the lowest state appropriations to higher education in fiscal year 2011 per resident?
average = DIVIDE(SUM(med_sat_value), SUM(chronname)); SAT value for incoming students refers to med_sat_value; lowest state appropriations to higher education in fiscal year 2011 per resident refers to MIN(state_appr_value);
SELECT AVG(t1.med_sat_value) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON t1.state = t2.state ORDER BY t2.state_appr_value LIMIT 1
3,753
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
3,754
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
3,755
college_completion
Between 2011 to 2013, what is the average number of male Hispanic degree-seeking students at 2-year institutions who graduated within 150 percent of normal/expected time in United Education Institute-Huntington Park Campus?
between 2011 to 2013 refers to year BETWEEN '2011' AND '2013'; male refers to gender = 'M'; Hispanic refers to race = 'H'; number of degree-seeking students at 2-year institutions who graduated within 150 percent of normal/expected time refers to grad_150; United Education Institute-Huntington Park Campus refers to chronname = 'United Education Institute-Huntington Park Campus';
SELECT AVG(T2.grad_150) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'United Education Institute-Huntington Park Campus' AND T2.year BETWEEN 2011 AND 2013 AND T2.gender = 'M' AND T2.race = 'H'
3,756
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
3,757
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
3,758
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'
3,759
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'
3,760
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'
3,761
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'
3,762
public_review_platform
What kind of "wi-fi" does Yelp business No."10172" have?
kind of wi-fi refers to attribute_value where attribute_name = 'Wi-Fi'; business No. refers to business_id;
SELECT T2.attribute_value FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.business_id = 10172 AND T1.attribute_name LIKE 'wi-fi'
3,763
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'
3,764
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
3,765
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
3,766
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
3,767
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
3,768
public_review_platform
For the Yelp business which had the most number of "long" reviews, which category does it belong to?
long reviews refers to review_length = 'long'; most number of long reviews refers to MAX(COUNT(review_length = 'long')); category refers to category_name;
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' GROUP BY T2.business_id ORDER BY COUNT(T1.review_length) DESC LIMIT 1
3,769
public_review_platform
For the Yelp business which had the most number of "short" tips, which category does it belong to?
short tips refers to tip_length = 'short'; most number of short tips refers to MAX(COUNT(tip_length = 'short')); category refers to category_name;
SELECT DISTINCT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Tips AS T4 ON T3.business_id = T4.business_id WHERE T4.tip_length LIKE 'short'
3,770
public_review_platform
In which year did the user who has given the most number of "short" tips join the Yelp?
year the user join the Yelp refers to user_yelping_since_year; most number of short tips refers to MAX(COUNT(tip_length = 'Short'));
SELECT T2.user_yelping_since_year FROM Tips AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.tip_length LIKE 'short' GROUP BY T2.user_yelping_since_year ORDER BY COUNT(T1.tip_length) DESC LIMIT 1
3,771
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
3,772
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
3,773
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
3,774
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
3,775
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
3,776
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'
3,777
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'
3,778
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
3,779
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
3,780
public_review_platform
Which closed/not running Yelp business in "Sun City" has got the most reviews? Give the business id.
closed/not running refers to active = 'False'; most reviews refers to MAX(COUNT(user_id));
SELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Sun City' AND T1.active LIKE 'FALSE' GROUP BY T1.business_id ORDER BY COUNT(T2.review_length) DESC LIMIT 1
3,781
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'
3,782
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
3,783
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'
3,784
public_review_platform
How many hours does the Yelp business No. "5734" open on Saturday?
how many hours = SUBTRACT(closing_time, opening_time); business No. refers to business_id; open on Saturday refers to day_of_week = 'Saturday';
SELECT T1.closing_time - T1.opening_time AS "hour" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Saturday' AND T1.business_id = 5734
3,785
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'
3,786
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
3,787
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
3,788
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
3,789
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
3,790
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' )
3,791
public_review_platform
Give the number of "drive-thru" businesses in "Scottsdale" with business ID number less than "1000".
drive-thru refers to attribute_name = 'Drive-Thru' AND attribute_value = 'true'; Scottsdale refers to city = 'Scottsdale'; business_id < 1000;
SELECT T2.business_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.business_id < 1000 AND T3.city LIKE 'Scottsdale' AND T1.attribute_name LIKE 'Drive-Thru' AND T2.attribute_value LIKE 'TRUE'
3,792
public_review_platform
What is the average rating for the all Yelp businesses that open 24 hours?
open 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'; rating refers to stars; average rating = AVG(stars);
SELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T2.business_id) AS "avg" 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 LIKE 'Open 24 Hours' AND T2.attribute_value LIKE 'TRUE'
3,793
public_review_platform
For all the Yelp businesses that allow customers bring their own beer, what percentage of them are in "Phoenix"?
bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 1.0)
SELECT CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.business_id) AS "percentage" 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 LIKE 'BYOB' AND T2.attribute_value LIKE 'TRUE'
3,794
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
3,795
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'
3,796
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'
3,797
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'
3,798
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'
3,799