problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: Name the state with the most number of graduate cohort in 2012 from private institute for profit? List all such institutes in the mentioned state.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2012 AND T1.control = 'Private for-profit' GROUP BY T2.grad_cohort ORDER BY COUNT(T2.grad_cohort) DESC LIMIT 1
Write SQL query to solve given problem: List all the public institutes from the state with the least number of graduate cohort in 2013.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Provide the institute name with less than 200 graduate cohort of all races and genders in 2013. Also, please state the total number of full-time equivalent undergraduates for the institute.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT T1.chronname, T2.grad_cohort FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T2.gender = 'B' AND T2.race = 'X' AND T2.grad_cohort < 200
Write SQL query to solve given problem: What is the number of female graduate for all students cohort from Oakwood University in 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: Compare the graduate cohort for Auburn University from 2011 to 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT SUM(CASE WHEN T2.year = 2011 THEN T2.grad_cohort ELSE 0 END), SUM(CASE WHEN T2.year = 2012 THEN T2.grad_cohort ELSE 0 END), SUM(CASE WHEN T2.year = 2013 THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.gender = 'B' AND T2.race = 'X' AND T1.chronname = 'Auburn University'
Write SQL query to solve given problem: Calculate the percentage of Black students in all private for profit institutions.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT CAST(SUM(CASE WHEN T2.race = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.race = 'B' AND T1.control = 'Private for-profit'
Write SQL query to solve given problem: Calculate the percentage of Asian students among students of other races who graduated from institution in Alabama in year 2013 within 100 percent of normal / expected time.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT CAST(SUM(CASE WHEN T2.race = 'A' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T1.state = 'Alabama'
Write SQL query to solve given problem: What is the ratio of Asian male graduates to Asian female graduates from Harvard University in 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT CAST(SUM(CASE WHEN T2.Gender = 'M' THEN T2.grad_cohort ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Gender = 'F' THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Harvard University' AND T2.year = 2013 AND T2.race = 'A'
Write SQL query to solve given problem: From which institute is harder to graduate for a bachelor, Amridge University or Auburn University?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT chronname FROM institution_details WHERE chronname IN ('Amridge University', 'Auburn University') ORDER BY grad_100_value LIMIT 1
Write SQL query to solve given problem: How many institutes are private and not-for profit?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT COUNT(*) FROM institution_details WHERE control = 'Private not-for-profit'
Write SQL query to solve given problem: In total, how many Hispanic male students graduated from Amridge University?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Amridge University' AND T2.gender = 'M' AND T2.race = 'H'
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: What's the number of male Hispanic students who graduated from Central Alabama Community College in 2011 within 100 percent of normal/expected time?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: How many students graduated from Central Alabama Community College in 2011 in total?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: Which institute has the highest percentage of male White students graduating in 2011 within 150 percent of normal/expected time?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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' )
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: How many students for both genders graduated from a 2-year institute in Alabama in 2011?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: How many more students in total graduated from Central Alabama Community College in 2012 than in 2011?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Please list the names of the institutes in the state of Alabama whose all graduates in total exceeded 500 in 2011?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: What's the average number of graduates for Central Alabama Community College in the 3 consecutive years from 2011 to 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: What is the average percentage of students graduating within 100 percent of normal/expected time for Central Alabama Community College?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: Give the web site address for "Swarthmore College".. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Which state is "Mercer University" located in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Which city is "Rensselaer Polytechnic Institute" located in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Tell the abbreviation for "Delaware" state.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: How many 2-year public schools are there in "California"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT COUNT(stateid) FROM state_sector_details WHERE state = 'California' AND level = '2-year' AND control = 'Public'
Write SQL query to solve given problem: Give the post name of "Idaho" state.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Tell the name of school in "NJ" that could get the bachelor's degree with highest students number.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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' )
Write SQL query to solve given problem: Give the web site address for the school in "PA" state with the highest latitude.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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' )
Write SQL query to solve given problem: Tell the number of 4-year public schools in UT whose graduation rate exceeds the average for the state.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: How many 2-year private nonprofit schools in "CT" whose graduation rate falls below the average for the state?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Give the name of the 4-year public school in "ID" with the lowest graduation 100 value.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Which 4-year private for-profit school in "KY" has the highest graudation 150 value? Give the ID for the school.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: What was the number of female Hispanic students who graduated within 100 percent of expected time for "Pennsylvania State University-Altoona"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: Give the cohort name for the school with biggest cohort size.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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 )
Write SQL query to solve given problem: Tell the number of 4-year private not-for-profit schools in the home state of "Brevard Community College".. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: Give the total number of all graduated students from a 2-year public schools in Alabama in 2011.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: What is the percentage of the number of 4-year public schools from Madison Area Technical College's home state in the Alabama?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Give the state and name of institutions in year of data release from 2010 to 2012 with black students.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: List down the states in 2011 with a national sector average of 20 and below.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: Among the race of all students, what is the control of institution and level of institution with highest number of students?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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' )
Write SQL query to solve given problem: Among the states with a public school count of 20 and below, list their race.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: List the basic of the institution in 2012 with race of all male students.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: In Alaska with school count of 1 from year 2011 to 2013, how many of the students are white?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: 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 .. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: List the site of institution within the student count of 500 to 1000 that has the recent year of data release.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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 )
Write SQL query to solve given problem: What is the state name of male graduate in 2011 from a private for profit institution with black students?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: In female students in year 2012, how many of them from a state with number of schools ranges from 10 to 20?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: List the race of institutions in Alabama with number of students greater than the 90% of average number of students of all institutions?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: In year 2010 at schools located in Hawaii, what is the percentage of schools offers an associate's degree?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: In the state of Connecticut, what is the name of the instution with the highest percent rank for freshman retention percentage within the sector?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
SELECT chronname FROM institution_details WHERE state = 'Connecticut' AND retain_percentile = ( SELECT MAX(retain_percentile) FROM institution_details WHERE state = 'Connecticut' )
Write SQL query to solve given problem: What is the website address of the institution with the highest number of White degree-seeking students at 2-year institutions in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: Among the Ivy League Schools, which school have the highest number of Hispanic graduates of all time?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: How many 4-year public institutions are there in the state of Florida? Give all of their names.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: Between the Ivy League Schools, which school's state have the lowest sate appropriations to higher education in fiscal year 2011 per resident?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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'
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ```
college_completion
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
Write SQL query to solve given problem: How many Yelp businesses are there in 'AZ' with less than "3" stars?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars < 3
Write SQL query to solve given problem: What is the quantity of the closed or not running Yelp Businesses in 'AZ'?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'False'
Write SQL query to solve given problem: How many long reviews does user No. 36139 give for the Yelp businesses?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(review_length) FROM Reviews WHERE user_id = 36139 AND review_length LIKE 'long'
Write SQL query to solve given problem: How many users have "uber" number of fans?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(user_id) FROM Users WHERE user_fans LIKE 'Uber'
Write SQL query to solve given problem: How many Yelp businesses are opened 24 hours?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Open 24 Hours' AND T2.attribute_value LIKE 'TRUE'
Write SQL query to solve given problem: What kind of "wi-fi" does Yelp business No."10172" have?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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'
Write SQL query to solve given problem: How many "bars" are there in the Yelp business?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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'
Write SQL query to solve given problem: How many more "buffets" than "gyms" in Yelp business?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: What business category is the Yelp business which got the most 5 star reviews in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: In which year did the user who gave the most number of "5" star reviews join the Yelp?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: For the user who gave the most number of long reviews, what is his/her averge ratings of all review?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: For the Yelp business which had the most number of "long" reviews, which category does it belong to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Long' GROUP BY T2.business_id ORDER BY COUNT(T1.review_length) DESC LIMIT 1
Write SQL query to solve given problem: For the Yelp business which had the most number of "short" tips, which category does it belong to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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'
Write SQL query to solve given problem: In which year did the user who has given the most number of "short" tips join the Yelp?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: User No. 70271 only has given one tip to the Yelp business, which category was that business belonged to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: There was only one tip that user No. 69722 gave to the Yelp business, what was the ratings of that business?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT T2.stars FROM Tips AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.user_id = 69722
Write SQL query to solve given problem: Give the percentage of "Automotive" businesses among all the Yelp businesses.. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: What percentage more for the "Women's Clothing" Yelp businesses to "Men's Clothing"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: Give the number of users who joined Yelp since "2004".. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2004
Write SQL query to solve given problem: How many users who have joined Yelp since "2005" but have no fans?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2005 AND user_fans LIKE 'None'
Write SQL query to solve given problem: State the number of actively running Yelp businesses in "Tolleson".. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Tolleson' AND active LIKE 'TRUE'
Write SQL query to solve given problem: What is the number of reviews from user No. "21679"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(review_length) FROM Reviews WHERE user_id = 21679
Write SQL query to solve given problem: How many "5" star reviews does the Yelp business No. "10682" get?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(review_length) FROM Reviews WHERE business_id = 10682 AND review_stars = 5
Write SQL query to solve given problem: Which closed/not running Yelp business in "Sun City" has got the most reviews? Give the business id.. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Sun City' AND T1.active LIKE 'FALSE' GROUP BY T1.business_id ORDER BY COUNT(T2.review_length) DESC LIMIT 1
Write SQL query to solve given problem: For the only Yelp business in "Yuma" city, how many "medium" reviews did it get?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(T2.review_length) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Yuma' AND T2.review_length LIKE 'Medium'
Write SQL query to solve given problem: Does Yelp business No."4960" have TV?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: Give the number of "dogs allowed" Yelp businesses.. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Dogs Allowed' AND T2.attribute_value LIKE 'TRUE'
Write SQL query to solve given problem: How many hours does the Yelp business No. "5734" open on Saturday?. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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
Write SQL query to solve given problem: Tell the number of "hair removal" Yelp businesses.. Keep the solution inside sql tag ```sql [SQL-Query] ```
public_review_platform
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'