cnatale/presto-athena-txt-2-sql huggingface dataset:
Show the attendances of the performances at location 'TD Garden' or 'Bell Centre'
Additional table information: table: performance_attendance
SQL: SELECT Attendance FROM performance WHERE LOCATION = 'TD Garden' OR LOCATION = 'Bell Centre'
What is the average number of attendees for performances?
Additional table information: table: performance_attendance
SQL: SELECT AVG(Attendance) FROM performance
What is the date of the performance with the highest number of attendees?
Additional table information: table: performance_attendance
SQL: SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1
Show different locations and the number of performances at each location.
Additional table information: table: performance_attendance
SQL: SELECT LOCATION, COUNT(*) FROM performance GROUP BY LOCATION
Show the most common location of performances.
Additional table information: table: performance_attendance
SQL: SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
Show the locations that have at least two performances.
Additional table information: table: performance_attendance
SQL: SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2
Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.
Additional table information: table: performance_attendance
SQL: SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000
Show the names of members and the location of the performances they attended.
Additional table information: table: performance_attendance
SQL: 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
Show the names of members and the location of performances they attended in ascending alphabetical order of their names.
Additional table information: table: performance_attendance
SQL: 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 NULLS FIRST
Show the dates of performances with attending members whose roles are 'Violin'.
Additional table information: table: performance_attendance
SQL: 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'
Show the names of members and the dates of performances they attended in descending order of attendance of the performances.
Additional table information: table: performance_attendance
SQL: 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
List the names of members who did not attend any performance.
Additional table information: table: performance_attendance
SQL: SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM member_attendance)
Find the buildings which have rooms with capacity more than 50.
Additional table information: table: college_2
SQL: SELECT DISTINCT building FROM classroom WHERE capacity > 50
What are the distinct buildings with capacities of greater than 50?
Additional table information: table: college_2
SQL: SELECT DISTINCT building FROM classroom WHERE capacity > 50
Count the number of rooms that are not in the Lamberton building.
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'
How many classrooms are not in Lamberton?
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'
What is the name and building of the departments whose budget is more than the average budget?
Additional table information: table: college_2
SQL: SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department)
Give the name and building of the departments with greater than average budget.
Additional table information: table: college_2
SQL: SELECT dept_name, building FROM department WHERE budget > (SELECT AVG(budget) FROM department)
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
Additional table information: table: college_2
SQL: SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?
Additional table information: table: college_2
SQL: SELECT building, room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
Find the name and building of the department with the highest budget.
Additional table information: table: college_2
SQL: SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1
What is the department name and corresponding building for the department with the greatest budget?
Additional table information: table: college_2
SQL: SELECT dept_name, building FROM department ORDER BY budget DESC LIMIT 1
What is the name of the student who has the highest total credits in the History department.
Additional table information: table: college_2
SQL: SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
Give the name of the student in the History department with the most credits.
Additional table information: table: college_2
SQL: SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
How many rooms does the Lamberton building have?
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'
Count the number of classrooms in Lamberton.
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'
How many students have advisors?
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT s_id) FROM advisor
Count the number of students who have advisors.
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT s_id) FROM advisor
How many departments offer courses?
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT dept_name) FROM course
Count the number of departments which offer courses.
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT dept_name) FROM course
How many different courses offered by Physics department?
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
Count the number of courses in the Physics department.
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
Find the title of courses that have two prerequisites?
Additional table information: table: college_2
SQL: 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
What are the titles for courses with two prerequisites?
Additional table information: table: college_2
SQL: 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
Find the title, credit, and department name of courses that have more than one prerequisites?
Additional table information: table: college_2
SQL: 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
What is the title, credit value, and department name for courses with more than one prerequisite?
Additional table information: table: college_2
SQL: 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
How many courses that do not have prerequisite?
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
Count the number of courses without prerequisites.
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
Find the name of the courses that do not have any prerequisite?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
What are the titles of courses without prerequisites?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
How many different instructors have taught some course?
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT id) FROM teaches
Count the number of distinct instructors who have taught a course.
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT id) FROM teaches
Find the total budgets of the Marketing or Finance department.
Additional table information: table: college_2
SQL: SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
What is the sum of budgets of the Marketing and Finance departments?
Additional table information: table: college_2
SQL: SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
Find the department name of the instructor whose name contains 'Soisalon'.
Additional table information: table: college_2
SQL: SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
What is the name of the department with an instructure who has a name like 'Soisalon'?
Additional table information: table: college_2
SQL: SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
How many rooms whose capacity is less than 50 does the Lamberton building have?
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
Count the number of rooms in Lamberton with capacity lower than 50.
Additional table information: table: college_2
SQL: SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
Find the name and budget of departments whose budgets are more than the average budget.
Additional table information: table: college_2
SQL: SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
What are the names and budgets of departments with budgets greater than the average?
Additional table information: table: college_2
SQL: SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
what is the name of the instructor who is in Statistics department and earns the lowest salary?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary NULLS FIRST LIMIT 1
Give the name of the lowest earning instructor in the Statistics department.
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary NULLS FIRST LIMIT 1
Find the title of course that is provided by both Statistics and Psychology departments.
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
What is the title of a course that is listed in both the Statistics and Psychology departments?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
Find the title of course that is provided by Statistics but not Psychology departments.
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
What are the titles of courses that are in the Statistics department but not the Psychology department?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.
Additional table information: table: college_2
SQL: SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?
Additional table information: table: college_2
SQL: SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
Find the name of students who took any class in the years of 2009 and 2010.
Additional table information: table: college_2
SQL: SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010
What are the names of the students who took classes in 2009 or 2010?
Additional table information: table: college_2
SQL: SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010
Find the names of the top 3 departments that provide the largest amount of courses?
Additional table information: table: college_2
SQL: SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3
What are the names of the 3 departments with the most courses?
Additional table information: table: college_2
SQL: SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3
Find the name of the department that offers the highest total credits?
Additional table information: table: college_2
SQL: SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1
What is the name of the department with the most credits?
Additional table information: table: college_2
SQL: SELECT dept_name FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC LIMIT 1
List the names of all courses ordered by their titles and credits.
Additional table information: table: college_2
SQL: SELECT title FROM course ORDER BY title NULLS FIRST, credits NULLS FIRST
Given the titles of all courses, in order of titles and credits.
Additional table information: table: college_2
SQL: SELECT title FROM course ORDER BY title NULLS FIRST, credits NULLS FIRST
Which department has the lowest budget?
Additional table information: table: college_2
SQL: SELECT dept_name FROM department ORDER BY budget NULLS FIRST LIMIT 1
Give the name of the department with the lowest budget.
Additional table information: table: college_2
SQL: SELECT dept_name FROM department ORDER BY budget NULLS FIRST LIMIT 1
List the names and buildings of all departments sorted by the budget from large to small.
Additional table information: table: college_2
SQL: SELECT dept_name, building FROM department ORDER BY budget DESC
What are the names and buildings of the deparments, sorted by budget descending?
Additional table information: table: college_2
SQL: SELECT dept_name, building FROM department ORDER BY budget DESC
Who is the instructor with the highest salary?
Additional table information: table: college_2
SQL: SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
Give the name of the highest paid instructor.
Additional table information: table: college_2
SQL: SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
List the information of all instructors ordered by their salary in ascending order.
Additional table information: table: college_2
SQL: SELECT * FROM instructor ORDER BY salary NULLS FIRST
Give all information regarding instructors, in order of salary from least to greatest.
Additional table information: table: college_2
SQL: SELECT * FROM instructor ORDER BY salary NULLS FIRST
Find the name of the students and their department names sorted by their total credits in ascending order.
Additional table information: table: college_2
SQL: SELECT name, dept_name FROM student ORDER BY tot_cred NULLS FIRST
What are the names of students and their respective departments, ordered by number of credits from least to greatest?
Additional table information: table: college_2
SQL: SELECT name, dept_name FROM student ORDER BY tot_cred NULLS FIRST
list in alphabetic order all course names and their instructors' names in year 2008.
Additional table information: table: college_2
SQL: 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 NULLS FIRST
Show all titles and their instructors' names for courses in 2008, in alphabetical order by title.
Additional table information: table: college_2
SQL: 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 NULLS FIRST
Find the name of instructors who are advising more than one student.
Additional table information: table: college_2
SQL: 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
What are the names of instructors who advise more than one student?
Additional table information: table: college_2
SQL: 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
Find the name of the students who have more than one advisor?
Additional table information: table: college_2
SQL: 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
What are the names of students who have more than one advisor?
Additional table information: table: college_2
SQL: 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
Find the number of rooms with more than 50 capacity for each building.
Additional table information: table: college_2
SQL: SELECT COUNT(*), building FROM classroom WHERE capacity > 50 GROUP BY building
How many rooms in each building have a capacity of over 50?
Additional table information: table: college_2
SQL: SELECT COUNT(*), building FROM classroom WHERE capacity > 50 GROUP BY building
Find the maximum and average capacity among rooms in each building.
Additional table information: table: college_2
SQL: SELECT MAX(capacity), AVG(capacity), building FROM classroom GROUP BY building
What are the greatest and average capacity for rooms in each building?
Additional table information: table: college_2
SQL: SELECT MAX(capacity), AVG(capacity), building FROM classroom GROUP BY building
Find the title of the course that is offered by more than one department.
Additional table information: table: college_2
SQL: SELECT title FROM course GROUP BY title HAVING COUNT(*) > 1
What are the titles of courses that are offered in more than one department?
Additional table information: table: college_2
SQL: SELECT title FROM course GROUP BY title HAVING COUNT(*) > 1
Find the total credits of courses provided by different department.
Additional table information: table: college_2
SQL: SELECT SUM(credits), dept_name FROM course GROUP BY dept_name
How many total credits are offered by each department?
Additional table information: table: college_2
SQL: SELECT SUM(credits), dept_name FROM course GROUP BY dept_name
Find the minimum salary for the departments whose average salary is above the average payment of all instructors.
Additional table information: table: college_2
SQL: SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)
What is the lowest salary in departments with average salary greater than the overall average.
Additional table information: table: college_2
SQL: SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)
Find the number of courses provided in each semester and year.
Additional table information: table: college_2
SQL: SELECT COUNT(*), semester, YEAR FROM SECTION GROUP BY semester, YEAR
How many courses are provided in each semester and year?
Additional table information: table: college_2
SQL: SELECT COUNT(*), semester, YEAR FROM SECTION GROUP BY semester, YEAR
Find the year which offers the largest number of courses.
Additional table information: table: college_2
SQL: SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1
Which year had the greatest number of courses?
Additional table information: table: college_2
SQL: SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1
Find the year and semester when offers the largest number of courses.
Additional table information: table: college_2
SQL: SELECT semester, YEAR FROM SECTION GROUP BY semester, YEAR ORDER BY COUNT(*) DESC LIMIT 1
What is the year and semester with the most courses?
Additional table information: table: college_2
SQL: SELECT semester, YEAR FROM SECTION GROUP BY semester, YEAR ORDER BY COUNT(*) DESC LIMIT 1
Find the name of department has the highest amount of students?
Additional table information: table: college_2
SQL: SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the deparment with the highest enrollment?
Additional table information: table: college_2
SQL: SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1
Find the total number of students in each department.
Additional table information: table: college_2
SQL: SELECT COUNT(*), dept_name FROM student GROUP BY dept_name
How many students are in each department?
Additional table information: table: college_2
SQL: SELECT COUNT(*), dept_name FROM student GROUP BY dept_name
Find the semester and year which has the least number of student taking any class.
Additional table information: table: college_2
SQL: SELECT semester, YEAR FROM takes GROUP BY semester, YEAR ORDER BY COUNT(*) NULLS FIRST LIMIT 1
Which semeseter and year had the fewest students?
Additional table information: table: college_2
SQL: SELECT semester, YEAR FROM takes GROUP BY semester, YEAR ORDER BY COUNT(*) NULLS FIRST LIMIT 1
What is the id of the instructor who advises of all students from History department?
Additional table information: table: college_2
SQL: SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'
Give id of the instructor who advises students in the History department.
Additional table information: table: college_2
SQL: SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'
Find the name and salary of the instructors who are advisors of any student from History department?
Additional table information: table: college_2
SQL: SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'
What are the names and salaries of instructors who advises students in the History department?
Additional table information: table: college_2
SQL: SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'
Find the id of the courses that do not have any prerequisite?
Additional table information: table: college_2
SQL: SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq
What are the ids of courses without prerequisites?
Additional table information: table: college_2
SQL: SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq
What are the names of courses without prerequisites?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
What is the title of the prerequisite class of International Finance course?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')
Give the title of the prerequisite to the course International Finance.
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')
Find the title of course whose prerequisite is course Differential Geometry.
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')
What is the title of the course with Differential Geometry as a prerequisite?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')
Find the names of students who have taken any course in the fall semester of year 2003.
Additional table information: table: college_2
SQL: SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)
What are the names of students who took a course in the Fall of 2003?
Additional table information: table: college_2
SQL: SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)
What is the title of the course that was offered at building Chandler during the fall semester in the year of 2010?
Additional table information: table: college_2
SQL: SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010
Give the title of the course offered in Chandler during the Fall of 2010.
Additional table information: table: college_2
SQL: SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010
Find the name of the instructors who taught C Programming course before.
Additional table information: table: college_2
SQL: SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
What are the names of instructors who have taught C Programming courses?
Additional table information: table: college_2
SQL: SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
Find the name and salary of instructors who are advisors of the students from the Math department.
Additional table information: table: college_2
SQL: SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'
What are the names and salaries of instructors who advise students in the Math department?
Additional table information: table: college_2
SQL: SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'
Find the name of instructors who are advisors of the students from the Math department, and sort the results by students' total credit.
Additional table information: table: college_2
SQL: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred NULLS FIRST
What are the names of all instructors who advise students in the math depart sorted by total credits of the student.
Additional table information: table: college_2
SQL: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred NULLS FIRST
What is the course title of the prerequisite of course Mobile Computing?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')
What is the title of the course that is a prerequisite for Mobile Computing?
Additional table information: table: college_2
SQL: SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')
Find the name of instructor who is the advisor of the student who has the highest number of total credits.
Additional table information: table: college_2
SQL: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1
What is the name of the instructor who advises the student with the greatest number of total credits?
Additional table information: table: college_2
SQL: SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1
Find the name of instructors who didn't teach any courses?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches)
What are the names of instructors who didn't teach?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches)
Find the id of instructors who didn't teach any courses?
Additional table information: table: college_2
SQL: SELECT id FROM instructor EXCEPT SELECT id FROM teaches
What are the ids of instructors who didnt' teach?
Additional table information: table: college_2
SQL: SELECT id FROM instructor EXCEPT SELECT id FROM teaches
Find the names of instructors who didn't each any courses in any Spring semester.
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches WHERE semester = 'Spring')
What are the names of instructors who didn't teach courses in the Spring?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE NOT id IN (SELECT id FROM teaches WHERE semester = 'Spring')
Find the name of the department which has the highest average salary of professors.
Additional table information: table: college_2
SQL: SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1
Which department has the highest average instructor salary?
Additional table information: table: college_2
SQL: SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1
Find the number and averaged salary of all instructors who are in the department with the highest budget.
Additional table information: table: college_2
SQL: SELECT AVG(T1.salary), COUNT(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1
How many instructors are in the department with the highest budget, and what is their average salary?
Additional table information: table: college_2
SQL: SELECT AVG(T1.salary), COUNT(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1
What is the title and credits of the course that is taught in the largest classroom (with the highest capacity)?
Additional table information: table: college_2
SQL: SELECT T3.title, T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT MAX(capacity) FROM classroom)
Give the title and credits for the course that is taught in the classroom with the greatest capacity.
Additional table information: table: college_2
SQL: SELECT T3.title, T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT MAX(capacity) FROM classroom)
Find the name of students who didn't take any course from Biology department.
Additional table information: table: college_2
SQL: SELECT name FROM student WHERE NOT id IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')
What are the names of students who haven't taken any Biology courses?
Additional table information: table: college_2
SQL: SELECT name FROM student WHERE NOT id IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')
Find the total number of students and total number of instructors for each department.
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT T2.id), COUNT(DISTINCT T3.id), T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name
How many students and instructors are in each department?
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT T2.id), COUNT(DISTINCT T3.id), T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name
Find the name of students who have taken the prerequisite course of the course with title International Finance.
Additional table information: table: college_2
SQL: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')
What are the names of students who have taken the prerequisite for the course International Finance?
Additional table information: table: college_2
SQL: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')
Find the name and salary of instructors whose salary is below the average salary of the instructors in the Physics department.
Additional table information: table: college_2
SQL: SELECT name, salary FROM instructor WHERE salary < (SELECT AVG(salary) FROM instructor WHERE dept_name = 'Physics')
What are the names and salaries for instructors who earn less than the average salary of instructors in the Physics department?
Additional table information: table: college_2
SQL: SELECT name, salary FROM instructor WHERE salary < (SELECT AVG(salary) FROM instructor WHERE dept_name = 'Physics')
Find the name of students who took some course offered by Statistics department.
Additional table information: table: college_2
SQL: SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
What are the names of students who have taken Statistics courses?
Additional table information: table: college_2
SQL: SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
Find the building, room number, semester and year of all courses offered by Psychology department sorted by course titles.
Additional table information: table: college_2
SQL: SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title NULLS FIRST
What are the building, room number, semester and year of courses in the Psychology department, sorted using course title?
Additional table information: table: college_2
SQL: SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title NULLS FIRST
Find the names of all instructors in computer science department
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'
What are the names of all instructors in the Comp. Sci. department?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'
Find the names of all instructors in Comp. Sci. department with salary > 80000.
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000
What are the names of the instructors in the Comp. Sci. department who earn more than 80000?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000
Find the names of all instructors who have taught some course and the course_id.
Additional table information: table: college_2
SQL: SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID
What are the names of all instructors who have taught a course, as well as the corresponding course id?
Additional table information: table: college_2
SQL: SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID
Find the names of all instructors in the Art department who have taught some course and the course_id.
Additional table information: table: college_2
SQL: SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'
What are the names of Art instructors who have taught a course, and the corresponding course id?
Additional table information: table: college_2
SQL: SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'
Find the names of all instructors whose name includes the substring “dar”.
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE name LIKE '%dar%'
What are the names of all instructors with names that include 'dar'?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE name LIKE '%dar%'
List in alphabetic order the names of all distinct instructors.
Additional table information: table: college_2
SQL: SELECT DISTINCT name FROM instructor ORDER BY name NULLS FIRST
List the distinct names of the instructors, ordered by name.
Additional table information: table: college_2
SQL: SELECT DISTINCT name FROM instructor ORDER BY name NULLS FIRST
Find courses that ran in Fall 2009 or in Spring 2010.
Additional table information: table: college_2
SQL: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
What are the ids for courses in the Fall of 2009 or the Spring of 2010?
Additional table information: table: college_2
SQL: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
Find courses that ran in Fall 2009 and in Spring 2010.
Additional table information: table: college_2
SQL: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
What are the ids for courses that were offered in both Fall of 2009 and Spring of 2010?
Additional table information: table: college_2
SQL: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
Find courses that ran in Fall 2009 but not in Spring 2010.
Additional table information: table: college_2
SQL: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
What are the ids of courses offered in Fall of 2009 but not in Spring of 2010?
Additional table information: table: college_2
SQL: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
Find the salaries of all distinct instructors that are less than the largest salary.
Additional table information: table: college_2
SQL: SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT MAX(salary) FROM instructor)
What are the distinct salaries of all instructors who earned less than the maximum salary?
Additional table information: table: college_2
SQL: SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT MAX(salary) FROM instructor)
Find the total number of instructors who teach a course in the Spring 2010 semester.
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
How many instructors teach a course in the Spring of 2010?
Additional table information: table: college_2
SQL: SELECT COUNT(DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
Find the names and average salaries of all departments whose average salary is greater than 42000.
Additional table information: table: college_2
SQL: SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000
What are the names and average salaries for departments with average salary higher than 42000?
Additional table information: table: college_2
SQL: SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000
Find names of instructors with salary greater than that of some (at least one) instructor in the Biology department.
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE salary > (SELECT MIN(salary) FROM instructor WHERE dept_name = 'Biology')
What are the names of instructors who earn more than at least one instructor from the Biology department?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE salary > (SELECT MIN(salary) FROM instructor WHERE dept_name = 'Biology')
Find the names of all instructors whose salary is greater than the salary of all instructors in the Biology department.
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE salary > (SELECT MAX(salary) FROM instructor WHERE dept_name = 'Biology')
What are the names of all instructors with a higher salary than any of the instructors in the Biology department?
Additional table information: table: college_2
SQL: SELECT name FROM instructor WHERE salary > (SELECT MAX(salary) FROM instructor WHERE dept_name = 'Biology')
How many debates are there?
Additional table information: table: debate
SQL: SELECT COUNT(*) FROM debate
List the venues of debates in ascending order of the number of audience.
Additional table information: table: debate
SQL: SELECT Venue FROM debate ORDER BY Num_of_Audience ASC NULLS FIRST
What are the date and venue of each debate?
Additional table information: table: debate
SQL: SELECT Date, Venue FROM debate
List the dates of debates with number of audience bigger than 150
Additional table information: table: debate
SQL: SELECT Date FROM debate WHERE Num_of_Audience > 150
Show the names of people aged either 35 or 36.
Additional table information: table: debate
SQL: SELECT Name FROM people WHERE Age = 35 OR Age = 36
What is the party of the youngest people?
Additional table information: table: debate
SQL: SELECT Party FROM people ORDER BY Age ASC NULLS FIRST LIMIT 1
Show different parties of people along with the number of people in each party.
Additional table information: table: debate
SQL: SELECT Party, COUNT(*) FROM people GROUP BY Party
Show the party that has the most people.
Additional table information: table: debate
SQL: SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
Show the distinct venues of debates
Additional table information: table: debate
SQL: SELECT DISTINCT Venue FROM debate
Show the names of people, and dates and venues of debates they are on the affirmative side.
Additional table information: table: debate
SQL: SELECT T3.Name, T2.Date, T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID
Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.
Additional table information: table: debate
SQL: SELECT T3.Name, T2.Date, T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID ORDER BY T3.Name ASC NULLS FIRST
Show the names of people that are on affirmative side of debates with number of audience bigger than 200.
Additional table information: table: debate
SQL: SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200
Show the names of people and the number of times they have been on the affirmative side of debates.
Additional table information: table: debate
SQL: SELECT T2.Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name
Show the names of people who have been on the negative side of debates at least twice.
Additional table information: table: debate
SQL: SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2
List the names of people that have not been on the affirmative side of debates.
Additional table information: table: debate
SQL: SELECT Name FROM people WHERE NOT People_id IN (SELECT Affirmative FROM debate_people)
List the names of all the customers in alphabetical order.
Additional table information: table: insurance_and_eClaims
SQL: SELECT customer_details FROM customers ORDER BY customer_details NULLS FIRST
Sort the customer names in alphabetical order.
Additional table information: table: insurance_and_eClaims
SQL: SELECT customer_details FROM customers ORDER BY customer_details NULLS FIRST
Find all the policy type codes associated with the customer 'Dayana Robel'
Additional table information: table: insurance_and_eClaims
SQL: SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = 'Dayana Robel'
What are the type codes of the policies used by the customer 'Dayana Robel'?
Additional table information: table: insurance_and_eClaims
SQL: SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = 'Dayana Robel'
Which type of policy is most frequently used? Give me the policy type code.
Additional table information: table: insurance_and_eClaims
SQL: SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1
Find the type code of the most frequently used policy.
Additional table information: table: insurance_and_eClaims
SQL: SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY COUNT(*) DESC LIMIT 1
Find all the policy types that are used by more than 2 customers.
Additional table information: table: insurance_and_eClaims
SQL: SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING COUNT(*) > 2
Which types of policy are chosen by more than 2 customers? Give me the policy type codes.
Additional table information: table: insurance_and_eClaims
SQL: SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING COUNT(*) > 2
Find the total and average amount paid in claim headers.
Additional table information: table: insurance_and_eClaims
SQL: SELECT SUM(amount_piad), AVG(amount_piad) FROM claim_headers
What are the total amount and average amount paid in claim headers?
Additional table information: table: insurance_and_eClaims
SQL: SELECT SUM(amount_piad), AVG(amount_piad) FROM claim_headers
Find the total amount claimed in the most recently created document.
Additional table information: table: insurance_and_eClaims
SQL: SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date NULLS FIRST LIMIT 1)
How much amount in total were claimed in the most recently created document?
Additional table information: table: insurance_and_eClaims
SQL: SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date NULLS FIRST LIMIT 1)
What is the name of the customer who has made the largest amount of claim in a single claim?
Additional table information: table: insurance_and_eClaims
SQL: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT MAX(amount_claimed) FROM claim_headers)