db_id
stringclasses
68 values
question
stringlengths
33
321
evidence
stringlengths
0
673
SQL
stringlengths
116
743
question_id
int64
3
6.6k
difficulty
stringclasses
2 values
codebase_comments
Among the repositories whose number of stars received are between 6,000 to 9,000, which repository has the highest number of solution paths and many of those solution paths needs to be compiled if user wants to implement it?
Stars between 6,000 to 9,000; highest number of solution paths refers to max(count(Path)); needs to be compiled if user wants to implement it refers to WasCompiled = 0;
SELECT T2.RepoId, COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars BETWEEN 6000 AND 9000 AND T2.WasCompiled = 0 GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) DESC LIMIT 1
5,835
challenging
codebase_comments
How many percent more of the Forks for the repository of solution No.53546 than No.1502?
solution No. refers to Solution.Id; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 53546), SUM(Solution.Id = 1502)), 100)), SUM(Solution.Id = 1502);
SELECT CAST(SUM(CASE WHEN T2.Id = 53546 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
5,909
challenging
codebase_comments
What is the language of the method used in the solution path "opendns_diagnosticapp\windows\OpenDnsDiagnostic.sln"?
language refers to Lang;
SELECT T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'opendns_diagnosticappwindowsOpenDnsDiagnostic.sln'
2,977
moderate
codebase_comments
How many methods does solution 1 have? And please tell me if solution 1 needs to be compiled.
method refers to Name; solution refers to Solution.Id; Solution.Id = 1; solution needs to be compiled refers to WasCompiled = 0;
SELECT COUNT(T2.SolutionId) , CASE WHEN T1.WasCompiled = 0 THEN 'Needs' ELSE 'NoNeeds' END needToCompile FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SolutionId = 1
3,867
moderate
codebase_comments
How many solution paths that needs to be compiled if user wants to implement it in "https://github.com/jeffdik/tachy.git"?
needs to be compiled if user wants to implement refers to WasCompiled = 0; https://github.com/jeffdik/tachy.git is url of repository
SELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git' AND T2.WasCompiled = 0
3,637
moderate
codebase_comments
What is the task of the method whose tokenized name is "online median filter test median window filling"?
tokenized name refers to NameTokenized; task of the method refers to the second part of name deliminated by "."; for example, the task of 'LinqToDelicious.HttpWebRequestFactory.Create' is 'HttpWebRequestFactory'
SELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'online median filter test median window filling'
428
moderate
codebase_comments
How many more stars in percentage are there for the repository of solution "1" than solution "2"?
solution refers to Solution.Id; Solution.Id = 1 OR 2; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 1), SUM(Solution.Id = 2)), 100)), SUM(Solution.Id = 2);
SELECT CAST(SUM(CASE WHEN T2.Id = 1 THEN T1.Stars ELSE 0 END) - SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
3,305
challenging
codebase_comments
How many percent more of the stars for the repository of solution No.51424 than No.167053?
solution No. refers to Solution.Id; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 51424), SUM(Solution.Id = 167053)), 100)), SUM(Solution.Id = 167053);
SELECT CAST(SUM(CASE WHEN T2.Id = 51424 THEN T1.Stars ELSE 0 END) - SUM(CASE WHEN T2.Id = 167053 THEN T1.Stars ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 167053 THEN T1.Stars ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
4,397
challenging
codebase_comments
Among all the solution of the 'zh-cn' methods, which path is most often used?
solution refers to SolutionId; zh-cn refers to Lang = 'zh-cn'; path that is most often used refers to MAX(COUNT(Path));
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'zh-cn' GROUP BY T1.Path ORDER BY COUNT(T1.Path) DESC LIMIT 1
3,459
moderate
codebase_comments
What is the task of the method that is in the Czech language?
method refers to Name; task of the method refers to the second part of the Name after the "."; Czech language refers to Lang = 'cs'
SELECT DISTINCT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE Lang = 'cs'
2,475
moderate
codebase_comments
Which repository has the longest amount of processed time of downloading? Indicate whether the solution paths in the repository can be implemented without needs of compilation.
longest amount of processed time refers to max(ProcessedTime); the repository can be implemented without needs of compilation refers to WasCompiled = 1;
SELECT DISTINCT T1.id, T2.WasCompiled FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo )
6,119
moderate
codebase_comments
What's the task of the method whose tokenized name is "html parser feed"?
tokenized name refers to NameTokenized; task of the method refers to the second part of name deliminated by "."; for example, the task of 'LinqToDelicious.HttpWebRequestFactory.Create' is 'HttpWebRequestFactory'
SELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'html parser feed'
5,686
moderate
codebase_comments
Which solution contains files within a more popular repository, the solution ID18 or solution ID19?
more watchers mean that this repository is more popular;
SELECT CASE WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) > SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'SolutionID18' WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) < SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'SolutionID19' END isMorePopular FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
6,210
challenging
codebase_comments
In the "https://github.com/wallerdev/htmlsharp.git", give all the linearized sequenced of API calls.
linearized sequenced of API calls refers to ApiCalls; 'https://github.com/wallerdev/htmlsharp.git' is url of repository
SELECT T3.ApiCalls FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/wallerdev/htmlsharp.git'
2,681
moderate
codebase_comments
How many more followers in percentage are there for the repository used by solution ID 18 than solution ID19?
followers refers to Forks; percentage = divide(SUBTRACT(Forks(Solution.ID = 18), Forks(Solution.ID = 19)), Forks(Solution.ID = 19))*100%
SELECT CAST((SUM(CASE WHEN T2.Id = 18 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 19 THEN T1.Forks ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 19 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
587
challenging
coinmarketcap
For all transactions for WRAP in August 2016, list the time to achieve highest price and the time to achieve the lowest price.
in May 2013 refers to month(date) = 5 AND year(date) = 2013; time to achieve the highest price refers to time_high; time to achieve the lowest price refers to time_low; WRAP refers to name = 'WARP'
SELECT T2.time_high, T2.time_low, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'WARP' AND STRFTIME('%Y-%m', T2.date) = '2016-08'
301
moderate
coinmarketcap
Had Bitcoin's price increased or decreased on 2013/5/5 compared with the price 7 days before?
price increased refers to percent_change_7d>0; decreased refers percent_change_7d<0; on 2013/5/5 refers to date = '2013-05-05'
SELECT (CASE WHEN T2.percent_change_7d > 0 THEN 'INCREASED' ELSE 'DECREASED' END) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-05' AND T1.name = 'Bitcoin'
2,672
moderate
coinmarketcap
Name the coin with the highest percentage price changed in 24 hours. State the transaction date and price.
the highest percentage price changed in 24 hours refers to max(percent_change_24h)
SELECT T1.name, T2.DATE, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_24h = ( SELECT MAX(percent_change_24h) FROM historical )
5,434
moderate
coinmarketcap
What was the percentage of the Bitcoins verifiably burned until 2018/4/28?
the percentage of the Bitcoins verifiably burned = divide(subtract(SUM(max_supply), SUM(total_supply)),SUM(total_supply))*100%; until 2013/4/28 refers to date<'2013-04-08'
SELECT CAST((SUM(T2.max_supply) - SUM(T2.total_supply)) AS REAL) / SUM(T2.total_supply) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date < '2018-04-28' AND T1.name = 'Bitcoin'
4,454
moderate
college_completion
In the state with the highest state appropriations to higher education in fiscal year 2011 per resident, which institution has the lowest number of undergraduates in 2010?
highest state appropriations to higher education in fiscal year 2011 per resident refers to MAX(state_appr_value); lowest number of undergraduates refers to MIN(student_count); in 2010 refers to year = 2010;
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T1.student_count = ( SELECT MIN(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T3.year = 2010 ) AND T3.year = 2010 GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) DESC LIMIT 1
832
challenging
college_completion
Please list the names of the institutes in the state of Alabama whose all graduates in total exceeded 500 in 2011?
names of the institutes refers to chronname; graduates refers to grad_cohort; grad_cohort > 500; in 2011 refers to year = 2011; all students refer to race = 'X'.
SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T2.race = 'X' AND T2.grad_cohort > 500
780
moderate
college_completion
Among the institutes in the state of Alabama whose percent rank for median SAT value within sector is 77, how many of them have over 500 graduates in total in 2011?
percent rank for median SAT value within sector refers to med_sat_percentile; over 500 graduates refers to grad_cohort > 500; in 2011 refers to year = 2011;
SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T1.med_sat_percentile = '100' AND T2.year = 2011 AND T2.grad_cohort > 500
6,284
moderate
college_completion
Which 4-year private for-profit school in "KY" has the highest graudation 150 value? Give the ID for the school.
4-year refers to level = '4-year'; private for profit refers to control = 'Private for-profit'; KY refers to state_abbr = 'KY'; highest graduation 150 value refers to MAX(grad_150_value); ID of the school refers to unitid;
SELECT T1.chronname, T1.unitid FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'KY' AND T1.level = '4-year' AND T1.control = 'Private for-profit' GROUP BY T1.chronname ORDER BY SUM(T1.grad_150_value) DESC LIMIT 1
3,441
moderate
college_completion
Tell the number of 4-year public schools in UT whose graduation rate exceeds the average for the state.
4-year refers to level = '4-year'; public refers to control = 'Public'; UT refers to state_abbr = 'UT'; graduation rate exceeds the average for the state refers to awards_per_value > awards_per_state_value;
SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'UT' AND T1.level = '4-year' AND T1.control = 'Public' AND T1.awards_per_value > T1.awards_per_state_value
3,057
moderate
college_completion
Among the Ivy League Schools in 2013, which schools have the highest number of Black students who graduated within 150 percent of normal/expected time who were seeking a bachelor's/equivalent cohort at 4-year institutions?
Ivy League Schools refers to chronname = 'Brown University' or chronname = 'Columbia University' or chronname = 'Cornell University' or chronname = 'Dartmouth College' or chronname = 'Harvard University' or chronname = 'Princeton University' or chronname = 'University of Pennsylvania' or chronname = 'Yale University'; in 2013 refers to year = '2013'; highest number of Black students who graduated within 150 percent of normal/expected time refers to MAX(grad_150 WHERE race = 'B'); seeking a bachelor's/equivalent cohort at 4-year institutions refers to cohort = '4y bach';
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) AND T2.year = 2013 AND T2.race = 'B' AND T2.cohort = '4y bach' ORDER BY T2.grad_cohort DESC LIMIT 1
6,579
challenging
college_completion
How many 2-year private nonprofit schools in "CT" whose graduation rate falls below the average for the state?
2-year refers to level = '2-year'; private nonprofit refers to control = 'Private not-for-profit'; CT refers to state_abbr = 'CT'; graduation rate falls below the average for the state refers to awards_per_value < awards_per_natl_value;
SELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'CT' AND T2.level = '2-year' AND T1.control = 'Private not-for-profit' AND T1.awards_per_value < T1.awards_per_natl_value
4,220
moderate
college_completion
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.
institute name refers to chronname; less than 200 graduate cohort refers to grad_cohort < 200; all races refers to race = 'X'; all genders refers to gender = 'B'; in 2013 refers to year = 2013; total number of full-time equivalent undergraduates refers to fte_value;
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
6,483
moderate
college_completion
What is the ratio of Asian male graduates to Asian female graduates from Harvard University in 2013?
ratio = MULTIPLY(DIVIDE(SUM(grad_cohort WHERE Gender = 'M'), SUM( grad_cohort WHERE Gender = 'F')), 1.0); Asian refers to race = 'A'; female refers to gender = 'F'; graduates refers to grad_cohort; male refers to gender = 'M'; Harvard University refers to chronname = 'Harvard University'; in 2013 refers to year = 2013;
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'
77
challenging
college_completion
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.
most number of graduate cohort refers to MAX(SUM(grad_cohort)); in 2012 refers to year = 2012; private institute for profit refers to control = 'Private for-profit'; institutes refers to chronname;
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
918
moderate
college_completion
Among the states that start with letter A and attained a national sector average of 16.5, give the number of degree-seeking students in the cohort of those students in 2012 .
state that starts with letter A refers to state LIKE 'A%'; national sector average of 16.5 refers to awards_per_natl_value = 16.5; number of degree-seeking students in the cohort refers to grad_cohort; in 2012 refers to year = '2012';
SELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.state LIKE 'A%' AND T1.awards_per_natl_value = 16.5 AND T2.year = 2012
5,248
moderate
college_completion
Tell the name of school in "NJ" that could get the bachelor's degree with highest students number.
name of school refers to chronname; NJ refers to state_abbr = 'NJ'; bachelor's degree refers to level = '4-year'; highest students number refers to MAX(student_count);
SELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'NJ' AND T1.level = '4-year' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'NJ' AND T1.level = '4-year' )
1,113
moderate
college_completion
Which institute has the highest percentage of male White students graduating in 2011 within 150 percent of normal/expected time?
male refers to gender = 'M'; white refers to race = 'w'; in 2011 refers to year = 2011; graduating within 150 percent of normal/expected time refers to grad_150;
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' AND T2.grad_150 = ( SELECT MAX(T2.grad_150) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' )
1,217
moderate
college_completion
Among the race of all students, what is the control of institution and level of institution with highest number of students?
highest number of students refers to student_count; all students refer to race = 'X'.
SELECT DISTINCT T1.control, T1.level FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' )
1,607
challenging
college_completion
In Yale University, what is the average number of Black students per year who were bachelor's/equivalent-seeking cohort at 4-year institutions between 2002 to 2005?
Yale University refers to chronname = 'Yale University'; average = DIVIDE(COUNT(race = 'B' WHERE cohort = '4y bach AND year BETWEEN 2002 AND 2005), 3); Black refers to race = 'B'; bachelor's/equivalent-seeking cohort at 4-year institutions refers to cohort = '4y bach'; between 2002 to 2005 refers to year BETWEEN '2002' AND '2005';
SELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Yale University' AND T2.year BETWEEN 2002 AND 2005 AND T2.race = 'B' AND T2.cohort = '4y bach'
2,424
moderate
college_completion
In Harvard University, which year recorded the highest number of first-time, full-time, degree-seeking students in the cohort being tracked, minus any exclusions?
Harvard University refers to chronname = 'Harvard University'; highest number of first-time, full-time, degree-seeking students in the cohort being tracked, minus any exclusions refers to MAX(grad_cohort);
SELECT T2.year FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Harvard University' GROUP BY T2.year ORDER BY SUM(T2.grad_cohort) DESC LIMIT 1
2,196
moderate
college_completion
What's the average number of graduates for Central Alabama Community College in the 3 consecutive years from 2011 to 2013?
graduates refers to grad_cohort; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; average number of graduates for 3 consecutive years = DIVIDE(SUM(SUM(grad_cohort WHERE year = 2011), SUM(grad_cohort WHERE year = 2012), SUM(grad_cohort WHERE year = 2013)), 3);
SELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year IN (2011, 2012, 2013) AND T2.gender = 'B' AND T2.race = 'X'
125
moderate
college_completion
Give the web site address for the school in "PA" state with the highest latitude.
web site address refers to site; PA refers to state_abbr = 'PA'; highest latitude refers to MAX(lat_y);
SELECT DISTINCT T1.site FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' AND T1.lat_y = ( SELECT MAX(T1.lat_y) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' )
1,038
moderate
college_completion
For the state which has the 113 2-year public schools, tell the number of graduated Asian students who seeks another type of degree or certificate at a 2-year institution in 2013.
schools_count = 113; 2-year refers to level = '2-year'; public refers to control = 'public'; Asian refers to race = 'A'; seeks another type of degree or certificate at a 2-year institution refers to cohort = '2y all'; in 2013 refers to year = 2013;
SELECT COUNT(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.level = '2-year' AND T2.control = 'Public' AND T2.gender = 'B' AND T2.race = 'A' AND T2.cohort = '2y all' AND T1.schools_count = 113
5,787
moderate
college_completion
List the race of institutions in Alabama with number of students greater than the 90% of average number of students of all institutions?
Alabama refers to state = 'Alabama'; number of students greater than the 90% of average = MULTIPLY(AVG(student_count), 90%) < student_count;
SELECT DISTINCT T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.student_count > ( SELECT AVG(T1.student_count) * 0.9 FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' ) AND T1.state = 'Alabama'
5,065
challenging
college_completion
Compare the graduate cohort for Auburn University from 2011 to 2013?
graduate cohort for Auburn University refers to grad_cohort is not null WHERE chronname = 'Auburn University', gender = 'B', race = 'X' and cohort = '4y other', '4y bach'; from 2011 to 2013 refers to year in (2011, 2012, 2013);
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'
2,124
challenging
college_completion
In Alaska with school count of 1 from year 2011 to 2013, how many of the students are white?
Alaska refers to state = 'Alaska'; from year 2011 to 2013 refers to year BETWEEN '2011' AND '2013'; white refers to race = 'W';
SELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count = 1 AND T2.year BETWEEN 2011 AND 2013 AND T2.race = 'W' AND T1.state = 'Alaska'
5,509
moderate
college_completion
Among the black students in 2011, list the institution site and name of those who has 20 t0 30 degree-seeking students in the cohort.
black refers to race = 'B'; in 2011 refers to year = '2011'; institution name refers to chronname; 20 to 30 degree-seeking students in the cohort refers to grad_cohort BWEEN 20 AND 30;
SELECT DISTINCT T1.site, T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.race = 'B' AND T2.grad_cohort BETWEEN 20 AND 30
5,242
moderate
college_completion
What is the name of the school with the highest difference in the average completion rate for the national in which it belongs? Indicate the state appropriations to higher education in fiscal year 2011 per resident to which the school belongs.
name of the school refers to chronname; highest difference in the average completion rate for the national in which it belongs = MAX(SUBTRACT(awards_per_value, awards_per_natl_value)); state appropriations to higher education in fiscal year 2011 per resident to which the school belongs refers to state_appr_value;
SELECT T1.chronname, T2.state_appr_value FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state ORDER BY T1.awards_per_value - T2.awards_per_natl_value DESC LIMIT 1
294
moderate
college_completion
Calculate the percentage of Black students in all private for profit institutions.
Black students refers to race = 'B'; private for profit refers to control = 'Private for-profit'; percentage = MULTIPLY(DIVIDE(SUM(race = 'B'), SUM(grad_cohort)), 100.0);
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'
4,819
moderate
college_completion
In 2012, how many Asian female graduates were seeking another type of degree or certificate at the 4-year institution at University of Alaska at Anchorage?
In 2012 refers to year = 2012; Asian refers to race = 'A'; female refers to gender = 'F'; graduates refers to grad_cohort; seeking another type of degree or certificate at a 4-year institution refers to cohort = '4y other'; University of Alaska at Anchorage refers to chronname = 'University of Alaska at Anchorage';
SELECT COUNT(*) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.gender = 'F' AND T2.race = 'A' AND T1.chronname = 'University of Alaska at Anchorage' AND T2.cohort = '4y other'
3,298
moderate
college_completion
What is the number of female graduate for all students cohort from Oakwood University in 2013?
female refers to gender = 'F'; graduates refers to grad_cohort; Oakwood University refers to chronname = 'Oakwood University'; in 2013 refers to year = 2013; all sutdents refer to rae = 'X';
SELECT COUNT(*) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T2.gender = 'F' AND T2.race = 'X' AND T1.chronname = 'Oakwood University'
3,282
moderate
college_completion
What's the number of male Hispanic students who graduated from Central Alabama Community College in 2011 within 100 percent of normal/expected time?
male refers to gender = 'M'; Hispanic students refers to race = 'H'; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2011 refers to year = 2011; number of students who graduated within 100 percent of normal/expected time refers to grad_100;
SELECT SUM(T2.grad_100) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'H'
1,572
moderate
college_completion
How many students that graduated from Lincoln College in 2011 belong to the cohort type of Bachelor's/equivalent seeking cohort at 4-year institutions?
Lincoln College refers to chronname = 'Lincoln College'; in 2011 refers to year = 2011; Bachelor's/equivalent seeking cohort at 4-year institutions refers to cohort = '4y bach';
SELECT COUNT(T1.unitid) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Lincoln College' AND T2.year = 2011 AND T2.cohort = '4y bach'
2,909
moderate
college_completion
What was the number of female Hispanic students who graduated within 100 percent of expected time for "Pennsylvania State University-Altoona"?
female refers to gender = 'F'; Hispanic refers to race = 'H'; graduated within 100 percent of expected time refers to grad_100; Pennsylvania State University-Altoona refers to chronname = 'Pennsylvania State University-Altoona';
SELECT SUM(T2.grad_100) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Pennsylvania State University-Altoona' AND T2.gender = 'F' AND T2.race = 'H'
2,803
moderate
college_completion
How many more students in total graduated from Central Alabama Community College in 2012 than in 2011?
how many more = SUBTRACT(SUM(grad_cohort WHERE year = 2012)), (sum(grad_cohort WHERE year = 2011)); Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2012 refers to year = 2012; in 2011 refers to year = 2011;
SELECT SUM(CASE WHEN T2.year = 2012 THEN T2.grad_cohort ELSE 0 END) - SUM(CASE WHEN T2.year = 2011 THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College'
4,782
moderate
college_completion
What is the state name of male graduate in 2011 from a private for profit institution with black students?
male refers to gender = 'M'; in 2011 refers to year = '2011'; private for profit refers to control = 'Private for-profit'; black refers to race = 'B';
SELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.gender = 'M' AND T2.race = 'B' AND T1.control = 'Private for-profit' AND T2.year = 2011
1,555
moderate
college_completion
What is the percentage of the number of 4-year public schools from Madison Area Technical College's home state in the Alabama?
percentage = MULTIPLY(DIVIDE(SUM(chronname = 'Madison Area Technical College'), SUM(state = 'Alabama')), 100); 4-year refers to level = '4-year'; public refers to control = 'Public'; Madison Area Technical College refers to chronname = 'Madison Area Technical College'; home state in the United States refers to state;
SELECT CAST(COUNT(DISTINCT CASE WHEN T1.state = ( SELECT T1.state FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T1.chronname = 'Madison Area Technical College' ) AND T1.level = '4-year' AND T1.control = 'Public' THEN T1.chronname ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT CASE WHEN T2.state = 'Alabama' THEN T1.chronname ELSE NULL END) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state
3,302
challenging
college_completion
Between the Ivy League Schools, which school's state have the lowest sate appropriations to higher education in fiscal year 2011 per resident?
Ivy League Schools refers to chronname = 'Brown University' or chronname = 'Columbia University' or chronname = 'Cornell University' or chronname = 'Dartmouth College' or chronname = 'Harvard University' or chronname = 'Princeton University' or chronname = 'University of Pennsylvania' or chronname = 'Yale University'; lowest state appropriations to higher education in fiscal year 2011 per resident refers to MIN(state_appr_value);
SELECT T1.state FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) ASC LIMIT 1
991
moderate
college_completion
In the state with the highest number of schools, how many institutions have a percentage of no less than 90 of undergraduates who attend full-time? List all of the institutions' names.
highest number of schools refers to MAX(schools_count); percentage of no less than 90 of undergraduates who attend full-time refers to ft_pct > 90; institutions' names refers to chronname;
SELECT COUNT(t1.unitid), t1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON t1.state = t2.state WHERE t1.ft_pct > 90 ORDER BY t2.schools_count DESC LIMIT 1
5,350
moderate
computer_student
Provide the ID of professors who teach in both harder undergraduate course and master/graduate courses.
harder undergraduate course refers to courseLevel = 'Level_400'; master/graduate courses refers to courseLevel = 'Level_500'; ID of professors refers to taughtBy.p_id
SELECT DISTINCT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400' OR T1.courseLevel = 'Level_500'
276
moderate
computer_student
How many students are advised to teach by a professor teaching basic or medium undergraduate courses?
students refers to advisedBy.p_id; professor refers to p_id_dummy and taughtBy.p_id and professor = 1; basic or medium undergraduate courses refers to courseLevel = 'Level_300'
SELECT COUNT(DISTINCT T4.p_id) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id INNER JOIN advisedBy AS T4 ON T4.p_id = T1.p_id WHERE T1.professor = 1 AND T3.courseLevel = 'Level_300'
435
moderate
computer_student
Find the professor ID and position in faculty who taught high-level undergraduate course of less than 10 in ID.
professor ID refers to person.p_id when professor = 1; position in faculty refers to hasPosition; high-level undergraduate course refers to courseLevel = 'Level_400'; less than 10 in ID refers to course.course_id < 10
SELECT T1.p_id, T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_400' AND T2.course_id < 10
5,433
moderate
computer_student
Among the faculty affiliated professor, how many professors teaches professional or master/undergraduate courses?
faculty affiliated professor refers to professor = 1 and hasPosition = 'Faculty_aff'; professional or master/undergraduate courses refers to courseLevel = 'Level_500'
SELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T1.hasPosition = 'Faculty_aff' AND T1.professor = 1 AND T3.courseLevel = 'Level_500'
6,333
moderate
computer_student
Please list the IDs of all the faculty employees who teaches a basic or medium undergraduate course.
faculty employees refers to hasPosition = 'Faculty_eme'; basic or medium undergraduate course refers to courseLevel = 'Level_300'
SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_300' AND T3.hasPosition = 'Faculty_eme'
847
moderate
computer_student
What is the average number of professional or master/undergraduate courses being taught by each professor?
professional or master/undergraduate courses refers to courseLevel = 'Level_500'; average number = divide(count(taughtBy.course_id), count(taughtBy.p_id))
SELECT CAST(COUNT(T1.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'
2,169
moderate
computer_student
Which member of the faculty are teaching the most courses and what is his/her general course level?
member of the faculty refers to hasPosition <> 0, most courses refers to max(count(course.course_id))
SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1
3,636
moderate
cookbook
Provide the ingredients that are rationed in the recipe with the highest carbohydrate content.
the highest carbohydrate content refers to MAX(carbo)
SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id WHERE T2.max_qty = T2.min_qty ORDER BY T3.carbo DESC LIMIT 1
2,093
moderate
cookbook
Is the ingredient "graham cracker crumbs" optional in the recipe "Raspberry Chiffon Pie"?
'graham cracker crumbs' is a name of an ingredient; 'Raspberry Chiffon Pie' refers to title
SELECT T2.optional FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T3.name = 'graham cracker crumbs'
2,445
moderate
cookbook
Which recipe has the highest number of ingredients? Calculate the said recipe's total time of cooking.
the highest number of ingredients refers to MAX(ingredient_id); total time refers to recipe_id, total time of cooking refers to TOTAL(prep_min, cook_min, stnd_min)
SELECT T2.recipe_id, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id GROUP BY T2.recipe_id ORDER BY COUNT(T2.ingredient_id) DESC LIMIT 1
484
moderate
cookbook
Which recipe needs the most frozen raspberries in light syrup? State its title.
frozen raspberries in light syrup is a name of an ingredient; max_qty = min_qty
SELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'frozen raspberries in light syrup' AND T2.max_qty = T2.min_qty
1,912
moderate
cookbook
Provide the title and total time of the recipe which can be made with only lima beans.
total time refers to total time refers to TOTAL(prep_min, cook_min, stnd_min); lima beans is a name of an ingredient
SELECT T1.title, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'lima beans'
2,522
moderate
cookbook
Please list the names of all the ingredients needed for the recipe "Raspberry Chiffon Pie" that do not need preprocessing.
Raspberry Chiffon Pie refers to title; do not need preprocessing refers to preparation IS NULL
SELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T2.preparation IS NULL
2,356
moderate
cookbook
Among all recipes containing cheese, what is the percentage of recipes with calories greater than 200?
cheese is a category; calories greater than 200 refers to calories > 200; calculation = MULTIPLY(DIVIDE(COUNT(calories > 200 THEN recipe_id), COUNT(recipe_id)), 100)
SELECT CAST(SUM(CASE WHEN T4.calories > 200 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id INNER JOIN Nutrition AS T4 ON T4.recipe_id = T1.recipe_id WHERE T3.category = 'cheese'
4,437
challenging
cookbook
Calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes.
no cholesterol refers to cholestrl = 0; cooking time less than 20 minutes refers to cook_min < 20; calculation = MULTIPLY(DIVIDE(COUNT(cholestrl = 0 THEN recipe_id), COUNT(recipe_id)), 100)
SELECT CAST(SUM(CASE WHEN T1.cook_min < 20 AND T2.cholestrl = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id
1,610
moderate
cookbook
Which ingredient appeared the most in recipes? Calculate its amount of appearance in percentage.
ingredient appeared the most in recipes refers to MAX(COUNT(ingredient_id)); calculation = MULTIPLY(DIVIDE(COUNT(MAX(ingredient_id)), COUNT(ingredient_id)), 100)
SELECT T1.name, CAST(COUNT(T2.ingredient_id) AS FLOAT) * 100 / ( SELECT COUNT(T2.ingredient_id) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id ) AS "percentage" FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id GROUP BY T2.ingredient_id ORDER BY COUNT(T2.ingredient_id) DESC LIMIT 1
4,880
challenging
cookbook
Among the recipes with sea bass, how many percent of recipes can serve 10 people and above?
sea bass is a name of an ingredient; can serve 10 people and above refers to servings > = 10; calculation = MULTIPLY(DIVIDE(COUNT(servings > = 10 THEN recipe_id)), COUNT(recipe_id), 100)
SELECT CAST(SUM(CASE WHEN T1.servings >= 10 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'sea bass steak'
2,642
moderate
cookbook
At least how many cups of graham cracker crumbs does the recipe "Raspberry Chiffon Pie" need?
'graham cracker crumbs' is a name of an ingredient; 'Raspberry Chiffon Pie' refers to title
SELECT T2.min_qty FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T3.name = 'graham cracker crumbs'
3,778
moderate
cookbook
Which recipe is more beneficial in wound healing, "Raspberry Chiffon Pie" or "Fresh Apricot Bavarian"?
Raspberry Chiffon Pie and Fresh Apricot Bavarian are title; vitamin_c is higher refers to MAX(vitamin_c)
SELECT DISTINCT CASE WHEN CASE WHEN T2.title = 'Raspberry Chiffon Pie' THEN T1.vitamin_c END > CASE WHEN T2.title = 'Fresh Apricot Bavarian' THEN T1.vitamin_c END THEN 'Raspberry Chiffon Pie' ELSE 'Fresh Apricot Bavarian' END AS "vitamin_c is higher" FROM Nutrition T1 INNER JOIN Recipe T2 ON T2.recipe_id = T1.recipe_id
1,243
challenging
cookbook
How many cups of almonds do you need for a chicken pocket sandwich?
cups is a unit; almonds is a name of an ingredient; chicken pocket sandwich refers to title
SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Chicken Pocket Sandwich' AND T3.name = 'almonds' AND T2.unit = 'cup(s)'
2,983
moderate
craftbeer
Of all the beer styles produced by Stevens Point Brewery, how many percent do they allot for American Adjunct Lager?
Percent allotted = count(American Adjunct Lager beer styles) / count(styles) * 100%
SELECT CAST(SUM(IIF(T1.style = 'American Adjunct Lager', 1, 0)) AS REAL) * 100 / COUNT(T1.brewery_id) FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.name = 'Stevens Point Brewery'
4,998
moderate
cs_semester
Among students registered for the most difficult course, list the students' full names who got grade A.
difficulty refers to diff; most difficult course refers to MAX(diff); student's full names = f_name, l_name;
SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T2.grade = 'A' ORDER BY T3.diff DESC LIMIT 1
4,111
moderate
cs_semester
For the students with an intelligence of 5, list the full name and courses taken by them who have less than a 3 GPA.
full name of the students = f_name, l_name; gpa < 3;
SELECT T1.f_name, T1.l_name, T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.intelligence = 5 AND T1.gpa < 3
5,051
moderate
cs_semester
What is the average GPA of the students with the highest research capability and high salary? List the full names of the students.
the highest research capability refers to capability = 5; high salary refers to salary = 'high'; prof_id refers to professor’s ID; GPA is an abbreviated name of Grade Point Average where average GPA refers to AVG(gpa);
SELECT AVG(T2.gpa), T2.f_name, T2.l_name FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T1.capability = 5 GROUP BY T2.student_id
2,723
moderate
cs_semester
Which student is more satisfied with the course Machine Learning Theory, Willie Rechert or Laughton Antonio?
sat refers to student's satisfaction degree with the course; more satisfied refers to MAX(sat);
SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE (T1.f_name = 'Laughton' OR T1.f_name = 'Willie') AND (T1.l_name = 'Antonio' OR T1.l_name = 'Rechert') AND T3.name = 'Machine Learning Theory' ORDER BY T2.sat DESC LIMIT 1
5,138
moderate
cs_semester
Among students that gave satisfaction of value 4 for the course named "Statistical Learning", how many of them have a gpa of 3.8?
satisfaction refers to sat; sat = 4; gpa = 3.8
SELECT COUNT(T1.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Statistical learning' AND T2.sat = 4 AND T1.gpa = 3.8
619
moderate
cs_semester
Among undergraduate students, list the name of the course with the highest student satisfaction.
Undergraduate students refers to type = 'UG'; satisfaction refers to sat; highest satisfaction refers to MAX(sat);
SELECT T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.type = 'UG' ORDER BY T2.sat DESC LIMIT 1
1,196
moderate
cs_semester
Among the students with a capability below 3, what is the difference of undergraduate students from research postgraduate students?
capability < 3; difference = subtract(count(type = 'UG')), (count(type = 'RPG')); undergraduate students refers to type = 'UG'; research postgraduate students refers to type = 'RPG';
SELECT SUM(CASE WHEN T2.type = 'UG' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.type = 'RPG' THEN 1 ELSE 0 END) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.capability < 3
4,055
moderate
cs_semester
What is the percentage of students who get a "B" in the course "Computer Network"?
DIVIDE(COUNT(student_id(grade = 'B' and name = 'Computer Network')), COUNT(student_id where name = ' Computer Network')) as percentage;
SELECT CAST(SUM(CASE WHEN T1.grade = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Computer Network'
3,164
moderate
cs_semester
What is the percentage of Professor Ogdon Zywicki's research assistants are taught postgraduate students?
research assistant refers to the student who serves for research where the abbreviation is RA; taught postgraduate student refers to type = 'TPG'; DIVIDE(COUNT(student_id where type = 'TPG' and first_name = 'Ogdon', last_name = 'Zywicki'), COUNT(first_name = 'Ogdon', last_name = 'Zywicki')) as percentage;
SELECT CAST(SUM(CASE WHEN T3.type = 'TPG' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
323
moderate
cs_semester
Give the grade score for Rik Unsworth in "Computer Network".
Academic grades awarded for participation in a course are A, B, C, D and F where Grade 'A' means excellent, Grade 'B' means good, Grade 'C' means fair, Grade 'D' means poorly pass, if grade is null or empty, it means that this student fails to pass this course in which grade = NULL;
SELECT CASE grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 ELSE 1 END AS result FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE f_name = 'Rik' AND l_name = 'Unsworth' AND course_id IN ( SELECT course_id FROM course WHERE name = 'Computer Network' ) )
336
moderate
cs_semester
Among the professors with more than average teaching ability, list the full name and email address of the professors who advise two or more students.
more than average teaching ability refers to teachingability > AVG(teachingability); full_name of the professor = first_name, last_name; email address of the professor refers to email; advises two or more students refers to COUNT(student_id) > = 2;
SELECT T2.first_name, T2.last_name, T2.email FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability > ( SELECT AVG(teachingability) FROM prof ) GROUP BY T2.prof_id HAVING COUNT(T1.student_id) >= 2
669
moderate
cs_semester
For the professors who advise more than 2 students, which professor has a higher teaching ability? Give the full name.
professor advising more than 2 students refers to COUNT(student_id) > 2; higher teachability refers to MAX(teachingability); full name refers to f_name and l_name;
SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, T2.teachingability FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id HAVING COUNT(student_id) > 2 ) T ORDER BY T.teachingability DESC LIMIT 1
5,685
moderate
cs_semester
Among the professors with a teachability of 3 and below, what is the percentage of their student advisees with a low salary?
teachability < = 3; percentage = MULTIPLY(DIVIDE(COUNT(salary = 'low'), COUNT(salary)), 1.0);
SELECT CAST(SUM(CASE WHEN T1.salary = 'low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.salary) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability < 3
4,358
moderate
cs_semester
Calculate the GPA of the semester for Laughton Antonio.
GPA of the semester = DIVIDE(SUM(MULTIPLY(credit, grade)), SUM(credit)); grade 'A' refers to gpa = 4; grade 'B' refers to gpa = 3; grade 'C' refers to gpa = 2; grade 'D' refers to gpa = 1;
SELECT CAST(SUM(T3.credit * CASE T1.grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 WHEN 'D' THEN 1 ELSE 1 END) AS REAL) / COUNT(T3.credit) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.f_name = 'Laughton' AND T2.l_name = 'Antonio'
5,415
moderate
cs_semester
Find the university from which the professor who advised most undergraduate students graduated.
university from which the professor graduated refers to graduate_from; undergraduate students refers to type = 'UG';
SELECT T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.type = 'UG' GROUP BY T1.prof_id ORDER BY COUNT(T2.student_id) DESC LIMIT 1
3,438
moderate
cs_semester
List the student's email with grade of B in a course with difficulty greater than the 80% of average difficulty of all courses.
difficulty refers to diff; course with difficulty greater than the 80% of average difficulty refers to diff > MULTIPLY(AVG(diff), 80%);
SELECT T2.email FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T1.grade = 'B' GROUP BY T3.diff HAVING T3.diff > AVG(T3.diff) * 0.8
6,035
moderate
cs_semester
Give the full name and capability of students who failed in any courses.
full name of students = f_name, l_name; failed refers to grade IS NULL;
SELECT T2.f_name, T2.l_name, T1.capability FROM RA AS T1 INNER JOIN student AS T2 ON T2.student_id = T1.student_id INNER JOIN registration AS T3 ON T2.student_id = T3.student_id WHERE T3.grade IS NULL OR T3.grade = ''
2,862
moderate
cs_semester
Please give the name of the course in which most numbers of the students got an A. Also, list the full name of the students who got an A in this course.
most number of students got an A refers MAX(COUNT(student_id WHERE grade = 'A')); full name = f_name, l_name; got an A refers to grade = 'A';
SELECT T3.name, T2.f_name, T2.l_name FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T1.grade = 'A' GROUP BY T3.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1
4,458
moderate
cs_semester
Name the students of the Advanced Database Systems course with the highest satisfaction.
full the students = f_name, l_name; course refers to name; satisfaction refers to sat; highest satisfaction refers to MAX(sat);
SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Advanced Database Systems' ORDER BY T2.sat DESC LIMIT 1
1,974
moderate
cs_semester
Calculate the difference between the average satisfaction of the students with high salaries and no salary.
average satisfaction difference = SUBTRACT(AVG(sat where salary = 'high')), (AVG(sat where salary = 'free')); satisfaction refers to sat; no salary refers to salary = 'free';
SELECT AVG(T2.sat) - ( SELECT AVG(T2.sat) FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free' ) AS diff FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high'
4,133
moderate
cs_semester
Which professor advised Willie Rechert to work as a research assistant? Please give his or her full name.
research assistant refers to the student who serves for research where the abbreviation is RA; prof_id refers to professor’s ID; full name refers to f_name and l_name;
SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Willie' AND T3.l_name = 'Rechert'
5,481
moderate
cs_semester
List the student's first and last name that got a C in the course named "Applied Deep Learning".
student's first name refers to f_name; student's last name refers to l_name; got a C refers to grade = 'C';
SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning ' AND T2.grade = 'C'
139
moderate
disney
Among the movies directed by Wolfgang Reitherman, how many of them are Comedies?
directed by Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; comedies refers to genre = 'Comedy'; movies refer to movie_title;
SELECT COUNT(T3.name) FROM ( SELECT T2.name FROM `movies_total_gross` AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Wolfgang Reitherman' AND T1.genre = 'Comedy' GROUP BY T2.name ) T3
4,473
moderate
disney
Find the estimated inflation rate that was used to adjust the 1995 box office revenue for Disney's films.
DIVIDE(inflation_adjusted_gross, total_gross) as percentage where substr(release_date, length(release_date) - 3, length(release_date)) = '1995';
SELECT SUM(CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL)) / SUM(CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL)) FROM movies_total_gross WHERE SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '1995' GROUP BY SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '1995'
3,239
challenging
disney
Among Frank Welker's voice-acted movies, list the movie titles and the total gross when the estimated inflation rate was less than 2.
Frank Welker refers to voice-actor = 'Frank Welker'; estimated inflation rate was less than 2 can be computed as follows DIVIDE(inflation_adjusted_gross, total_gross) as percentage < 2;
SELECT T1.movie_title, T1.total_gross FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Frank Welker' AND CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) * 1.0 / CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) * 1.0 < 2
59
challenging