db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
soccer_1 | select distinct t1.player_name from player as t1 join player_attributes as t2 on t1.player_api_id = t2.player_api_id where t2.preferred_foot = 'left' and t2.overall_rating >= 85 and t2.overall_rating <= 90 | Question: list the names of all left-footed players who have overall rating between 85 and 90. | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, d... | list the names of all left-footed players who have overall rating between 85 and 90. |
soccer_1 | select preferred_foot , avg(overall_rating) from player_attributes group by preferred_foot | Question: what is the average rating for right-footed players and left-footed players? | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling... | what is the average rating for right-footed players and left-footed players? |
soccer_1 | select preferred_foot , count(*) from player_attributes where overall_rating > 80 group by preferred_foot | Question: of all players with an overall rating greater than 80, how many are right-footed and left-footed? | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passin... | of all players with an overall rating greater than 80, how many are right-footed and left-footed? |
soccer_1 | select player_api_id from player where height >= 180 intersect select player_api_id from player_attributes where overall_rating > 85 | Question: list all of the player ids with a height of at least 180cm and an overall rating higher than 85. | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing... | list all of the player ids with a height of at least 180cm and an overall rating higher than 85. |
soccer_1 | select player_api_id from player where height >= 180 and height <= 190 intersect select player_api_id from player_attributes where preferred_foot = 'left' | Question: list all of the ids for left-footed players with a height between 180cm and 190cm. | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dri... | list all of the ids for left-footed players with a height between 180cm and 190cm. |
soccer_1 | select distinct t1.player_name from player as t1 join player_attributes as t2 on t1.player_api_id = t2.player_api_id order by overall_rating desc limit 3 | Question: who are the top 3 players in terms of overall rating? | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling, curve, free_kick_accu... | who are the top 3 players in terms of overall rating? |
soccer_1 | select distinct t1.player_name , t1.birthday from player as t1 join player_attributes as t2 on t1.player_api_id = t2.player_api_id order by potential desc limit 5 | Question: list the names and birthdays of the top five players in terms of potential. | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling,... | list the names and birthdays of the top five players in terms of potential. |
performance_attendance | select count(*) from performance | Question: how many performances are there? | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performance.Performance_ID, member_attendance.Mem... | how many performances are there? |
performance_attendance | select host from performance order by attendance asc | Question: list the hosts of performances in ascending order of attendance. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performance.Perfo... | list the hosts of performances in ascending order of attendance. |
performance_attendance | select date , location from performance | Question: what are the dates and locations of performances? | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performance.Performance_ID, memb... | what are the dates and locations of performances? |
performance_attendance | select attendance from performance where location = 'td garden' or location = 'bell centre' | Question: show the attendances of the performances at location 'td garden' or 'bell centre' | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = ... | show the attendances of the performances at location 'td garden' or 'bell centre' |
performance_attendance | select avg(attendance) from performance | Question: what is the average number of attendees for performances? | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performance.Performance_... | what is the average number of attendees for performances? |
performance_attendance | select date from performance order by attendance desc limit 1 | Question: what is the date of the performance with the highest number of attendees? | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performa... | what is the date of the performance with the highest number of attendees? |
performance_attendance | select location , count(*) from performance group by location | Question: show different locations and the number of performances at each location. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performa... | show different locations and the number of performances at each location. |
performance_attendance | select location from performance group by location order by count(*) desc limit 1 | Question: show the most common location of performances. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performance.Performance_ID, member_... | show the most common location of performances. |
performance_attendance | select location from performance group by location having count(*) >= 2 | Question: show the locations that have at least two performances. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performance.Performance_ID... | show the locations that have at least two performances. |
performance_attendance | select location from performance where attendance > 2000 intersect select location from performance where attendance < 1000 | Question: show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. |... | show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees. |
performance_attendance | select t2.name , t3.location from member_attendance as t1 join member as t2 on t1.member_id = t2.member_id join performance as t3 on t1.performance_id = t3.performance_id | Question: show the names of members and the location of the performances they attended. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = perf... | show the names of members and the location of the performances they attended. |
performance_attendance | select t2.name , t3.location from member_attendance as t1 join member as t2 on t1.member_id = t2.member_id join performance as t3 on t1.performance_id = t3.performance_id order by t2.name asc | Question: show the names of members and the location of performances they attended in ascending alphabetical order of their names. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joi... | show the names of members and the location of performances they attended in ascending alphabetical order of their names. |
performance_attendance | select t3.date from member_attendance as t1 join member as t2 on t1.member_id = t2.member_id join performance as t3 on t1.performance_id = t3.performance_id where t2.role = 'violin' | Question: show the dates of performances with attending members whose roles are 'violin'. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = pe... | show the dates of performances with attending members whose roles are 'violin'. |
performance_attendance | select t2.name , t3.date from member_attendance as t1 join member as t2 on t1.member_id = t2.member_id join performance as t3 on t1.performance_id = t3.performance_id order by t3.attendance desc | Question: show the names of members and the dates of performances they attended in descending order of attendance of the performances. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. |... | show the names of members and the dates of performances they attended in descending order of attendance of the performances. |
performance_attendance | select name from member where member_id not in (select member_id from member_attendance) | Question: list the names of members who did not attend any performance. | Tables: member -> Member_ID, Name, Nationality, Role. performance -> Performance_ID, Date, Host, Location, Attendance. member_attendance -> Member_ID, Performance_ID, Num_of_Pieces. | Joins: member_attendance.Performance_ID = performance.Performa... | list the names of members who did not attend any performance. |
college_2 | select distinct building from classroom where capacity > 50 | Question: find the buildings which have rooms with capacity more than 50. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, ... | find the buildings which have rooms with capacity more than 50. |
college_2 | select distinct building from classroom where capacity > 50 | Question: what are the distinct buildings with capacities of greater than 50? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buildi... | what are the distinct buildings with capacities of greater than 50? |
college_2 | select count(*) from classroom where building != 'lamberton' | Question: count the number of rooms that are not in the lamberton building. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building... | count the number of rooms that are not in the lamberton building. |
college_2 | select count(*) from classroom where building != 'lamberton' | Question: how many classrooms are not in lamberton? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, time_slot... | how many classrooms are not in lamberton? |
college_2 | select dept_name , building from department where budget > (select avg(budget) from department) | Question: what is the name and building of the departments whose budget is more than the average budget? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec... | what is the name and building of the departments whose budget is more than the average budget? |
college_2 | select dept_name , building from department where budget > (select avg(budget) from department) | Question: give the name and building of the departments with greater than average budget. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, ... | give the name and building of the departments with greater than average budget. |
college_2 | select building , room_number from classroom where capacity between 50 and 100 | Question: find the room number of the rooms which can sit 50 to 100 students and their buildings. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, se... | find the room number of the rooms which can sit 50 to 100 students and their buildings. |
college_2 | select building , room_number from classroom where capacity between 50 and 100 | Question: what are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section ... | what are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students? |
college_2 | select dept_name , building from department order by budget desc limit 1 | Question: find the name and building of the department with the highest budget. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buil... | find the name and building of the department with the highest budget. |
college_2 | select dept_name , building from department order by budget desc limit 1 | Question: what is the department name and corresponding building for the department with the greatest budget? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id... | what is the department name and corresponding building for the department with the greatest budget? |
college_2 | select name from student where dept_name = 'history' order by tot_cred desc limit 1 | Question: what is the name of the student who has the highest total credits in the history department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_i... | what is the name of the student who has the highest total credits in the history department. |
college_2 | select name from student where dept_name = 'history' order by tot_cred desc limit 1 | Question: give the name of the student in the history department with the most credits. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, ye... | give the name of the student in the history department with the most credits. |
college_2 | select count(*) from classroom where building = 'lamberton' | Question: how many rooms does the lamberton building have? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, ti... | how many rooms does the lamberton building have? |
college_2 | select count(*) from classroom where building = 'lamberton' | Question: count the number of classrooms in lamberton. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, time_s... | count the number of classrooms in lamberton. |
college_2 | select count(distinct s_id) from advisor | Question: how many students have advisors? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, time_slot_id. teac... | how many students have advisors? |
college_2 | select count(distinct s_id) from advisor | Question: count the number of students who have advisors. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, tim... | count the number of students who have advisors. |
college_2 | select count(distinct dept_name) from course | Question: how many departments offer courses? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, time_slot_id. t... | how many departments offer courses? |
college_2 | select count(distinct dept_name) from course | Question: count the number of departments which offer courses. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number... | count the number of departments which offer courses. |
college_2 | select count(distinct course_id) from course where dept_name = 'physics' | Question: how many different courses offered by physics department? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_n... | how many different courses offered by physics department? |
college_2 | select count(distinct course_id) from course where dept_name = 'physics' | Question: count the number of courses in the physics department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_numb... | count the number of courses in the physics department. |
college_2 | select t1.title from course as t1 join prereq as t2 on t1.course_id = t2.course_id group by t2.course_id having count(*) = 2 | Question: find the title of courses that have two prerequisites? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_numb... | find the title of courses that have two prerequisites? |
college_2 | select t1.title from course as t1 join prereq as t2 on t1.course_id = t2.course_id group by t2.course_id having count(*) = 2 | Question: what are the titles for courses with two prerequisites? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_num... | what are the titles for courses with two prerequisites? |
college_2 | select t1.title , t1.credits , t1.dept_name from course as t1 join prereq as t2 on t1.course_id = t2.course_id group by t2.course_id having count(*) > 1 | Question: find the title, credit, and department name of courses that have more than one prerequisites? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_... | find the title, credit, and department name of courses that have more than one prerequisites? |
college_2 | select t1.title , t1.credits , t1.dept_name from course as t1 join prereq as t2 on t1.course_id = t2.course_id group by t2.course_id having count(*) > 1 | Question: what is the title, credit value, and department name for courses with more than one prerequisite? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, ... | what is the title, credit value, and department name for courses with more than one prerequisite? |
college_2 | select count(*) from course where course_id not in (select course_id from prereq) | Question: how many courses that do not have prerequisite? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, tim... | how many courses that do not have prerequisite? |
college_2 | select count(*) from course where course_id not in (select course_id from prereq) | Question: count the number of courses without prerequisites. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, ... | count the number of courses without prerequisites. |
college_2 | select title from course where course_id not in (select course_id from prereq) | Question: find the name of the courses that do not have any prerequisite? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, ... | find the name of the courses that do not have any prerequisite? |
college_2 | select title from course where course_id not in (select course_id from prereq) | Question: what are the titles of courses without prerequisites? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_numbe... | what are the titles of courses without prerequisites? |
college_2 | select count (distinct id) from teaches | Question: how many different instructors have taught some course? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_num... | how many different instructors have taught some course? |
college_2 | select count (distinct id) from teaches | Question: count the number of distinct instructors who have taught a course. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buildin... | count the number of distinct instructors who have taught a course. |
college_2 | select sum(budget) from department where dept_name = 'marketing' or dept_name = 'finance' | Question: find the total budgets of the marketing or finance department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, r... | find the total budgets of the marketing or finance department. |
college_2 | select sum(budget) from department where dept_name = 'marketing' or dept_name = 'finance' | Question: what is the sum of budgets of the marketing and finance departments? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, build... | what is the sum of budgets of the marketing and finance departments? |
college_2 | select dept_name from instructor where name like '%soisalon%' | Question: find the department name of the instructor whose name contains 'soisalon'. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year,... | find the department name of the instructor whose name contains 'soisalon'. |
college_2 | select dept_name from instructor where name like '%soisalon%' | Question: what is the name of the department with an instructure who has a name like 'soisalon'? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, sem... | what is the name of the department with an instructure who has a name like 'soisalon'? |
college_2 | select count(*) from classroom where building = 'lamberton' and capacity < 50 | Question: how many rooms whose capacity is less than 50 does the lamberton building have? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, ... | how many rooms whose capacity is less than 50 does the lamberton building have? |
college_2 | select count(*) from classroom where building = 'lamberton' and capacity < 50 | Question: count the number of rooms in lamberton with capacity lower than 50. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buildi... | count the number of rooms in lamberton with capacity lower than 50. |
college_2 | select dept_name , budget from department where budget > (select avg(budget) from department) | Question: find the name and budget of departments whose budgets are more than the average budget. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, se... | find the name and budget of departments whose budgets are more than the average budget. |
college_2 | select dept_name , budget from department where budget > (select avg(budget) from department) | Question: what are the names and budgets of departments with budgets greater than the average? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semes... | what are the names and budgets of departments with budgets greater than the average? |
college_2 | select name from instructor where dept_name = 'statistics' order by salary limit 1 | Question: what is the name of the instructor who is in statistics department and earns the lowest salary? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, se... | what is the name of the instructor who is in statistics department and earns the lowest salary? |
college_2 | select name from instructor where dept_name = 'statistics' order by salary limit 1 | Question: give the name of the lowest earning instructor in the statistics department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, yea... | give the name of the lowest earning instructor in the statistics department. |
college_2 | select title from course where dept_name = 'statistics' intersect select title from course where dept_name = 'psychology' | Question: find the title of course that is provided by both statistics and psychology departments. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, s... | find the title of course that is provided by both statistics and psychology departments. |
college_2 | select title from course where dept_name = 'statistics' intersect select title from course where dept_name = 'psychology' | Question: what is the title of a course that is listed in both the statistics and psychology departments? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, se... | what is the title of a course that is listed in both the statistics and psychology departments? |
college_2 | select title from course where dept_name = 'statistics' except select title from course where dept_name = 'psychology' | Question: find the title of course that is provided by statistics but not psychology departments. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, se... | find the title of course that is provided by statistics but not psychology departments. |
college_2 | select title from course where dept_name = 'statistics' except select title from course where dept_name = 'psychology' | Question: what are the titles of courses that are in the statistics department but not the psychology department? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> cours... | what are the titles of courses that are in the statistics department but not the psychology department? |
college_2 | select id from teaches where semester = 'fall' and year = 2009 except select id from teaches where semester = 'spring' and year = 2010 | Question: find the id of instructors who taught a class in fall 2009 but not in spring 2010. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semeste... | find the id of instructors who taught a class in fall 2009 but not in spring 2010. |
college_2 | select id from teaches where semester = 'fall' and year = 2009 except select id from teaches where semester = 'spring' and year = 2010 | Question: what are the ids of instructors who taught in the fall of 2009 but not in the spring of 2010? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_... | what are the ids of instructors who taught in the fall of 2009 but not in the spring of 2010? |
college_2 | select distinct t1.name from student as t1 join takes as t2 on t1.id = t2.id where year = 2009 or year = 2010 | Question: find the name of students who took any class in the years of 2009 and 2010. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year... | find the name of students who took any class in the years of 2009 and 2010. |
college_2 | select distinct t1.name from student as t1 join takes as t2 on t1.id = t2.id where year = 2009 or year = 2010 | Question: what are the names of the students who took classes in 2009 or 2010? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, build... | what are the names of the students who took classes in 2009 or 2010? |
college_2 | select dept_name from course group by dept_name order by count(*) desc limit 3 | Question: find the names of the top 3 departments that provide the largest amount of courses? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semest... | find the names of the top 3 departments that provide the largest amount of courses? |
college_2 | select dept_name from course group by dept_name order by count(*) desc limit 3 | Question: what are the names of the 3 departments with the most courses? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, r... | what are the names of the 3 departments with the most courses? |
college_2 | select dept_name from course group by dept_name order by sum(credits) desc limit 1 | Question: find the name of the department that offers the highest total credits? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, bui... | find the name of the department that offers the highest total credits? |
college_2 | select dept_name from course group by dept_name order by sum(credits) desc limit 1 | Question: what is the name of the department with the most credits? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_n... | what is the name of the department with the most credits? |
college_2 | select title from course order by title , credits | Question: list the names of all courses ordered by their titles and credits. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buildin... | list the names of all courses ordered by their titles and credits. |
college_2 | select title from course order by title , credits | Question: given the titles of all courses, in order of titles and credits. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building,... | given the titles of all courses, in order of titles and credits. |
college_2 | select dept_name from department order by budget limit 1 | Question: which department has the lowest budget? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, time_slot_i... | which department has the lowest budget? |
college_2 | select dept_name from department order by budget limit 1 | Question: give the name of the department with the lowest budget. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_num... | give the name of the department with the lowest budget. |
college_2 | select dept_name , building from department order by budget desc | Question: list the names and buildings of all departments sorted by the budget from large to small. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, ... | list the names and buildings of all departments sorted by the budget from large to small. |
college_2 | select dept_name , building from department order by budget desc | Question: what are the names and buildings of the deparments, sorted by budget descending? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester,... | what are the names and buildings of the deparments, sorted by budget descending? |
college_2 | select name from instructor order by salary desc limit 1 | Question: who is the instructor with the highest salary? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, time... | who is the instructor with the highest salary? |
college_2 | select name from instructor order by salary desc limit 1 | Question: give the name of the highest paid instructor. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_number, time_... | give the name of the highest paid instructor. |
college_2 | select * from instructor order by salary | Question: list the information of all instructors ordered by their salary in ascending order. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semest... | list the information of all instructors ordered by their salary in ascending order. |
college_2 | select * from instructor order by salary | Question: give all information regarding instructors, in order of salary from least to greatest. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, sem... | give all information regarding instructors, in order of salary from least to greatest. |
college_2 | select name , dept_name from student order by tot_cred | Question: find the name of the students and their department names sorted by their total credits in ascending order. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> co... | find the name of the students and their department names sorted by their total credits in ascending order. |
college_2 | select name , dept_name from student order by tot_cred | Question: what are the names of students and their respective departments, ordered by number of credits from least to greatest? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. se... | what are the names of students and their respective departments, ordered by number of credits from least to greatest? |
college_2 | select t1.title , t3.name from course as t1 join teaches as t2 on t1.course_id = t2.course_id join instructor as t3 on t2.id = t3.id where year = 2008 order by t1.title | Question: list in alphabetic order all course names and their instructors' names in year 2008. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semes... | list in alphabetic order all course names and their instructors' names in year 2008. |
college_2 | select t1.title , t3.name from course as t1 join teaches as t2 on t1.course_id = t2.course_id join instructor as t3 on t2.id = t3.id where year = 2008 order by t1.title | Question: show all titles and their instructors' names for courses in 2008, in alphabetical order by title. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, ... | show all titles and their instructors' names for courses in 2008, in alphabetical order by title. |
college_2 | select t1.name from instructor as t1 join advisor as t2 on t1.id = t2.i_id group by t2.i_id having count(*) > 1 | Question: find the name of instructors who are advising more than one student. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, build... | find the name of instructors who are advising more than one student. |
college_2 | select t1.name from instructor as t1 join advisor as t2 on t1.id = t2.i_id group by t2.i_id having count(*) > 1 | Question: what are the names of instructors who advise more than one student? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buildi... | what are the names of instructors who advise more than one student? |
college_2 | select t1.name from student as t1 join advisor as t2 on t1.id = t2.s_id group by t2.s_id having count(*) > 1 | Question: find the name of the students who have more than one advisor? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, ro... | find the name of the students who have more than one advisor? |
college_2 | select t1.name from student as t1 join advisor as t2 on t1.id = t2.s_id group by t2.s_id having count(*) > 1 | Question: what are the names of students who have more than one advisor? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, r... | what are the names of students who have more than one advisor? |
college_2 | select count(*) , building from classroom where capacity > 50 group by building | Question: find the number of rooms with more than 50 capacity for each building. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, bui... | find the number of rooms with more than 50 capacity for each building. |
college_2 | select count(*) , building from classroom where capacity > 50 group by building | Question: how many rooms in each building have a capacity of over 50? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room... | how many rooms in each building have a capacity of over 50? |
college_2 | select max(capacity) , avg(capacity) , building from classroom group by building | Question: find the maximum and average capacity among rooms in each building. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buildi... | find the maximum and average capacity among rooms in each building. |
college_2 | select max(capacity) , avg(capacity) , building from classroom group by building | Question: what are the greatest and average capacity for rooms in each building? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, bui... | what are the greatest and average capacity for rooms in each building? |
college_2 | select title from course group by title having count(*) > 1 | Question: find the title of the course that is offered by more than one department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, ... | find the title of the course that is offered by more than one department. |
college_2 | select title from course group by title having count(*) > 1 | Question: what are the titles of courses that are offered in more than one department? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, yea... | what are the titles of courses that are offered in more than one department? |
college_2 | select sum(credits) , dept_name from course group by dept_name | Question: find the total credits of courses provided by different department. | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, buildi... | find the total credits of courses provided by different department. |
college_2 | select sum(credits) , dept_name from course group by dept_name | Question: how many total credits are offered by each department? | Tables: classroom -> building, room_number, capacity. department -> dept_name, building, budget. course -> course_id, title, dept_name, credits. instructor -> ID, name, dept_name, salary. section -> course_id, sec_id, semester, year, building, room_numb... | how many total credits are offered by each department? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.