input stringlengths 122 2.7k | output stringlengths 24 805 |
|---|---|
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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 C... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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 =... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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; |
[INST] Here is a database schema:
state_sector_details :
stateid [ INTEGER ]
state [ TEXT ] state_sector_details.state = institution_details.state
state_post [ TEXT ]
level [ TEXT ]
control [ TEXT ]
schools_count [ INTEGER ]
counted_pct [ TEXT ]
awards_per_state_value [ TEXT ]
awards_per_natl_value [ REAL ]
exp_award_s... | SELECT COUNT(stateid) FROM state_sector_details WHERE state = 'California' AND level = '2-year' AND control = 'Public'; |
[INST] Here is a database schema:
state_sector_details :
stateid [ INTEGER ]
state [ TEXT ] state_sector_details.state = institution_details.state
state_post [ TEXT ]
level [ TEXT ]
control [ TEXT ]
schools_count [ INTEGER ]
counted_pct [ TEXT ]
awards_per_state_value [ TEXT ]
awards_per_natl_value [ REAL ]
exp_award_s... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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 ... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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' ); |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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 ); |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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'; |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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(... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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' ); |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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 ); |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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... |
[INST] Here is a database schema:
state_sector_grads :
stateid [ INTEGER ] state_sector_grads.stateid = state_sector_details.stateid
state [ TEXT ] state_sector_grads.state = institution_details.state
state_abbr [ TEXT ]
control [ TEXT ]
level [ TEXT ]
year [ INTEGER ]
gender [ TEXT ]
race [ TEXT ]
cohort [ TEXT ]
grad... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | SELECT chronname FROM institution_details WHERE state = 'Connecticut' AND retain_percentile = ( SELECT MAX(retain_percentile) FROM institution_details WHERE state = 'Connecticut' ); |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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 ... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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 ... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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... |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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'; |
[INST] Here is a database schema:
institution_details :
unitid [ INTEGER ] primary_key
chronname [ TEXT ]
city [ TEXT ]
state [ TEXT ]
level [ TEXT ]
control [ TEXT ]
basic [ TEXT ]
hbcu [ TEXT ]
flagship [ TEXT ]
long_x [ REAL ]
lat_y [ REAL ]
site [ TEXT ]
student_count [ INTEGER ]
awards_per_value [ REAL ]
awards_pe... | 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; |
[INST] Here is a database schema:
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_count [ TEXT ]
Please write me a SQL statement that answers the following question: How many Yelp businesses are there in 'AZ' with less than "3" stars? [/INST] [/INST] | SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars < 3; |
[INST] Here is a database schema:
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_count [ TEXT ]
Please write me a SQL statement that answers the following question: What is the quantity of the closed or not running Yelp Businesses in 'AZ'? [/INST] [/IN... | SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'False'; |
[INST] Here is a database schema:
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_votes_cool [ TEXT ]
review_length [ TEXT ]
Please write me a SQL statement that answers the following question: How many long reviews does use... | SELECT COUNT(review_length) FROM Reviews WHERE user_id = 36139 AND review_length LIKE 'long'; |
[INST] Here is a database schema:
Users :
user_id [ INTEGER ] primary_key
user_yelping_since_year [ INTEGER ]
user_average_stars [ TEXT ]
user_votes_funny [ TEXT ]
user_votes_useful [ TEXT ]
user_votes_cool [ TEXT ]
user_review_count [ TEXT ]
user_fans [ TEXT ]
Please write me a SQL statement that answers the followin... | SELECT COUNT(user_id) FROM Users WHERE user_fans LIKE 'Uber'; |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Please write me a SQL statement that answers the following question: How many Yelp businesses are opened 24 hours? ... | 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'; |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Please write me a SQL statement that answers the following question: What kind of "wi-fi" does Yelp business No."10... | 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'; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many "bars" are there in the Yelp business? [/INST] [/INST] | 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'; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many more "buffets" than "gyms" in Yelp business? [/INST] [/INST] | 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; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_v... | 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_na... |
[INST] Here is a database schema:
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_votes_cool [ TEXT ]
review_length [ TEXT ]
Users :
user_id [ INTEGER ] primary_key
user_yelping_since_year [ INTEGER ]
user_average_stars [ TEX... | 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; |
[INST] Here is a database schema:
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_votes_cool [ TEXT ]
review_length [ TEXT ]
Users :
user_id [ INTEGER ] primary_key
user_yelping_since_year [ INTEGER ]
user_average_stars [ TEX... | 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; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_v... | 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.revi... |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Tips :
business_id [ INTEGER ]
user_id [ INTEGER ]
likes [ INTEGER ]
tip_length [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [... | 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'; |
[INST] Here is a database schema:
Tips :
business_id [ INTEGER ]
user_id [ INTEGER ]
likes [ INTEGER ]
tip_length [ TEXT ]
Users :
user_id [ INTEGER ] primary_key
user_yelping_since_year [ INTEGER ]
user_average_stars [ TEXT ]
user_votes_funny [ TEXT ]
user_votes_useful [ TEXT ]
user_votes_cool [ TEXT ]
user_review_cou... | 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; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Tips :
business_id [ INTEGER ]
user_id [ INTEGER ]
likes [ INTEGER ]
tip_length [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [... | 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; |
[INST] Here is a database schema:
Tips :
business_id [ INTEGER ]
user_id [ INTEGER ]
likes [ INTEGER ]
tip_length [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_count [ TEXT ]
Please write me a SQL statement that answers the following question... | SELECT T2.stars FROM Tips AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.user_id = 69722; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Give the percentage of "Automotive" businesses among all the Yelp business... | 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; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Please write me a SQL statement that answers the following question: What percentage more for the "Women's Clothing" Yelp businesses to "Men's ... | 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 A... |
[INST] Here is a database schema:
Users :
user_id [ INTEGER ] primary_key
user_yelping_since_year [ INTEGER ]
user_average_stars [ TEXT ]
user_votes_funny [ TEXT ]
user_votes_useful [ TEXT ]
user_votes_cool [ TEXT ]
user_review_count [ TEXT ]
user_fans [ TEXT ]
Please write me a SQL statement that answers the followin... | SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2004; |
[INST] Here is a database schema:
Users :
user_id [ INTEGER ] primary_key
user_yelping_since_year [ INTEGER ]
user_average_stars [ TEXT ]
user_votes_funny [ TEXT ]
user_votes_useful [ TEXT ]
user_votes_cool [ TEXT ]
user_review_count [ TEXT ]
user_fans [ TEXT ]
Please write me a SQL statement that answers the followin... | SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2005 AND user_fans LIKE 'None'; |
[INST] Here is a database schema:
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_count [ TEXT ]
Please write me a SQL statement that answers the following question: State the number of actively running Yelp businesses in "Tolleson". [/INST] [/INST] | SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Tolleson' AND active LIKE 'TRUE'; |
[INST] Here is a database schema:
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_votes_cool [ TEXT ]
review_length [ TEXT ]
Please write me a SQL statement that answers the following question: What is the number of reviews ... | SELECT COUNT(review_length) FROM Reviews WHERE user_id = 21679; |
[INST] Here is a database schema:
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_votes_cool [ TEXT ]
review_length [ TEXT ]
Please write me a SQL statement that answers the following question: How many "5" star reviews does... | SELECT COUNT(review_length) FROM Reviews WHERE business_id = 10682 AND review_stars = 5; |
[INST] Here is a database schema:
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_votes_cool [ TEXT ]
review_length [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ ... | 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; |
[INST] Here is a database schema:
Reviews :
business_id [ INTEGER ]
user_id [ INTEGER ]
review_stars [ INTEGER ]
review_votes_funny [ TEXT ]
review_votes_useful [ TEXT ]
review_votes_cool [ TEXT ]
review_length [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ ... | 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'; |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Please write me a SQL statement that answers the following question: Does Yelp business No."4960" have TV? [/INST] ... | 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; |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Please write me a SQL statement that answers the following question: Give the number of "dogs allowed" Yelp busines... | 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'; |
[INST] Here is a database schema:
Days :
day_id [ INTEGER ] primary_key
day_of_week [ TEXT ]
Business_Hours :
business_id [ INTEGER ]
day_id [ INTEGER ]
opening_time [ TEXT ]
closing_time [ TEXT ]
Please write me a SQL statement that answers the following question: How many hours does the Yelp business No. "5734" open... | 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; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Please write me a SQL statement that answers the following question: Tell the number of "hair removal" Yelp businesses. [/INST] [/INST] | 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'; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Please write me a SQL statement that answers the following question: How many more "Chinese" than "Filipino" Yelp businesses? [/INST] [/INST] | 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; |
[INST] Here is a database schema:
Tips :
business_id [ INTEGER ]
user_id [ INTEGER ]
likes [ INTEGER ]
tip_length [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_count [ TEXT ]
Please write me a SQL statement that answers the following question... | 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; |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Please write me a SQL statement that answers the following question: How many types of music does Yelp business No.... | 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; |
[INST] Here is a database schema:
Compliments :
compliment_id [ INTEGER ] primary_key
compliment_type [ TEXT ]
Users_Compliments :
compliment_id [ INTEGER ]
user_id [ INTEGER ]
number_of_compliments [ TEXT ]
Please write me a SQL statement that answers the following question: How many "cute" type of compliments does u... | 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; |
[INST] Here is a database schema:
Compliments :
compliment_id [ INTEGER ] primary_key
compliment_type [ TEXT ]
Users_Compliments :
compliment_id [ INTEGER ]
user_id [ INTEGER ]
number_of_compliments [ TEXT ]
Please write me a SQL statement that answers the following question: Who has got the most number of "funny" typ... | SELECT user_id FROM Users_Compliments WHERE compliment_id IN ( SELECT compliment_id FROM Compliments WHERE compliment_type LIKE 'funny' ); |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_co... | 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'; |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_co... | 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'; |
[INST] Here is a database schema:
Attributes :
attribute_id [ INTEGER ] primary_key
attribute_name [ TEXT ]
Business_Attributes :
attribute_id [ INTEGER ]
business_id [ INTEGER ]
attribute_value [ TEXT ]
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_co... | 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 ... |
[INST] Here is a database schema:
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_count [ TEXT ]
Please write me a SQL statement that answers the following question: List the names of business in AZ with a rating of 5. [/INST] [/INST] | SELECT business_id FROM Business WHERE state LIKE 'AZ' AND stars = 5; |
[INST] Here is a database schema:
Business :
business_id [ INTEGER ] primary_key
active [ TEXT ]
city [ TEXT ]
state [ TEXT ]
stars [ REAL ]
review_count [ TEXT ]
Please write me a SQL statement that answers the following question: How many active businesses of city are underrated? [/INST] [/INST] | SELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'Low' AND active LIKE 'TRUE'; |
[INST] Here is a database schema:
Users :
user_id [ INTEGER ] primary_key
user_yelping_since_year [ INTEGER ]
user_average_stars [ TEXT ]
user_votes_funny [ TEXT ]
user_votes_useful [ TEXT ]
user_votes_cool [ TEXT ]
user_review_count [ TEXT ]
user_fans [ TEXT ]
Please write me a SQL statement that answers the followin... | SELECT COUNT(user_id) FROM Users WHERE user_id BETWEEN 1 AND 20 AND user_fans LIKE 'None' AND user_review_count LIKE 'Low'; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Business_Hours :
business_id [ INTEGER ]
day_id [ INTEGER ]
opening_time [ TEXT ]
closing_time [ TEXT ]
Business :
business_id [ INTEGER ] prima... | 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'; |
[INST] Here is a database schema:
Categories :
category_id [ INTEGER ] primary_key
category_name [ TEXT ]
Business_Categories :
business_id [ INTEGER ]
category_id [ INTEGER ]
Business_Hours :
business_id [ INTEGER ]
day_id [ INTEGER ]
opening_time [ TEXT ]
closing_time [ TEXT ]
Business :
business_id [ INTEGER ] prima... | 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'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.