diff --git "a/train.csv" "b/train.csv" new file mode 100644--- /dev/null +++ "b/train.csv" @@ -0,0 +1,3035 @@ +database_id,query,question +hospital_1,SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;,Find the department with the most employees. +hospital_1,SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;,Tell me the employee id of the head of the department with the least employees. +hospital_1,"SELECT T2.name , T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;",Find the name and position of the head of the department with the least employees. +hospital_1,SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn,List the names of patients who have made appointments. +hospital_1,"SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING count(*) > 1",Which patients made more than one appointment? Tell me the name and phone number of these patients. +hospital_1,SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1,What is the id of the appointment that started most recently? +hospital_1,SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID,What are the names of all the physicians who took appointments. +hospital_1,SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID,Which physicians have never taken any appointment? Find their names. +hospital_1,"SELECT T1.name , T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1",What are the name and primarily affiliated department name of each physician? +hospital_1,SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 WHERE T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1,Find the name of the patient who made the appointment with the most recent start date. +hospital_1,SELECT count(patient) FROM stay WHERE room = 112,Count the number of patients who stayed in room 112. +hospital_1,"SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = ""John Dorian""",Find the number of patients' prescriptions physician John Dorian made. +hospital_1,SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111,What is the name of the medication used for the patient staying in room 111? +hospital_1,SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1,What is the id of the patient who stayed in room 111 most recently? +hospital_1,SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1,Find the name of the nurse who has the largest number of appointments. +hospital_1,"SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid",Return the name of each physician and the number of patients he or she treats. +hospital_1,SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING count(*) > 1,Which physicians are in charge of more than one patient? Give me their names. +hospital_1,"SELECT count(*) , T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor",How many rooms does each block floor have? +hospital_1,"SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode",How many rooms are located for each block code? +hospital_1,SELECT DISTINCT blockcode FROM room WHERE unavailable = 0,Tell me the distinct block codes where some rooms are available. +hospital_1,SELECT count(DISTINCT roomtype) FROM room,Find the number of distinct room types available. +hospital_1,"SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = ""Thesisin""",List the names of all the physicians who prescribe Thesisin as medication. +hospital_1,"SELECT DISTINCT T1.name , T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = ""X""",Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians. +hospital_1,"SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand",How many medications are prescribed for each brand? +hospital_1,SELECT name FROM physician WHERE POSITION LIKE '%senior%',What are the names of the physicians who have 'senior' in their titles. +hospital_1,SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1,Which patient is undergoing the most recent treatment? +hospital_1,SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111,What are the names of patients who are staying in room 111 and have an undergoing treatment? +hospital_1,SELECT DISTINCT name FROM nurse ORDER BY name,What is the alphabetically ordered list of all the distinct names of nurses? +hospital_1,SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID,Which nurses are in charge of patients undergoing treatments? +hospital_1,SELECT DISTINCT name FROM medication ORDER BY name,What is the alphabetically ordered list of all distinct medications? +hospital_1,SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1,Find the physician who prescribed the highest dose. What is his or her name? +hospital_1,SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1,What are the names of departments that have primarily affiliated physicians. +game_1,SELECT count(*) FROM Video_games,How many video games do you have? +game_1,SELECT count(DISTINCT gtype) FROM Video_games,What is the count of different game types? +game_1,SELECT DISTINCT gtype FROM Video_games,What are the different types of video games? +game_1,"SELECT gname , gtype FROM Video_games ORDER BY gname",What are the names of all the video games and their types in alphabetical order? +game_1,"SELECT gname FROM Video_games WHERE gtype = ""Collectible card game""",What are the names of all video games that are collectible cards? +game_1,"SELECT gtype FROM Video_games WHERE gname = ""Call of Destiny""",What type of game is Call of Destiny? +game_1,"SELECT count(*) FROM Video_games WHERE gtype = ""Massively multiplayer online game""",Count the number of video games with Massively multiplayer online game type . +game_1,"SELECT gtype , count(*) FROM Video_games GROUP BY gtype",What are the types of video games and how many are in each type? +game_1,SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1,What type has the most games? +game_1,SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1,What is the type with the fewest games? +game_1,"SELECT StuID FROM Student WHERE city_code = ""CHI""",What are the ids of all students who live in CHI? +game_1,SELECT StuID FROM Student WHERE Advisor = 1121,What are the ids of all students who have advisor number 1121? +game_1,SELECT Fname FROM Student WHERE Major = 600,What are the first names for all students who are from the major numbered 600? +game_1,"SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major","What are the average, minimum, and max ages for each of the different majors?" +game_1,SELECT advisor FROM Student GROUP BY advisor HAVING count(*) >= 2,What are the advisors +game_1,SELECT count(DISTINCT sportname) FROM Sportsinfo,How many different types of sports do we offer? +game_1,SELECT count(DISTINCT StuID) FROM Sportsinfo,How many different students are involved in sports? +game_1,SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y',What are the ids for all sporty students who are on scholarship? +game_1,SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y',What are the last names for all scholarship students? +game_1,SELECT sum(gamesplayed) FROM Sportsinfo,What is the total number of games played? +game_1,"SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname = ""Football"" AND onscholarship = 'Y'",What is the total number of all football games played by scholarship students? +game_1,"SELECT sportname , count(*) FROM Sportsinfo GROUP BY sportname",How many students play each sport? +game_1,"SELECT StuID , count(*) , sum(gamesplayed) FROM Sportsinfo GROUP BY StuID",What are the ids of all students along with how many sports and games did they play? +game_1,SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek) > 10,What are the student IDs for everybody who worked for more than 10 hours per week on all sports? +game_1,"SELECT T2.Fname , T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1",What is the first and last name of the student who played the most sports? +game_1,SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1,What is the sport with the most scholarship students? +game_1,SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo,What are the ids of all students who don't play sports? +game_1,SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y',What are the student ids for those on scholarship in major number 600? +game_1,"SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = ""Football""",What are the ids of all female students who play football? +game_1,"SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = ""Football""",What are the ids of all male students who do not play football? +game_1,"SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = ""David"" AND T2.Lname = ""Shieber""",What is the total number of hours per work and number of games played by David Shieber? +game_1,"SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20",What is the total number of hours per week and number of games played by students under 20? +game_1,SELECT count(DISTINCT StuID) FROM Plays_games,How many different students play games? +game_1,SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games,What are the ids of all students who are not video game players? +game_1,SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games,What are the ids of all students who played video games and sports? +game_1,"SELECT gameid , sum(hours_played) FROM Plays_games GROUP BY gameid",What are ids and total number of hours played for each game? +game_1,"SELECT Stuid , sum(hours_played) FROM Plays_games GROUP BY Stuid",What are the ids of all students and number of hours played? +game_1,SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1,What is the name of the game that has been played the most? +game_1,SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING sum(hours_played) >= 1000,What are the names of all the games that have been played for at least 1000 hours? +game_1,"SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = ""Smith"" AND T3.Fname = ""Linda""",What are the names of all games played by Linda Smith? +game_1,"SELECT T2.lname , T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = ""Football"" OR T1.SportName = ""Lacrosse""",What is the first and last name of all students who play Football or Lacrosse? +game_1,"SELECT fname , age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = ""Football"" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = ""Lacrosse"")",What are the first names and ages of all students who are playing both Football and Lacrosse? +college_2,SELECT DISTINCT building FROM classroom WHERE capacity > 50,What are the distinct buildings with capacities of greater than 50? +college_2,SELECT count(*) FROM classroom WHERE building ! = 'Lamberton',How many classrooms are not in Lamberton? +college_2,"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. +college_2,"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? +college_2,"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? +college_2,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. +college_2,SELECT count(*) FROM classroom WHERE building = 'Lamberton',Count the number of classrooms in Lamberton. +college_2,SELECT count(DISTINCT s_id) FROM advisor,Count the number of students who have advisors. +college_2,SELECT count(DISTINCT dept_name) FROM course,Count the number of departments which offer courses. +college_2,SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics',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,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","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),Count the number of courses without prerequisites. +college_2,SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq),What are the titles of courses without prerequisites? +college_2,SELECT COUNT (DISTINCT id) FROM teaches,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',What is the sum of budgets of the Marketing and Finance departments? +college_2,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'? +college_2,SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50,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)",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,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',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',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,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,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,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,What is the name of the department with the most credits? +college_2,"SELECT title FROM course ORDER BY title , credits","Given the titles of all courses, in order of titles and credits." +college_2,SELECT dept_name FROM department ORDER BY budget LIMIT 1,Give the name of the department with the lowest budget. +college_2,"SELECT dept_name , building FROM department ORDER BY budget DESC","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,Give the name of the highest paid instructor. +college_2,SELECT * FROM instructor ORDER BY salary,"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","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","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,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,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",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",What are the greatest and average capacity for rooms in each building? +college_2,SELECT title FROM course GROUP BY title HAVING count(*) > 1,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",How many total credits are offered by each department? +college_2,"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. +college_2,"SELECT count(*) , semester , YEAR FROM SECTION GROUP BY semester , YEAR",How many courses are provided in each semester and year? +college_2,SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1,Which year had the greatest number of courses? +college_2,"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? +college_2,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? +college_2,"SELECT count(*) , dept_name FROM student GROUP BY dept_name",How many students are in each department? +college_2,"SELECT semester , YEAR FROM takes GROUP BY semester , YEAR ORDER BY count(*) LIMIT 1",Which semeseter and year had the fewest students? +college_2,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. +college_2,"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? +college_2,SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq,What are the ids of courses without prerequisites? +college_2,SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq),What are the names of courses without prerequisites? +college_2,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. +college_2,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? +college_2,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? +college_2,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. +college_2,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? +college_2,"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? +college_2,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,What are the names of all instructors who advise students in the math depart sorted by total credits of the student. +college_2,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? +college_2,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? +college_2,SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches),What are the names of instructors who didn't teach? +college_2,SELECT id FROM instructor EXCEPT SELECT id FROM teaches,What are the ids of instructors who didnt' teach? +college_2,SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester = 'Spring'),What are the names of instructors who didn't teach courses in the Spring? +college_2,SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1,Which department has the highest average instructor salary? +college_2,"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?" +college_2,"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. +college_2,SELECT name FROM student WHERE id NOT 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? +college_2,"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? +college_2,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? +college_2,"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? +college_2,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? +college_2,"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","What are the building, room number, semester and year of courses in the Psychology department, sorted using course title?" +college_2,SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.',What are the names of all instructors in the Comp. Sci. department? +college_2,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? +college_2,"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?" +college_2,"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?" +college_2,SELECT name FROM instructor WHERE name LIKE '%dar%',"What are the names of all instructors with names that include ""dar""?" +college_2,SELECT DISTINCT name FROM instructor ORDER BY name,"List the distinct names of the instructors, ordered by name." +college_2,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? +college_2,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? +college_2,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? +college_2,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? +college_2,SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010,How many instructors teach a course in the Spring of 2010? +college_2,"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? +college_2,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? +college_2,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? +college_1,"SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = ""Accounting""",How many professors are in the accounting dept? +college_1,"SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = ""ACCT-211""",How many professors teach a class with the code ACCT-211? +college_1,"SELECT T3.EMP_FNAME , T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM = T3.EMP_NUM WHERE DEPT_NAME = ""Biology""",What are the first and last name of all biology professors? +college_1,"SELECT DISTINCT T1.EMP_FNAME , T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = ""ACCT-211""",What are the first names and birthdates of the professors in charge of ACCT-211? +college_1,SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski',How many classes does the professor whose last name is Graztevski teach? +college_1,"SELECT school_code FROM department WHERE dept_name = ""Accounting""",What is the school code of the accounting department? +college_1,"SELECT crs_credit , crs_description FROM course WHERE crs_code = 'CIS-220'",What is the description for the CIS-220 and how many credits does it have? +college_1,SELECT dept_address FROM department WHERE dept_name = 'History',Where is the history department? +college_1,SELECT count(DISTINCT dept_address) FROM department WHERE school_code = 'BUS',What are the different locations of the school with the code BUS? +college_1,"SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code",Count different addresses of each school. +college_1,"SELECT crs_credit , crs_description FROM course WHERE crs_code = 'QM-261'",What is the course description and number of credits for QM-261? +college_1,"SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code",How many departments are in each school? +college_1,"SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name) < 5",How many different departments are there in each school that has less than 5 apartments? +college_1,"SELECT count(*) , crs_code FROM CLASS GROUP BY crs_code",How many sections does each course have? +college_1,"SELECT sum(crs_credit) , dept_code FROM course GROUP BY dept_code",How many credits does the department offer? +college_1,"SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2","For each classroom with at least 2 classes, how many classes are offered?" +college_1,"SELECT count(*) , dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code",How many classes are held in each department? +college_1,"SELECT count(*) , T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code",How many classes exist for each school? +college_1,"SELECT count(*) , T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code",How many different professors are there for the different schools? +college_1,"SELECT emp_jobcode , count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1",What is the count and code of the job with the most employee? +college_1,SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count(*) LIMIT 1,Which school has the fewest professors? +college_1,"SELECT count(*) , dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code",How many professors have a Ph.D. in each department? +college_1,"SELECT count(*) , dept_code FROM student GROUP BY dept_code",How many students are in each department? +college_1,"SELECT sum(stu_hrs) , dept_code FROM student GROUP BY dept_code",How many hours do the students spend studying in each department? +college_1,"SELECT max(stu_gpa) , avg(stu_gpa) , min(stu_gpa) , dept_code FROM student GROUP BY dept_code","What is the highest, lowest, and average student GPA for every department?" +college_1,"SELECT T2.dept_name , avg(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY avg(T1.stu_gpa) DESC LIMIT 1","Which department has the highest average student GPA, and what is the average gpa?" +college_1,SELECT count(DISTINCT school_code) FROM department,How many schools are there in the department? +college_1,SELECT count(DISTINCT class_code) FROM CLASS,How many unique classes are offered? +college_1,SELECT count(DISTINCT crs_code) FROM CLASS,What are the number of different course codes? +college_1,SELECT count(DISTINCT dept_name) FROM department,How many different departments are there? +college_1,"SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = ""Computer Info. Systems""",How many courses does the department of Computer Information Systmes offer? +college_1,SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211',What is the number of different class sections offered in the course ACCT-211? +college_1,"SELECT sum(T1.crs_credit) , T1.dept_code FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code GROUP BY T1.dept_code",What are the total number of credits offered by each department? +college_1,SELECT T3.dept_name FROM course AS T1 JOIN CLASS AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY sum(T1.crs_credit) DESC LIMIT 1,Which department offers the most credits all together? +college_1,SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211',What are the total number of students enrolled in ACCT-211? +college_1,SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211',What are the first names of all students in course ACCT-211? +college_1,SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C',What are the first names of all students who took ACCT-211 and received a C? +college_1,SELECT count(*) FROM employee,How many employees are there all together? +college_1,SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.',What is the total number of professors with a Ph.D. ? +college_1,SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting',How many students are enrolled in some classes that are taught by an accounting professor? +college_1,SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1,What is the name of the department with the most students enrolled? +college_1,SELECT dept_name FROM department ORDER BY dept_name,What are the names of all departments in alphabetical order? +college_1,SELECT class_code FROM CLASS WHERE class_room = 'KLR209',What are the codes of all the courses that are located in room KLR209? +college_1,SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob,What are the first names of all employees that are professors ordered by date of birth? +college_1,"SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num ORDER BY T2.emp_fname",What are the first names and office locations for all professors sorted alphabetically by first name? +college_1,"SELECT emp_fname , emp_lname FROM employee ORDER BY emp_dob LIMIT 1",What are the first and last names of the employee with the earliest date of birth? +college_1,"SELECT stu_fname , stu_lname , stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1","What is the first and last name of the youngest student with a GPA above 3, and what is their GPA?" +college_1,SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C',What are the first names of all students who got a grade C in a class? +college_1,SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1,What is the name of the department with the fewest professors? +college_1,"SELECT T2.dept_name , T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1",Which department has the most professors with a Ph.D.? +college_1,SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num,What are the first names of all professors not teaching any classes? +college_1,SELECT T1.emp_fname FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' EXCEPT SELECT T4.emp_fname FROM employee AS T4 JOIN CLASS AS T5 ON T4.emp_num = T5.prof_num,What are the first names of all history professors who do not teach? +college_1,"SELECT T1.emp_lname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'",What are the last name and office of all history professors? +college_1,"SELECT T3.dept_name , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington'",What is the name of the department and office location for the professor with the last name of Heffington? +college_1,"SELECT T1.emp_lname , T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num WHERE T2.prof_office = 'DRE 102'","What is the last name of the professor whose office is located in DRE 102, and when were they hired?" +college_1,SELECT T1.crs_code FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num WHERE T3.stu_lname = 'Smithson',What are the course codes for every class that the student with the last name Smithson took? +college_1,"SELECT T4.crs_description , T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'","How many credits is the course that the student with the last name Smithson took, and what is its description?" +college_1,SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA',How many professors attained either Ph.D. or Masters degrees? +college_1,SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology',What is the number of professors who are in the Accounting or Biology departments? +college_1,SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = 'QM-261',What is the first name of the professor who is teaching CIS-220 and QM-261? +college_1,SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Computer Info. Systems',What are the first names of all students taking accoutning and Computer Information Systems classes? +college_1,SELECT avg(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211',What is the average GPA of students taking ACCT-211? +college_1,"SELECT stu_gpa , stu_phone , stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5","What is the first name, GPA, and phone number of the students with the top 5 GPAs?" +college_1,SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa LIMIT 1,What is the name of the department with the student that has the lowest GPA? +college_1,"SELECT stu_fname , stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student)",What is the first name and GPA of every student that has a GPA lower than average? +college_1,"SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1",What is the name and address of the department with the most students? +college_1,"SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3","What is the name, address, and number of students in the departments that have the 3 most students?" +college_1,"SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'",What are the first names and office of the professors who are in the history department and have a Ph.D? +college_1,"SELECT T2.emp_fname , T1.crs_code FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num",What are the first names of all teachers who have taught a course and the corresponding course codes? +college_1,"SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code",What are the first names of all teachers who have taught a course and the corresponding descriptions? +college_1,"SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num","What are the first names, office locations of all lecturers who have taught some course?" +college_1,"SELECT T2.emp_fname , T4.prof_office , T3.crs_description , T5.dept_name FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code","What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach?" +college_1,"SELECT T1.stu_fname , T1.stu_lname , T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code",What are the names of all students who took a class and the corresponding course descriptions? +college_1,"SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'",What are the names of all students taking a course who received an A or C? +college_1,"SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'",What are the first names of all Accounting professors who teach and what are the classrooms of the courses they teach? +college_1,"SELECT DISTINCT T2.emp_fname , T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'",What are the different first names and highest degree attained for professors teaching in the Computer Information Systems department? +college_1,SELECT T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'A' AND T2.class_code = 10018,What is the last name of the student who received an A in the class with the code 10018? +college_1,"SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T1.dept_code = T3.dept_code WHERE T3.dept_name = 'History' AND T1.prof_high_degree ! = 'Ph.D.'",What are the first names and offices of history professors who don't have Ph.D.s? +college_1,SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num GROUP BY T1.prof_num HAVING count(*) > 1,What are the first names of all professors who teach more than one class? +college_1,SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num GROUP BY T2.stu_num HAVING count(*) = 1,What are the first names of student who only took one course? +college_1,SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.crs_description LIKE '%Statistics%',"What is the name of the department that offers a course that has a description including the word ""Statistics""?" +college_1,SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%',What is the first name of the student whose last name starts with the letter S and is taking ACCT-211? +inn_1,SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern';,What are the names of modern rooms that have a base price lower than $160 and two beds. +inn_1,"SELECT roomName , RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2;",What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people. +inn_1,SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1;,Which room has the largest number of reservations? +inn_1,"SELECT kids FROM Reservations WHERE FirstName = ""ROY"" AND LastName = ""SWEAZY"";",Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ. +inn_1,"SELECT count(*) FROM Reservations WHERE FirstName = ""ROY"" AND LastName = ""SWEAZY"";",Find the number of times ROY SWEAZY has reserved a room. +inn_1,"SELECT T2.roomName , T1.Rate , T1.CheckIn , T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;","Return the name, rate, check in and check out date for the room with the highest rate." +inn_1,"SELECT Adults FROM Reservations WHERE CheckIn = ""2010-10-23"" AND FirstName = ""CONRAD"" AND LastName = ""SELBIG"";","Find the number of adults for the room reserved and checked in by CONRAD SELBIG on Oct 23, 2010." +inn_1,"SELECT Kids FROM Reservations WHERE CheckIn = ""2010-09-21"" AND FirstName = ""DAMIEN"" AND LastName = ""TRACHSEL"";","Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on Sep 21, 2010." +inn_1,SELECT sum(beds) FROM Rooms WHERE bedtype = 'King';,Find the total number of king beds available. +inn_1,"SELECT roomName , decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice;",What are the names and decor of rooms with a king bed? Sort them by their price +inn_1,"SELECT roomName , basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;",What are the room name and base price of the room with the lowest base price? +inn_1,"SELECT decor FROM Rooms WHERE roomName = ""Recluse and defiance"";","Return the decor of the room named ""Recluse and defiance""." +inn_1,"SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;","For each bed type, find the average base price of different bed type." +inn_1,SELECT sum(maxOccupancy) FROM Rooms WHERE decor = 'modern';,How many people in total can stay in the modern rooms of this inn? +inn_1,SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;,What is the least popular kind of decor? +inn_1,SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids;,How many times the number of adults and kids staying in a room reached the maximum capacity of the room? +inn_1,"SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0",What are the first and last names of people who payed more than the rooms' base prices? +inn_1,SELECT count(*) FROM Rooms;,What is the total number of rooms available in this inn? +inn_1,"SELECT count(*) FROM Rooms WHERE bedType = ""King"";",How many rooms have a king bed? +inn_1,"SELECT bedType , count(*) FROM Rooms GROUP BY bedType;",What are the number of rooms for each bed type? +inn_1,SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;,What is the name of the room that can accommodate the most people? +inn_1,"SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;",Which room has the highest base price? +inn_1,"SELECT roomName , bedType FROM Rooms WHERE decor = ""traditional"";",What are the bed type and name of all the rooms with traditional decor? +inn_1,"SELECT decor , count(*) FROM Rooms WHERE bedType = ""King"" GROUP BY decor;",How many rooms have king beds? Report the number for each decor type. +inn_1,"SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor;",What is the average minimum and price of the rooms for each different decor. +inn_1,SELECT roomName FROM Rooms ORDER BY basePrice;,Sort all the rooms according to the price. Just report the room names. +inn_1,"SELECT decor , count(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor;","How many rooms cost more than 120, for each different decor?" +inn_1,"SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType;","What is the average base price of rooms, for each bed type?" +inn_1,"SELECT roomName FROM Rooms WHERE bedType = ""King"" OR bedType = ""Queen"";",What are the names of rooms that have either king or queen bed? +inn_1,SELECT count(DISTINCT bedType) FROM Rooms;,Find the number of distinct bed types available in this inn. +inn_1,"SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;",What are the name and id of the three highest priced rooms? +inn_1,SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms );,What are the name of rooms that cost more than the average. +inn_1,SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations),How many rooms have not had any reservation yet? +inn_1,"SELECT T2.roomName , count(*) , T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room","For each room, find its name and the number of times reservations were made for it." +inn_1,SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING count(*) > 60,What are the names of rooms whose reservation frequency exceeds 60 times? +inn_1,SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150,Which rooms cost between 120 and 150? Give me the room names. +inn_1,SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%',"What are the name of rooms booked by customers whose first name has ""ROY"" in part?" +allergy_1,SELECT count(DISTINCT allergy) FROM Allergy_type,How many allergy entries are there? +allergy_1,SELECT count(DISTINCT allergytype) FROM Allergy_type,How many distinct allergies are there? +allergy_1,SELECT DISTINCT allergytype FROM Allergy_type,What are the different allergy types? +allergy_1,"SELECT allergy , allergytype FROM Allergy_type",What are the allergies and their types? +allergy_1,"SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = ""food""",What are all the different food allergies? +allergy_1,"SELECT allergytype FROM Allergy_type WHERE allergy = ""Cat""",What is allergy type of a cat allergy? +allergy_1,"SELECT count(*) FROM Allergy_type WHERE allergytype = ""animal""",How many animal type allergies exist? +allergy_1,"SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype",What are the allergy types and how many allergies correspond to each one? +allergy_1,SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1,Which allergy type is most common? +allergy_1,SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1,Which allergy type is the least common? +allergy_1,SELECT count(*) FROM Student,What is the total number of students? +allergy_1,"SELECT Fname , Lname FROM Student",What are the full names of all students +allergy_1,SELECT count(DISTINCT advisor) FROM Student,How many advisors are there? +allergy_1,SELECT DISTINCT Major FROM Student,What are the different majors? +allergy_1,SELECT DISTINCT city_code FROM Student,What cities do students live in? +allergy_1,"SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'",What are the full names and ages for all female students whose sex is F? +allergy_1,SELECT StuID FROM Student WHERE Sex = 'M',What are the student ids for all male students? +allergy_1,SELECT count(*) FROM Student WHERE age = 18,How many students are 18 years old? +allergy_1,SELECT StuID FROM Student WHERE age > 20,What are the student ids for students over 20 years old? +allergy_1,"SELECT city_code FROM Student WHERE LName = ""Kim""",Give the city that the student whose family name is Kim lives in. +allergy_1,SELECT Advisor FROM Student WHERE StuID = 1004,Who advises student 1004? +allergy_1,"SELECT count(*) FROM Student WHERE city_code = ""HKG"" OR city_code = ""CHI""",Give the number of students living in either HKG or CHI. +allergy_1,"SELECT min(age) , avg(age) , max(age) FROM Student","What is the minimum, mean, and maximum age across all students?" +allergy_1,SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student),Provide the last name of the youngest student. +allergy_1,SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student),What student id corresponds to the oldest student? +allergy_1,"SELECT major , count(*) FROM Student GROUP BY major",How many students are there for each major? +allergy_1,SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1,What is the largest major? +allergy_1,"SELECT age , count(*) FROM Student GROUP BY age",How old is each student and how many students are each age? +allergy_1,"SELECT avg(age) , sex FROM Student GROUP BY sex",What are the average ages for male and female students? +allergy_1,"SELECT city_code , count(*) FROM Student GROUP BY city_code",How many students live in each city? +allergy_1,"SELECT advisor , count(*) FROM Student GROUP BY advisor",How many students does each advisor have? +allergy_1,SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1,Give the advisor with the most students. +allergy_1,"SELECT count(*) FROM Has_allergy WHERE Allergy = ""Cat""",How many students are affected by cat allergies? +allergy_1,SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2,What are the students ids of students who have more than one allergy? +allergy_1,SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy,Which students are unaffected by allergies? +allergy_1,"SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = ""F"" AND (T1.allergy = ""Milk"" OR T1.allergy = ""Eggs"")",How many students who are female are allergic to milk or eggs? +allergy_1,"SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = ""food""",How many students are affected by food related allergies? +allergy_1,SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1,Which allergy is the most common? +allergy_1,"SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy",How many students have each different allergy? +allergy_1,"SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype",How many students are affected by each allergy type? +allergy_1,"SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = ""Milk"" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = ""Cat"")",What are the last names and ages of the students who are allergic to milk and cat? +allergy_1,"SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = ""Lisa"" ORDER BY T1.Allergy",What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names. +allergy_1,"SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = ""Milk"" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = ""Cat"")",What are the first name and gender of the students who have allergy to milk but can put up with cats? +allergy_1,"SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = ""food"" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = ""animal"")",How old are the students with allergies to food and animal types on average? +allergy_1,"SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = ""food"")",What is the full name of each student who is not allergic to any type of food. +allergy_1,"SELECT count(*) FROM Student WHERE sex = ""M"" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = ""food"")",How many male students (sex is 'M') are allergic to any type of food? +allergy_1,"SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = ""Milk"" OR T2.Allergy = ""Cat""",What are the distinct first names and cities of the students who have allergy either to milk or to cat? +allergy_1,"SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = ""food"" OR T2.allergytype = ""animal"")",How many students are over 18 and do not have allergy to food type or animal type? +allergy_1,"SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = ""Soy"")",What are the first name and major of the students who are able to consume soy? +customers_and_addresses,SELECT customer_name FROM customers,What are the names of all the customers? +customers_and_addresses,SELECT count(*) FROM customers,Return the total number of distinct customers. +customers_and_addresses,SELECT avg(order_quantity) FROM order_items,Find the average order quantity per order. +customers_and_addresses,"SELECT customer_name FROM customers WHERE payment_method = ""Cash""","Which customers use ""Cash"" for payment method? Return the customer names." +customers_and_addresses,SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20,What are the dates when customers with ids between 10 and 20 became customers? +customers_and_addresses,SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1,Find the payment method that is used most frequently. +customers_and_addresses,SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1),Find the name of the customers who use the most frequently used payment method. +customers_and_addresses,SELECT DISTINCT payment_method FROM customers,Return all the distinct payment methods used by customers. +customers_and_addresses,SELECT DISTINCT product_details FROM products,Return the the details of all products. +customers_and_addresses,"SELECT customer_name FROM customers WHERE customer_name LIKE ""%Alex%""","Which customer's name contains ""Alex""? Find the full name." +customers_and_addresses,"SELECT product_details FROM products WHERE product_details LIKE ""%Latte%"" OR product_details LIKE ""%Americano%""","Which product's detail contains the word ""Latte"" or ""Americano""? Return the full detail." +customers_and_addresses,"SELECT t3.address_content FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t1.customer_name = ""Maudie Kertzmann""","Return the address content for the customer whose name is ""Maudie Kertzmann""." +customers_and_addresses,"SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.city = ""Lake Geovannyton""",Find the number of customers who live in the city called Lake Geovannyton. +customers_and_addresses,"SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = ""Colorado""",What are the names of customers who live in Colorado state? +customers_and_addresses,SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id),What are the cities no customers live in? +customers_and_addresses,SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY count(*) DESC LIMIT 1,Find the city where the most customers live. +customers_and_addresses,SELECT DISTINCT city FROM addresses,List all the distinct cities +customers_and_addresses,SELECT city FROM addresses WHERE zip_postcode = 255,Which city is post code 255 located in? +customers_and_addresses,"SELECT state_province_county , country FROM addresses WHERE zip_postcode LIKE ""4%""",What are the state and country of all the cities that have post codes starting with 4.\ +customers_and_addresses,SELECT country FROM addresses GROUP BY country HAVING count(address_id) > 4,For which countries are there more than four distinct addresses listed? +customers_and_addresses,SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING count(customer_id) < 5,Which contact channel codes were used less than 5 times? +customers_and_addresses,"SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = ""Tillman Ernser""","Find the contact channel code that was used by the customer named ""Tillman Ernser""." +customers_and_addresses,"SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = ""Tillman Ernser""","Return the the ""active to date"" of the latest contact channel used by the customer named ""Tillman Ernser""." +customers_and_addresses,SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels,Compute the average active time span of contact channels. +customers_and_addresses,"SELECT channel_code , contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)",Return the channel code and contact number of the customer contact channel whose active duration was the longest. +customers_and_addresses,"SELECT t1.customer_name , t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'",What are the name and active date of the customers whose contact channel code is email? +customers_and_addresses,SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = ( SELECT max(order_quantity) FROM order_items),Find the name of the customer who made the order of the largest amount of goods. +customers_and_addresses,SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1,Give me the name of the customer who ordered the most items in total. +customers_and_addresses,SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1,Tell me the payment method used by the customer who ordered the least amount of goods in total. +customers_and_addresses,"SELECT count(DISTINCT product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = ""Rodrick Heaney""",Find the number of distinct products Rodrick Heaney has bought so far. +customers_and_addresses,"SELECT sum(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = ""Rodrick Heaney""","Tell me the total quantity of products bought by the customer called ""Rodrick Heaney""." +customers_and_addresses,"SELECT count(DISTINCT customer_id) FROM customer_orders WHERE order_status = ""Cancelled""","Return the number of customers who have at least one order with ""Cancelled"" status." +customers_and_addresses,"SELECT count(*) FROM customer_orders WHERE order_details = ""Second time""","Tell me the number of orders with ""Second time"" as order detail." +customers_and_addresses,"SELECT t1.customer_name , t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = ""Delivered""","What are the customer name and date of the orders whose status is ""Delivered""." +customers_and_addresses,"SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = ""Cancelled""","Find the total quantity of products associated with the orders in the ""Cancelled"" status." +customers_and_addresses,SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < '2018-03-17 07:13:53',What is the total amount of products purchased before 2018-03-17 07:13:53? +customers_and_addresses,SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1,Find the name of the customer who made an order most recently. +customers_and_addresses,SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY count(*) DESC LIMIT 1,What is the most frequently ordered product? Tell me the detail of the product +customers_and_addresses,"SELECT t2.product_details , t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY sum(t1.order_quantity) LIMIT 1",What are the name and ID of the product bought the most. +customers_and_addresses,"SELECT address_content FROM addresses WHERE city = ""East Julianaside"" AND state_province_county = ""Texas"" UNION SELECT address_content FROM addresses WHERE city = ""Gleasonmouth"" AND state_province_county = ""Arizona""","What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona." +customers_and_addresses,SELECT customer_name FROM customers WHERE payment_method ! = 'Cash',What is the name of customers who do not use Cash as payment method. +customers_and_addresses,SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE product_details = 'Latte',What are names of customers who never ordered product Latte. +customers_and_addresses,SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id,What are the names of customers who never made an order. +customers_and_addresses,SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE product_details = 'Americano',What are the names of customers who have purchased both products Latte and Americano? +hr_1,"SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id",What are the first name and department name of all employees? +hr_1,"SELECT first_name , last_name , salary FROM employees WHERE salary < 6000",What are the full names and salaries for any employees earning less than 6000? +hr_1,"SELECT first_name , department_id FROM employees WHERE last_name = 'McEwen'",What are the first names and department numbers for employees with last name McEwen? +hr_1,SELECT * FROM departments WHERE department_name = 'Marketing',What is all the information about the Marketing department? +hr_1,SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%',On what dates were employees without the letter M in their first names hired? +hr_1,"SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%'","What are the full name, hire date, salary, and department id for employees without the letter M in their first name?" +hr_1,"SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id","What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id?" +hr_1,SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000,Return the phone numbers of employees with salaries between 8000 and 12000. +hr_1,"SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m'",Return the full names and salaries for employees with first names that end with the letter m. +hr_1,"SELECT job_id , hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'","What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009?" +hr_1,"SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90",What are the full names of employees who with in department 70 or 90? +hr_1,SELECT * FROM employees WHERE hire_date < '2002-06-21',"What is all the information about employees hired before June 21, 2002?" +hr_1,SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' OR first_name LIKE '%N%' ORDER BY salary DESC,"What is all the information about employees with D, S, or N in their first name, ordered by salary descending?" +hr_1,SELECT * FROM employees WHERE hire_date > '1987-09-07',"Which employees were hired after September 7th, 1987?" +hr_1,SELECT job_title FROM jobs WHERE min_salary > 9000,Which job titles correspond to jobs with salaries over 9000? +hr_1,"SELECT job_title , max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000","What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?" +hr_1,"SELECT employee_id , MAX(end_date) FROM job_history GROUP BY employee_id",What are the employee ids for each employee and final dates of employment at their last job? +hr_1,SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10,What are the department ids for which more than 10 employees had a commission? +hr_1,"SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4",What are department ids for departments with managers managing more than 3 employees? +hr_1,"SELECT country_id , COUNT(*) FROM locations GROUP BY country_id",Give the country id and corresponding count of cities in each country. +hr_1,SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2,What are the job ids for jobs done more than once for a period of more than 300 days? +hr_1,SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2,What are the employee ids for employees who have held two or more jobs? +hr_1,"SELECT employee_id , country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id",What are all the employee ids and the names of the countries in which they work? +hr_1,"SELECT T2.department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name",Give the name of each department and the number of employees in each. +hr_1,"SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title",What is the average salary for each job title? +hr_1,"SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 )",Provide the full names of employees earning more than the employee with id 163. +hr_1,"SELECT MIN(salary) , department_id FROM employees GROUP BY department_id",What is the minimum salary in each department? +hr_1,"SELECT first_name , last_name , department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)",What are the full names and department ids for the lowest paid employees across all departments. +hr_1,SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees),What are the employee ids for employees who make more than the average? +hr_1,"SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam' )","What are the employee ids of employees who report to Payam, and what are their salaries?" +hr_1,SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id,What are the names of departments that have at least one employee. +hr_1,SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id,What is all the information regarding employees who are managers? +hr_1,SELECT * FROM departments WHERE department_name = 'Marketing',What is all the information about the Marketing department? +hr_1,SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2,What are the employee ids for those who had two or more jobs. +hr_1,"SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4",Give the distinct department ids of departments in which a manager is in charge of 4 or more employees? +hr_1,SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000,What are the job ids corresponding to jobs with average salary above 8000? +hr_1,"SELECT T1.employee_id , T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80",what are the employee ids and job titles for employees in department 80? +hr_1,"SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance'",Give the first name and job id for all employees in the Finance department. +hr_1,SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500,What is all the information regarding employees with salaries above the minimum and under 2500? +hr_1,SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200),What are the ids for employees who do not work in departments with managers that have ids between 100 and 200? +hr_1,"SELECT first_name , last_name , hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = ""Clara"")",What are the full names and hire dates for employees in the same department as someone with the first name Clara? +hr_1,"SELECT first_name , last_name , hire_date FROM employees WHERE department_id = ( SELECT department_id FROM employees WHERE first_name = ""Clara"") AND first_name ! = ""Clara""","What are the full names and hire dates for employees in the same department as someone with the first name Clara, not including Clara?" +hr_1,"SELECT employee_id , first_name , last_name FROM employees WHERE department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%T%' )",What are the ids and full names for employees who work in a department that has someone with a first name that contains the letter T? +hr_1,"SELECT employee_id , first_name , last_name , salary FROM employees WHERE salary > ( SELECT AVG (salary) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%J%')","What are the ids, full names, and salaries for employees making more than average and who work in a department with employees who have the letter J in their first name?" +hr_1,"SELECT employee_id , job_id FROM employees WHERE salary < ( SELECT min(salary) FROM employees WHERE job_id = 'MK_MAN' )",What are the employee ids and job ids for employees who make less than the lowest earning employee with title MK_MAN? +hr_1,"SELECT employee_id , first_name , last_name , job_id FROM employees WHERE salary > ( SELECT max(salary) FROM employees WHERE job_id = 'PU_MAN' )","What are the employee ids, full names, and job ids for employees who make more than the highest earning employee with title PU_MAN?" +hr_1,"SELECT department_id , SUM(salary) FROM employees GROUP BY department_id HAVING count(*) >= 2",What are total salaries and department id for each department that has more than 2 employees? +hr_1,SELECT * FROM employees WHERE employee_id NOT IN (SELECT employee_id FROM job_history),What is all the information about employees who have never had a job in the past? +hr_1,"SELECT T1.first_name , T1.last_name , T2.department_name , T3.city , T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id","What are the full names, departments, cities, and state provinces for each employee?" +hr_1,"SELECT T1.first_name , T1.last_name , T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'",What are the full names and cities of employees who have the letter Z in their first names? +hr_1,"SELECT T1.department_name , T2.city , T2.state_province FROM departments AS T1 JOIN locations AS T2 ON T2.location_id = T1.location_id","What are the department names, cities, and state provinces for each department?" +hr_1,"SELECT first_name , last_name , employee_id , country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id","What the full names, ids of each employee and the name of the country they are in?" +hr_1,"SELECT department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY department_name",What are the department names and how many employees work in each of them? +hr_1,"SELECT first_name , last_name , salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'",What are full names and salaries of employees working in the city of London? +college_3,SELECT count(*) FROM COURSE,Count the number of courses. +college_3,SELECT count(*) FROM COURSE WHERE Credits > 2,Count the number of courses with more than 2 credits. +college_3,SELECT CName FROM COURSE WHERE Credits = 1,What are the names of courses with 1 credit? +college_3,"SELECT CName FROM COURSE WHERE Days = ""MTW""",What are the course names for courses taught on MTW? +college_3,"SELECT count(*) FROM DEPARTMENT WHERE Division = ""AS""",How many departments are in the division AS? +college_3,SELECT DPhone FROM DEPARTMENT WHERE Room = 268,Give the phones for departments in room 268. +college_3,"SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = ""B""","How many students have had at least one ""B"" grade?" +college_3,"SELECT max(gradepoint) , min(gradepoint) FROM GRADECONVERSION",What are the maximum and minumum grade points? +college_3,SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%',"What are the first names for students who have an ""a"" in their first name?" +college_3,"SELECT Fname , Lname FROM FACULTY WHERE sex = ""M"" AND Building = ""NEB""",What are the full names of faculties with sex M and who live in building NEB? +college_3,"SELECT Room FROM FACULTY WHERE Rank = ""Professor"" AND Building = ""NEB""",What are the rooms for members of the faculty who are professors and who live in building NEB? +college_3,"SELECT DName FROM DEPARTMENT WHERE Building = ""Mergenthaler""",What is the name of the department in the Building Mergenthaler? +college_3,SELECT * FROM COURSE ORDER BY Credits,"What is all the information about courses, ordered by credits ascending?" +college_3,SELECT CName FROM COURSE ORDER BY Credits,"What are the course names, ordered by credits?" +college_3,SELECT Fname FROM STUDENT ORDER BY Age DESC,"What are the first names of students, ordered by age from greatest to least?" +college_3,"SELECT LName FROM STUDENT WHERE Sex = ""F"" ORDER BY Age DESC","What are the last names of female students, ordered by age descending?" +college_3,"SELECT Lname FROM FACULTY WHERE Building = ""Barton"" ORDER BY Lname","What are the last names of faculty in building Barton, sorted by last name?" +college_3,"SELECT Fname FROM FACULTY WHERE Rank = ""Professor"" ORDER BY Fname","What are the first names for all faculty professors, ordered by first name?" +college_3,SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1,What is the name of the department with the most students minoring in it? +college_3,SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO,What is the name of the department htat has no students minoring in it? +college_3,SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) ASC LIMIT 1,What is the name of the department with the fewest members? +college_3,SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY count(*) ASC LIMIT 1,What is the least common faculty rank? +college_3,"SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 3",What are the full names of the 3 instructors who teach the most courses? +college_3,SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 1,Give the building that the instructor who teaches the greatest number of courses lives in. +college_3,SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5,Give the names of the courses with at least five enrollments. +college_3,"SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = ""COMPUTER LITERACY""",What is the full name of the instructor who has a course named COMPUTER LITERACY? +college_3,"SELECT T2.Dname , T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = ""INTRODUCTION TO COMPUTER SCIENCE""",What are the department name and room for the course INTRODUCTION TO COMPUTER SCIENCE? +college_3,"SELECT T3.Fname , T3.LName , T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID",What are the full names and gradepoints for all enrollments? +college_3,SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8,What are the distinct first names for students with a grade point of 3.8 or above in at least one course? +college_3,"SELECT T1.Fname , T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520",What are the full names of faculty members who are a part of department 520? +college_3,"SELECT T2.Fname , T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140",What are the full names of students minoring in department 140? +college_3,"SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = ""Computer Science""",What are the last names of faculty who are part of the computer science department? +college_3,"SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = ""Smith""",What is the average gradepoint for students with the last name Smith? +college_3,"SELECT max(T2.gradepoint) , min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = ""NYC""",Give the maximum and minimum gradepoints for students living in NYC? +college_3,SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4,"What are the names of courses that give either 3 credits, or 1 credit and 4 hours?" +college_3,"SELECT DName FROM DEPARTMENT WHERE Division = ""AS"" UNION SELECT DName FROM DEPARTMENT WHERE Division = ""EN"" AND Building = ""NEB""","What are the names of departments either in division AS, or in division EN and in building NEB?" +college_3,SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN),What are the first names of all students that are not enrolled in courses? +soccer_2,SELECT sum(enr) FROM College,How many students are enrolled in college? +soccer_2,SELECT avg(enr) FROM College,"How many students, on average, does each college have enrolled?" +soccer_2,SELECT COUNT(*) FROM College,How many different colleges are there? +soccer_2,SELECT count(*) FROM Player WHERE HS > 1000,How many different players trained for more than 1000 hours? +soccer_2,SELECT count(*) FROM College WHERE enr > 15000,What is the number of colleges with a student population greater than 15000? +soccer_2,SELECT avg(HS) FROM Player,How many hours do the players train on average? +soccer_2,"SELECT pName , HS FROM Player WHERE HS < 1500",What are the names and number of hours spent training for each player who trains for less than 1500 hours? +soccer_2,SELECT count(DISTINCT cName) FROM tryout,How many different colleges were represented at tryouts? +soccer_2,SELECT count(DISTINCT pPos) FROM tryout,What are the different types of player positions? +soccer_2,SELECT count(*) FROM tryout WHERE decision = 'yes',How many students received a yes from tryouts? +soccer_2,SELECT count(*) FROM tryout WHERE pPos = 'goalie',What is the number of students playing as a goalie? +soccer_2,"SELECT avg(HS) , max(HS) , min(HS) FROM Player","What is the average, maximum, and minimum for the number of hours spent training?" +soccer_2,SELECT avg(enr) FROM College WHERE state = 'FL',What is average number of students enrolled in Florida colleges? +soccer_2,SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500,What are the names of players who train between 500 and 1500 hours? +soccer_2,SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%',Who are the players that have names containing the letter a? +soccer_2,"SELECT cName , enr FROM College WHERE enr > 10000 AND state = ""LA""",What are the names and enrollment numbers for colleges that have more than 10000 enrolled and are located in Louisiana? +soccer_2,SELECT * FROM College ORDER BY enr,What information do you have on colleges sorted by increasing enrollment numbers? +soccer_2,SELECT cName FROM College WHERE enr > 18000 ORDER BY cName,What is the name of every college in alphabetical order that has more than 18000 students enrolled? +soccer_2,SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC,What are the name of the players who received a card in descending order of the hours of training? +soccer_2,SELECT DISTINCT cName FROM tryout ORDER BY cName,What are the different names of the colleges involved in the tryout in alphabetical order? +soccer_2,SELECT pPos FROM tryout GROUP BY pPos ORDER BY count(*) DESC LIMIT 1,What was the most popular position at tryouts? +soccer_2,"SELECT count(*) , cName FROM tryout GROUP BY cName ORDER BY count(*) DESC",How many students participated in tryouts for each college by descennding count? +soccer_2,"SELECT min(T2.HS) , T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos","For each position, what is the minimum time students spent practicing?" +soccer_2,SELECT cName FROM college ORDER BY enr DESC LIMIT 3,What are the names of the schools with the top 3 largest class sizes? +soccer_2,SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName,What are the different states that have students trying out? +soccer_2,SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes',What are the different states that had students successfully try out? +soccer_2,"SELECT T1.pName , T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'","What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges?" +soccer_2,SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName,What are the names of all students who tried out in alphabetical order? +soccer_2,"SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'",What are the names and hours spent practicing of every student who received a yes at tryouts? +soccer_2,SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker',What are the states of the colleges where students who tried out for the striker position attend? +soccer_2,SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker',What are the names of all students who successfully tried out for the position of striker? +soccer_2,SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles',In which state is the college that Charles attends? +soccer_2,"SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'",What is the average and maximum number of hours students who made the team practiced? +soccer_2,SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no',What is the average number of hours spent practicing for students who got rejected? +soccer_2,"SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos","For each position, what is the maximum number of hours for students who spent more than 1000 hours training?" +soccer_2,SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%',Which colleges does each player with a name that starts with the letter D who tried out go to? +soccer_2,SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie',What college has a student who successfully made the team in the role of a goalie? +soccer_2,SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1) S: What IS the largest college?,What are the names of all tryout participants who are from the largest college? +soccer_2,"SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'","How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?" +soccer_2,"SELECT cName FROM College WHERE enr < 13000 AND state = ""AZ"" UNION SELECT cName FROM College WHERE enr > 15000 AND state = ""LA""","What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?" +soccer_2,SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid',What are the names of all schools that have students trying out for the position of goal and 'mid'-field. +soccer_2,SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid',What are the names of the states that have some college students playing in the positions of goalie and mid-field? +soccer_2,SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'),How many schools have students playing in goalie and mid-field positions? +soccer_2,SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie',What are the names of the schools with some players in the mid position but no goalies? +soccer_2,SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie',What are the names of all the states with college students playing in the mid position but no goalies? +soccer_2,SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'),What is the count of states with college students playing in the mid position but not as goalies? +soccer_2,SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL'),What are the names of all colleges with a larger enrollment than the largest college in Florida? +soccer_2,"SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos = ""goalie"")",What is the total number of students enrolled in schools without any goalies? +soccer_2,SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college),How many states have a college with more students than average? +soccer_2,SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college),How many states have smaller colleges than average? +scientist_1,SELECT name FROM projects ORDER BY hours DESC LIMIT 1,Find the name of project that continues for the longest time. +scientist_1,SELECT name FROM projects WHERE hours > (SELECT avg(hours) FROM projects),List the name of all projects that are operated longer than the average working hours of all projects. +scientist_1,"SELECT T1.name , T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY count(*) DESC LIMIT 1",Find the name and hours of project that has the most number of scientists. +scientist_1,SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%',Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to. +scientist_1,SELECT sum(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith',Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to. +scientist_1,SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Puzzling Parallax',Find the name of the scientist who worked on both a project named 'A Matter of Time' and a project named 'A Puzzling Parallax'. +scientist_1,"SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name",Find the number of scientists involved for each project name. +scientist_1,"SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name",Find the number of scientists involved for the projects that require more than 300 hours. +scientist_1,"SELECT count(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name",Find the number of projects which each scientist is working on and scientist's name. +scientist_1,"SELECT T3.ssn , T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT max(hours) FROM projects)",Find the SSN and name of scientists who are assigned to the project with the longest hours. +scientist_1,SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo),Select the project names which are not assigned yet. +scientist_1,SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo),Find the name of scientists who are not assigned to any project. +scientist_1,SELECT count(*) FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo),Find the number of scientists who are not assigned to any project. +scientist_1,SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT max(hours) FROM projects),Find the names of scientists who are not working on the project with the highest hours. +scientist_1,"SELECT T1.Name , T3.Name , T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name","List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name." +products_gen_characteristics,"SELECT T1.product_name , T2.color_description , T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = ""Herbs""","List the names, color descriptions and product descriptions of products with category ""Herbs""." +products_gen_characteristics,"SELECT count(*) FROM products WHERE product_category_code = ""Spices"" AND typical_selling_price > 1000","Find the number of products with category ""Spices"" and typically sold above 1000." +products_gen_characteristics,SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow',What is the name of the product with the color description 'yellow'? +products_gen_characteristics,SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%',Find the category descriptions of the products whose descriptions include letter 't'. +products_gen_characteristics,"SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = ""catnip""","What is the color description of the product with name ""catnip""?" +products_gen_characteristics,"SELECT t1.color_code , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = ""chervil""","What is the color code and description of the product named ""chervil""?" +products_gen_characteristics,"SELECT t1.product_id , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING count(*) >= 2",Find the id and color description of the products with at least 2 characteristics. +products_gen_characteristics,"SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = ""white""","List all the product names with the color description ""white""." +products_gen_characteristics,"SELECT t1.product_name , t1.typical_buying_price , t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = ""yellow""","What are the name and typical buying and selling prices of the products that have color described as ""yellow""?" +products_gen_characteristics,"SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = ""sesame""","How many characteristics does the product named ""sesame"" have?" +products_gen_characteristics,"SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""cumin""","How many distinct characteristic names does the product ""cumin"" have?" +products_gen_characteristics,"SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame""","What are all the characteristic names of product ""sesame""?" +products_gen_characteristics,"SELECT t3.characteristic_name , t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""cumin""","List all the characteristic names and data types of product ""cumin""." +products_gen_characteristics,"SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""sesame"" AND t3.characteristic_type_code = ""Grade""","List all characteristics of product named ""sesame"" with type code ""Grade""." +products_gen_characteristics,"SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""laurel""","How many characteristics does the product named ""laurel"" have?" +products_gen_characteristics,"SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = ""flax""","Find the number of characteristics that the product ""flax"" has." +products_gen_characteristics,"SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""red"" AND t3.characteristic_name = ""fast""","Find the name of the products that have the color description ""red"" and have the characteristic name ""fast""." +products_gen_characteristics,"SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = ""hot""","How many products have the characteristic named ""hot""?" +products_gen_characteristics,"SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = ""warm""",List the all the distinct names of the products with the characteristic name 'warm'. +products_gen_characteristics,"SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""red"" AND t3.characteristic_name = ""slow""","Find the number of the products that have their color described as ""red"" and have a characteristic named ""slow""." +products_gen_characteristics,"SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = ""white"" OR t3.characteristic_name = ""hot""","Count the products that have the color description ""white"" or have the characteristic name ""hot""." +products_gen_characteristics,"SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = ""cumin""","What is the unit of measurement of product named ""cumin""?" +products_gen_characteristics,"SELECT t2.unit_of_measure , t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = ""chervil""","Find the unit of measurement and product category code of product named ""chervil""." +products_gen_characteristics,"SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = ""white"" AND t2.unit_of_measure != ""Handful""","Find the product names that are colored 'white' but do not have unit of measurement ""Handful""." +products_gen_characteristics,SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1,What is the description of the color for most products? +products_gen_characteristics,SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) ASC LIMIT 1,What is the description of the color used by least products? +products_gen_characteristics,SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY count(*) DESC LIMIT 1,What is the characteristic name used by most number of the products? +products_gen_characteristics,"SELECT characteristic_name , other_characteristic_details , characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name , t1.other_characteristic_details , t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id","What are the names, details and data types of the characteristics which are never used by any product?" +products_gen_characteristics,SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING count(*) >= 2,What are characteristic names used at least twice across all products? +program_share,SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1,What is the owner of the channel that has the highest rating ratio? +program_share,SELECT name FROM program ORDER BY launch DESC LIMIT 1,find the name of the program that was launched most recently. +program_share,SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning',Find the names of the channels that are broadcast in the morning. +program_share,SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' INTERSECT SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Night',what are the names of the channels that broadcast in both morning and night? +program_share,"SELECT name FROM program EXCEPT SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Morning""",Find the names of programs that are never broadcasted in the morning. +program_share,"SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Morning"" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = ""Night""",find the program owners that have some programs in both morning and night time. +program_share,SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS',What are the names of the channels owned by CCTV or HBS? +swimming,SELECT name FROM event ORDER BY YEAR DESC LIMIT 1,What is the name of the event that happened in the most recent year? +swimming,SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1,Find the name of the stadium that has the maximum capacity. +swimming,SELECT name FROM stadium WHERE capacity < (SELECT avg(capacity) FROM stadium),Find the names of stadiums whose capacity is smaller than the average capacity. +swimming,SELECT country FROM stadium GROUP BY country ORDER BY count(*) DESC LIMIT 1,Find the country that has the most stadiums. +swimming,SELECT country FROM stadium GROUP BY country HAVING count(*) <= 3,Which country has at most 3 stadiums listed? +swimming,SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000,Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000? +swimming,SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006,Which countries do not have a stadium that was opened after 2006? +swimming,"SELECT nationality , count(*) FROM swimmer GROUP BY nationality HAVING count(*) > 1",List countries that have more than one swimmer. +swimming,SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win',"Find the names of swimmers who has a result of ""win""." +swimming,SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DESC LIMIT 1,What is the name of the stadium which held the most events? +swimming,"SELECT t1.name , t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'","Find the name and capacity of the stadium where the event named ""World Junior"" happened." +swimming,SELECT name FROM stadium WHERE id NOT IN (SELECT stadium_id FROM event),Find the names of stadiums which have never had any event. +swimming,SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY count(*) DESC LIMIT 1,Find the name of the swimmer who has the most records. +swimming,SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING count(*) >= 2,Find the name of the swimmer who has at least 2 records. +swimming,"SELECT t1.name , t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING count(*) > 1","Find the name and nationality of the swimmer who has won (i.e., has a result of ""win"") more than 1 time." +swimming,SELECT name FROM swimmer WHERE id NOT IN (SELECT swimmer_id FROM record),Find the names of the swimmers who have no record. +swimming,SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss',"Find the names of the swimmers who have both ""win"" and ""loss"" results in the record." +swimming,SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia',Find the names of stadiums that some Australian swimmers have been to. +manufacturer,"SELECT name , furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1",Return the name and id of the furniture with the highest market rate. +manufacturer,SELECT sum(market_rate) FROM furniture ORDER BY market_rate DESC LIMIT 2,Find the total market rate of the furnitures that have the top 2 market shares. +manufacturer,"SELECT name , Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1",Find the name and component amount of the least popular furniture. +manufacturer,SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT max(Price_in_Dollar) FROM furniture_manufacte),Find the names of furnitures whose prices are lower than the highest price. +manufacturer,"SELECT open_year , name FROM manufacturer ORDER BY num_of_shops DESC LIMIT 1",Which manufacturer has the most number of shops? List its name and year of opening. +manufacturer,"SELECT name , open_year FROM manufacturer WHERE num_of_shops > 10 OR Num_of_Factories < 10",Give me the name and year of opening of the manufacturers that have either less than 10 factories or more than 10 shops. +manufacturer,"SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990",what is the average number of factories and maximum number of shops for manufacturers that opened before 1990. +manufacturer,"SELECT t1.manufacturer_id , t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1",Find the id and number of shops for the company that produces the most expensive furniture. +manufacturer,"SELECT count(*) , t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id GROUP BY t1.manufacturer_id",Find the number of funiture types produced by each manufacturer as well as the company names. +manufacturer,"SELECT Market_Rate , name FROM furniture WHERE Furniture_ID NOT IN (SELECT Furniture_ID FROM furniture_manufacte)",Find the market shares and names of furnitures which no any company is producing in our records. +school_bus,SELECT home_city FROM driver GROUP BY home_city ORDER BY count(*) DESC LIMIT 1,Show the home city with the most number of drivers. +school_bus,SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40,Show the party with drivers from Hartford and drivers older than 40. +school_bus,SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING count(*) >= 2,Show home city where at least two drivers older than 40 are from. +school_bus,SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40,Show all home cities except for those having a driver older than 40. +school_bus,SELECT name FROM driver WHERE driver_id NOT IN (SELECT driver_id FROM school_bus),Show the names of the drivers without a school bus. +school_bus,SELECT TYPE FROM school GROUP BY TYPE HAVING count(*) = 2,Show the types of schools that have two schools. +school_bus,"SELECT T2.school , T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id",Show the school name and driver name for all school buses. +school_bus,"SELECT max(years_working) , min(years_working) , avg(years_working) FROM school_bus","What is the maximum, minimum and average years spent working on a school bus?" +school_bus,"SELECT school , TYPE FROM school WHERE school_id NOT IN (SELECT school_id FROM school_bus)",Show the school name and type for schools without a school bus. +school_bus,"SELECT T2.type , count(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type",Show the type of school and the number of buses for each type. +school_bus,SELECT count(*) FROM driver WHERE home_city = 'Hartford' OR age < 40,How many drivers are from Hartford city or younger than 40? +school_bus,SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40,List names for drivers from Hartford city and younger than 40. +cre_Doc_Tracking_DB,SELECT count(*) FROM Ref_calendar,How many calendar items do we have? +cre_Doc_Tracking_DB,"SELECT calendar_date , day_Number FROM Ref_calendar",Show all calendar dates and day Numbers. +cre_Doc_Tracking_DB,SELECT count(*) FROM Ref_document_types,Show the number of document types. +cre_Doc_Tracking_DB,"SELECT document_type_code , document_type_name FROM Ref_document_types",List all document type codes and document type names. +cre_Doc_Tracking_DB,"SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = ""RV""",What is the name and description for document type code RV? +cre_Doc_Tracking_DB,"SELECT document_type_code FROM Ref_document_types WHERE document_type_name = ""Paper""","What is the document type code for document type ""Paper""?" +cre_Doc_Tracking_DB,"SELECT count(*) FROM All_documents WHERE document_type_code = ""CV"" OR document_type_code = ""BK""",Show the number of documents with document type code CV or BK. +cre_Doc_Tracking_DB,"SELECT date_stored FROM All_documents WHERE Document_name = ""Marry CV""","What is the date when the document ""Marry CV"" was stored?" +cre_Doc_Tracking_DB,"SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date",What is the day Number and date of all the documents? +cre_Doc_Tracking_DB,"SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = ""How to read a book""","What is the document type name for the document with name ""How to read a book""?" +cre_Doc_Tracking_DB,SELECT count(*) FROM Ref_locations,Show the number of locations. +cre_Doc_Tracking_DB,"SELECT location_code , location_name FROM Ref_locations",List all location codes and location names. +cre_Doc_Tracking_DB,"SELECT location_name , location_description FROM Ref_locations WHERE location_code = ""x""",What are the name and description for location code x? +cre_Doc_Tracking_DB,"SELECT location_code FROM Ref_locations WHERE location_name = ""Canada""","What is the location code for the country ""Canada""?" +cre_Doc_Tracking_DB,SELECT count(*) FROM ROLES,How many roles are there? +cre_Doc_Tracking_DB,"SELECT role_code , role_name , role_description FROM ROLES","List all role codes, role names, and role descriptions." +cre_Doc_Tracking_DB,"SELECT role_name , role_description FROM ROLES WHERE role_code = ""MG""","What are the name and description for role code ""MG""?" +cre_Doc_Tracking_DB,"SELECT role_description FROM ROLES WHERE role_name = ""Proof Reader""","Show the description for role name ""Proof Reader""." +cre_Doc_Tracking_DB,SELECT count(*) FROM Employees,How many employees do we have? +cre_Doc_Tracking_DB,"SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'","Show the name, role code, and date of birth for the employee with name 'Armani'." +cre_Doc_Tracking_DB,"SELECT employee_ID FROM Employees WHERE employee_name = ""Ebba""",What is the id for the employee called Ebba? +cre_Doc_Tracking_DB,"SELECT employee_name FROM Employees WHERE role_code = ""HR""","Show the names of all the employees with role ""HR""." +cre_Doc_Tracking_DB,"SELECT role_code , count(*) FROM Employees GROUP BY role_code",Show all role codes and the number of employees in each role. +cre_Doc_Tracking_DB,SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1,What is the role code with the largest number of employees? +cre_Doc_Tracking_DB,SELECT role_code FROM Employees GROUP BY role_code HAVING count(*) >= 3,Show all role codes with at least 3 employees. +cre_Doc_Tracking_DB,SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1,Show the role code with the least employees. +cre_Doc_Tracking_DB,"SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = ""Ebba""",What is the role name and role description for employee called Ebba? +cre_Doc_Tracking_DB,"SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = ""Editor""",Show the names of employees with role name Editor. +cre_Doc_Tracking_DB,"SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = ""Human Resource"" OR T2.role_name = ""Manager""","Show the employee ids for all employees with role name ""Human Resource"" or ""Manager""." +cre_Doc_Tracking_DB,SELECT DISTINCT location_code FROM Document_locations,What are the different location codes for documents? +cre_Doc_Tracking_DB,"SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = ""Robin CV""","Show the location name for document ""Robin CV""." +cre_Doc_Tracking_DB,"SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations","Show the location code, the starting date and ending date in that location for all the documents." +cre_Doc_Tracking_DB,"SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = ""Robin CV""","What is ""the date in location from"" and ""the date in location to"" for the document with name ""Robin CV""?" +cre_Doc_Tracking_DB,"SELECT location_code , count(*) FROM Document_locations GROUP BY location_code",Show the location codes and the number of documents in each location. +cre_Doc_Tracking_DB,SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1,What is the location code with the most documents? +cre_Doc_Tracking_DB,SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*) >= 3,Show the location codes with at least 3 documents. +cre_Doc_Tracking_DB,"SELECT T2.location_name , T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1",Show the location name and code with the least documents. +cre_Doc_Tracking_DB,"SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id",What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents? +cre_Doc_Tracking_DB,"SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID",Show the id of each employee and the number of document destruction authorised by that employee. +cre_Doc_Tracking_DB,"SELECT Destroyed_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID",Show the employee ids and the number of documents destroyed by each employee. +cre_Doc_Tracking_DB,SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed,Show the ids of the employees who don't authorize destruction for any document. +cre_Doc_Tracking_DB,SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed,Show the ids of all employees who have authorized destruction. +cre_Doc_Tracking_DB,SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed,Show the ids of all employees who have destroyed a document. +cre_Doc_Tracking_DB,SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed,Show the ids of all employees who don't destroy any document. +book_2,SELECT Publisher FROM publication ORDER BY Price DESC LIMIT 1,List the publisher of the publication with the highest price. +book_2,SELECT Publication_Date FROM publication ORDER BY Price ASC LIMIT 3,List the publication dates of publications with 3 lowest prices. +book_2,SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID WHERE T2.Price > 4000000,Show writers who have published a book with price more than 4000000. +book_2,SELECT T1.Title FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID ORDER BY T2.Price DESC,Show the titles of books in descending order of publication price. +book_2,SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*) > 1,Show publishers that have more than one publication. +book_2,SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1,Please show the most common publication date. +book_2,SELECT Writer FROM book GROUP BY Writer HAVING COUNT(*) > 1,List the writers who have written more than one book. +book_2,SELECT Title FROM book WHERE Book_ID NOT IN (SELECT Book_ID FROM publication),List the titles of books that are not published. +book_2,SELECT Publisher FROM publication WHERE Price > 10000000 INTERSECT SELECT Publisher FROM publication WHERE Price < 5000000,Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000. +performance_attendance,SELECT count(*) FROM performance,How many performances are there? +performance_attendance,SELECT HOST FROM performance ORDER BY Attendance ASC,List the hosts of performances in ascending order of attendance. +performance_attendance,"SELECT Date , LOCATION FROM performance",What are the dates and locations of performances? +performance_attendance,"SELECT Attendance FROM performance WHERE LOCATION = ""TD Garden"" OR LOCATION = ""Bell Centre""","Show the attendances of the performances at location ""TD Garden"" or ""Bell Centre""" +performance_attendance,SELECT avg(Attendance) FROM performance,What is the average number of attendees for performances? +performance_attendance,SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1,What is the date of the performance with the highest number of attendees? +performance_attendance,"SELECT LOCATION , COUNT(*) FROM performance GROUP BY LOCATION",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,Show the most common location of performances. +performance_attendance,SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2,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,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",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",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""","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",Show the names of members and the dates of performances they attended in descending order of attendance of the performances. +music_2,"SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = ""Solveig""","Find all the stage positions of the musicians with first name ""Solveig""" +music_2,"SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = ""Heilo""","Find all the songs performed by artist with last name ""Heilo""" +music_2,"SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songId = T1.songId WHERE T3.Title = ""Flash""","How many musicians performed in the song ""Flash""?" +music_2,"SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Firstname = ""Marianne""","Find all the songs produced by artists with first name ""Marianne""." +music_2,"SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Badlands""","Who performed the song named ""Badlands""? Show the first name and the last name." +music_2,"SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Badlands"" AND T1.StagePosition = ""back""","Who is performing in the back stage position for the song ""Badlands""? Show the first name and the last name." +music_2,SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1,What is the label that has the most albums? +music_2,SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1,What is the last name of the musician that have produced the most number of songs? +music_2,"SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = ""back"" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1",What is the last name of the musician that has been at the back position the most? +music_2,SELECT title FROM songs WHERE title LIKE '% the %',"Find all the songs whose name contains the word ""the""." +music_2,"SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = ""Heilo"" AND T3.title = ""Le Pop""","What instrument did the musician with last name ""Heilo"" use in the song ""Le Pop""?" +music_2,SELECT instrument FROM instruments GROUP BY instrument ORDER BY count(*) DESC LIMIT 1,What is the most used instrument? +music_2,"SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","What instruments does the song ""Le Pop"" use?" +music_2,"SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","How many instruments does the song ""Le Pop"" use?" +music_2,"SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = ""Heilo""","How many instrument does the musician with last name ""Heilo"" use?" +music_2,"SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = ""Heilo""","Find all the instruments ever used by the musician with last name ""Heilo""?" +music_2,SELECT title FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid GROUP BY T1.songid ORDER BY count(*) DESC LIMIT 1,Which song has the most vocals? +music_2,SELECT TYPE FROM vocals GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1,Which vocal type is the most frequently appearing type? +music_2,"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = ""Heilo"" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1","Which vocal type has the band mate with last name ""Heilo"" played the most?" +music_2,"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","What are the vocal types used in song ""Le Pop""?" +music_2,"SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Demon Kitty Rag""","Find the number of vocal types used in song ""Demon Kitty Rag""?" +music_2,"SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = ""lead""",How many songs have a lead vocal? +music_2,"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = ""Solveig"" AND T2.title = ""A Bar In Amsterdam""","Which vocal type did the musician with first name ""Solveig"" played in the song with title ""A Bar in Amsterdam""?" +music_2,"SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = ""lead""",Find all the songs that do not have a lead vocal. +music_2,"SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Le Pop""","Who performed the song named ""Le Pop""?" +music_2,"SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = ""Heilo"" AND T3.title = ""Badlands""","What instrument did the musician with last name ""Heilo"" use in the song ""Badlands""?" +music_2,"SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Badlands""","How many instruments does the song ""Badlands"" use?" +music_2,"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Badlands""","What are the vocal types used in song ""Badlands""?" +music_2,"SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = ""Le Pop""","Find the number of vocal types used in song ""Le Pop""" +music_2,"SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = ""shared""",How many songs have a shared vocal? +music_2,"SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = ""back""",Find all the songs that do not have a back vocal. +music_2,"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = ""Solveig"" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1","Which vocal type has the band mate with first name ""Solveig"" played the most?" +music_2,"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = ""Heilo"" AND T2.title = ""Der Kapitan""","Which vocal type did the musician with last name ""Heilo"" played in the song with title ""Der Kapitan""?" +music_2,SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1,Find the first name of the band mate that has performed in most songs. +music_2,"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = ""Marianne"" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1","Which vocal type has the band mate with first name ""Marianne"" played the most?" +music_2,"SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = ""Der Kapitan"" AND T1.StagePosition = ""back""","Who is performing in the back stage position for the song ""Der Kapitan""? Show the first name and last name." +music_2,"SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = ""A Kiss Before You Go: Live in Hamburg""","What are the songs in album ""A Kiss Before You Go: Live in Hamburg""?" +music_2,"SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = ""Universal Music Group""","What are all the songs in albums under label ""Universal Music Group""?" +soccer_1,"SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = ""England""",How many leagues are there in England? +soccer_1,"SELECT max(weight) , min(weight) FROM Player",What is the maximum and minimum weight of all players? +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.overall_rating > ( SELECT avg(overall_rating) FROM Player_Attributes ),List all player names who have an overall rating higher than the average. +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.dribbling = ( SELECT max(dribbling) FROM Player_Attributes),What are the names of players who have the best dribbling? +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.crossing > 90 AND T2.preferred_foot = ""right""",List the names of all players who have a crossing score higher than 90 and prefer their right foot. +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",List the names of all left-footed players who have overall rating between 85 and 90. +soccer_1,"SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot","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,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""",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,Who are the top 3 players in terms of overall rating? +customer_deliveries,"SELECT t1.product_name , t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count(*) DESC LIMIT 1",Find the name and price of the product that has been ordered the greatest number of times. +customer_deliveries,SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1,Find the name of the most expensive product. +customer_deliveries,SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California',Find the names of customers who are not living in the state of California. +customer_deliveries,"SELECT t1.customer_name , t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'",Find the names and phone numbers of customers living in California state. +customer_deliveries,SELECT state_province_county FROM addresses WHERE address_id NOT IN (SELECT employee_address_id FROM employees),Find the states which do not have any employee in their record. +customer_deliveries,SELECT customer_name FROM customers ORDER BY date_became_customer LIMIT 5,Find the name of the first 5 customers. +customer_deliveries,SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1,Find the payment method that is used most frequently. +customer_deliveries,SELECT t1.route_name FROM delivery_routes AS t1 JOIN delivery_route_locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY count(*) DESC LIMIT 1,Find the name of route that has the highest number of deliveries. +document_management,"SELECT document_name , access_count FROM documents ORDER BY document_name","Find the name and access counts of all documents, in alphabetic order of the document name." +document_management,"SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1","Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?" +document_management,SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4,Find the types of documents with more than 4 documents. +document_management,SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1,Find the total access count of all documents in the most popular document type. +document_management,SELECT avg(access_count) FROM documents,What is the average access count of documents? +document_management,"SELECT document_type_code FROM documents WHERE document_name = ""David CV""","What is the type of the document named ""David CV""?" +document_management,SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000,What document types do have more than 10000 total access number. +document_management,"SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = ""David CV""","What are all the section titles of the document named ""David CV""?" +document_management,SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections),Find all the name of documents without any sections. +document_management,"SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = ""Acknowledgement""","Find the average access counts of documents with functional area ""Acknowledgement""." +document_management,SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id,Find names of the document without any images. +document_management,SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1,What is the name of the document with the most number of sections? +document_management,"SELECT document_name FROM documents WHERE document_name LIKE ""%CV%""","List all the document names which contains ""CV""." +document_management,SELECT count(*) FROM users WHERE user_login = 1,How many users are logged in? +document_management,SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1),Find the description of the most popular role among the users that have logged in. +document_management,SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1,Find the average access count of documents with the least popular structure. +document_management,"SELECT image_name , image_url FROM images ORDER BY image_name",List all the image name and URLs in the order of their names. +document_management,"SELECT count(*) , role_code FROM users GROUP BY role_code",Find the number of users in each role. +insurance_fnol,SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1,Which policy type has the most records in the database? +insurance_fnol,SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1),What are all the customer phone numbers under the most popular policy type? +insurance_fnol,SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4,Find the policy type used by more than 4 customers. +insurance_fnol,"SELECT sum(settlement_amount) , avg(settlement_amount) FROM settlements",Find the total and average amount of settlements. +insurance_fnol,SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 2,Find the name of services that have been used for more than 2 times in first notification of loss. +insurance_fnol,SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1,What is the effective date of the claim that has the largest amount of total settlement? +insurance_fnol,"SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = ""Dayana Robel""","How many policies are listed for the customer named ""Dayana Robel""?" +insurance_fnol,SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1,What is the name of the customer who has the most policies listed? +insurance_fnol,"SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = ""Dayana Robel""","What are all the policy types of the customer named ""Dayana Robel""?" +insurance_fnol,SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1),What are all the policy types of the customer that has the most policies listed? +insurance_fnol,SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id,Find the names of users who do not have a first notification of loss record. +insurance_fnol,"SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = ""Close a policy"" OR t3.service_name = ""Upgrade a policy""","Find the names of customers who have used either the service ""Close a policy"" or the service ""Upgrade a policy""." +insurance_fnol,"SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = ""Close a policy"" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = ""New policy application""","Find the names of customers who have used both the service ""Close a policy"" and the service ""New policy application""." +insurance_fnol,"SELECT customer_id FROM customers WHERE customer_name LIKE ""%Diana%""","Find the IDs of customers whose name contains ""Diana""." +insurance_fnol,"SELECT max(settlement_amount) , min(settlement_amount) FROM settlements",What are the maximum and minimum settlement amount on record? +wine_1,SELECT Name FROM WINE ORDER BY Score DESC LIMIT 1,What is the name of the highest rated wine? +wine_1,SELECT Winery FROM WINE ORDER BY SCORE DESC LIMIT 1,Which winery is the wine that has the highest score from? +wine_1,"SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""Red""",List the names of all distinct wines that are made of red color grape. +wine_1,"SELECT DISTINCT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = ""North Coast""",Find the names of all distinct wines that have appellations in North Coast area. +wine_1,"SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = ""Sonoma""",Give me the average prices of wines that are produced by appellations in Sonoma County. +wine_1,"SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""White""",What are the names and scores of wines that are made of white color grapes? +wine_1,"SELECT max(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = ""Central Coast"" AND T2.year < 2005",Find the maximum price of wines from the appelations in Central Coast area and produced before the year of 2005. +wine_1,"SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""White"" AND T2.score > 90",Find the different white color grapes that produced wines with scores higher than 90. +wine_1,"SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ""Red"" AND T2.price > 50",What are the wines that have prices higher than 50 and made of Red color grapes? +wine_1,"SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = ""Monterey"" AND T2.price < 50",What are the wines that have prices lower than 50 and have appelations in Monterey county? +wine_1,"SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = ""John Anthony"")",Find the distinct names of all wines that have prices higher than some wines from John Anthony winery. +wine_1,SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY count(*) DESC LIMIT 1,What is the area of the appelation that produces the highest number of wines before the year of 2010? +wine_1,SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1,What is the color of the grape whose wine products have the highest average price? +wine_1,SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010,Find the distinct names of wines produced before the year of 2000 or after the year of 2010. +wine_1,"SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = ""Zinfandel""",What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape? +wine_1,"SELECT max(Price) , max(Score) FROM WINE WHERE Appelation = ""St. Helena""",What are the maximum price and score of wines produced by St. Helena appelation? +wine_1,"SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR",What are the maximum price and score of wines in each year? +wine_1,"SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation",What are the average price and score of wines grouped by appelation? +wine_1,SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4,Find the wineries that have at least four wines. +wine_1,SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING count(*) <= 3,Find the country of all appelations who have at most three wines. +wine_1,"SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = ""Brander"")",What are the names of wines whose production year are before the year of all wines by Brander winery? +wine_1,SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006),What are the names of wines that are more expensive than all wines made in the year 2006? +wine_1,"SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = ""White"" GROUP BY T2.Winery ORDER BY count(*) DESC LIMIT 3",Find the top 3 wineries with the greatest number of wines made of white color grapes. +wine_1,"SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR","List the grape, winery and year of the wines whose price is bigger than 100 ordered by year." +wine_1,"SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name","List the grape, appelation and name of wines whose score is higher than 93 ordered by Name." +wine_1,"SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = ""Central Coast""",Find the appelations that produce wines after the year of 2008 but not in Central Coast area. +wine_1,SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma'),Find the average price of wines that are not produced from Sonoma county. +company_office,"SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != ""Banking""","What are the maximum and minimum sales of the companies whose industries are not ""Banking""." +company_office,SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1,Find the stories of the building with the largest height. +company_office,"SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id",List the name of a building along with the name of a company whose office is in the building. +company_office,SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1,Show the names of the buildings that have more than one company offices. +company_office,SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1,Show the name of the building that has the most company offices. +company_office,"SELECT name FROM buildings WHERE Status = ""on-hold"" ORDER BY Stories ASC","Please show the names of the buildings whose status is ""on-hold"", in ascending order of stories." +company_office,SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC,Please show the industries of companies in descending order of the number of companies. +company_office,SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1,List the industry shared by the most companies. +company_office,SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations),List the names of buildings that have no company office. +company_office,"SELECT Industry FROM Companies WHERE Headquarters = ""USA"" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = ""China""","Show the industries shared by companies whose headquarters are ""USA"" and companies whose headquarters are ""China""." +company_office,"SELECT count(*) FROM Companies WHERE Industry = ""Banking"" OR Industry = ""Conglomerate""","Find the number of companies whose industry is ""Banking"" or ""Conglomerate""," +theme_gallery,SELECT count(*) FROM artist,How many artists do we have? +theme_gallery,"SELECT name , age , country FROM artist ORDER BY Year_Join","Show all artist name, age, and country ordered by the year they joined." +theme_gallery,SELECT DISTINCT country FROM artist,What are all distinct country for artists? +theme_gallery,"SELECT name , year_join FROM artist WHERE country != 'United States'",Show all artist names and the year joined who are not from United States. +theme_gallery,SELECT count(*) FROM artist WHERE age > 46 AND year_join > 1990,How many artists are above age 46 and joined after 1990? +theme_gallery,"SELECT avg(age) , min(age) FROM artist WHERE country = 'United States'",What is the average and minimum age of all artists from United States. +theme_gallery,SELECT name FROM artist ORDER BY year_join DESC LIMIT 1,What is the name of the artist who joined latest? +theme_gallery,SELECT count(*) FROM exhibition WHERE YEAR >= 2005,How many exhibition are there in year 2005 or after? +theme_gallery,"SELECT theme , YEAR FROM exhibition WHERE ticket_price < 15",Show theme and year for all exhibitions with ticket prices lower than 15. +theme_gallery,"SELECT T2.name , count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id",Show all artist names and the number of exhibitions for each artist. +theme_gallery,"SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1",What is the name and country for the artist with most number of exhibitions? +theme_gallery,SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition),Show names for artists without any exhibition. +theme_gallery,"SELECT T1.theme , T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT avg(ticket_price) FROM exhibition)",What is the theme and artist name for the exhibition with a ticket price higher than the average? +theme_gallery,"SELECT avg(ticket_price) , min(ticket_price) , max(ticket_price) FROM exhibition WHERE YEAR < 2009","Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009." +theme_gallery,"SELECT theme , YEAR FROM exhibition ORDER BY ticket_price DESC",Show theme and year for all exhibitions in a descending order of ticket price. +theme_gallery,"SELECT T2.theme , T1.date , T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004","What is the theme, date, and attendance for the exhibition in year 2004?" +theme_gallery,SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004,Show all artist names who didn't have an exhibition in 2004. +theme_gallery,SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500,Show the theme for exhibitions with both records of an attendance below 100 and above 500. +theme_gallery,SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10,How many exhibitions have a attendance more than 100 or have a ticket price below 10? +county_public_safety,"SELECT min(Crime_rate) , max(Crime_rate) FROM county_public_safety",What are the minimum and maximum crime rate of counties? +county_public_safety,SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1,List the name of the county with the largest population. +county_public_safety,SELECT Name FROM city ORDER BY White DESC LIMIT 5,List the names of the city with the top 5 white percentages. +county_public_safety,SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1),Show the name of cities in the county that has the largest number of police officers. +county_public_safety,SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000),Show the number of cities in counties that have a population more than 20000. +county_public_safety,SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90,Show the crime rate of counties with a city having white percentage more than 90. +county_public_safety,SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1,What is the location shared by most counties? +county_public_safety,SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city),List the names of counties that do not have any cities. +county_public_safety,"SELECT Police_force FROM county_public_safety WHERE LOCATION = ""East"" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = ""West""",Show the police force shared by counties with location on the east and west. +medicine_enzyme_interaction,SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor',What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'? +medicine_enzyme_interaction,"SELECT T1.id , T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING count(*) >= 2",What are the ids and names of the medicine that can interact with two or more enzymes? +medicine_enzyme_interaction,"SELECT T1.id , T1.Name , T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC","What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with." +medicine_enzyme_interaction,"SELECT T1.id , T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1",What is the id and name of the enzyme with most number of medicines that can interact as 'activator'? +medicine_enzyme_interaction,SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole',What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'? +medicine_enzyme_interaction,"SELECT interaction_type , count(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY count(*) DESC LIMIT 1",What is the most common interaction type between enzymes and medicine? And how many are there? +medicine_enzyme_interaction,SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction );,How many enzymes do not have any interactions? +medicine_enzyme_interaction,"SELECT T1.id , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3",What is the id and trade name of the medicines can interact with at least 3 enzymes? +medicine_enzyme_interaction,"SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'","What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?" +medicine_enzyme_interaction,"SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'",List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes. +medicine_enzyme_interaction,"SELECT name , trade_name FROM medicine EXCEPT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'",Show the medicine names and trade names that cannot interact with the enzyme with product 'Protoporphyrinogen IX'. +sakila_1,SELECT first_name FROM actor GROUP BY first_name ORDER BY count(*) DESC LIMIT 1,What is the most popular first name of the actors? +sakila_1,"SELECT first_name , last_name FROM actor GROUP BY first_name , last_name ORDER BY count(*) DESC LIMIT 1",What is the most popular full name of the actors? +sakila_1,SELECT district FROM address GROUP BY district HAVING count(*) >= 2,Which districts have at least two addresses? +sakila_1,"SELECT T2.city , count(*) , T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY count(*) DESC LIMIT 1","Which city has the most addresses? List the city name, number of addresses, and city id." +sakila_1,"SELECT title , film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING count(*) < 3",Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id. +sakila_1,SELECT count(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia',How many cities are there in Australia? +sakila_1,SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING count(*) >= 3,Which countries have at least 3 cities? +sakila_1,SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa',Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa. +sakila_1,"SELECT title , rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1",Which film has the highest rental rate? And what is the rate? +sakila_1,"SELECT T2.title , T2.film_id , T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1","Which film has the most number of actors or actresses? List the film name, film id and description." +sakila_1,"SELECT T2.first_name , T2.last_name , T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY count(*) DESC LIMIT 1","Which film actor (actress) starred the most films? List his or her first name, last name and actor id." +sakila_1,"SELECT T2.first_name , T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING count(*) > 30",Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name. +sakila_1,SELECT store_id FROM inventory GROUP BY store_id ORDER BY count(*) DESC LIMIT 1,Which store owns most items? +sakila_1,"SELECT T1.first_name , T1.last_name , T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY sum(amount) ASC LIMIT 1","Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id." +sakila_1,SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF',What is the genre name of the film HUNGER ROOF? +sakila_1,"SELECT T2.name , T1.category_id , count(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id","How many films are there in each category? List the genre name, genre id and the count." +sakila_1,"SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1",Which film has the most copies in the inventory? List both title and id. +sakila_1,"SELECT T1.title , T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1",What is the film title and inventory id of the item in the inventory which was rented most frequently? +sakila_1,SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1,Where is store 1 located? +sakila_1,"SELECT T1.first_name , T1.last_name , T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY count(*) ASC LIMIT 1",Which staff handled least number of payments? List the full name and the id. +sakila_1,SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK',Which language does the film AIRPORT POLLOCK use? List the language name. +sakila_1,SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%',Which movies have 'Deleted Scenes' as a substring in the special feature? +sakila_1,SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1,When did the first payment happen? +sakila_1,"SELECT T2.address , T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'",Where does the customer with the first name Linda live? And what is her email? +sakila_1,SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200,"Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles." +sakila_1,"SELECT T1.first_name , T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1",What is the first name and the last name of the customer who made the earliest rental? +sakila_1,"SELECT DISTINCT T1.first_name , T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'",What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns? +sakila_1,SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1,Which store has most the customers? +sakila_1,SELECT amount FROM payment ORDER BY amount DESC LIMIT 1,What is the largest payment amount? +sakila_1,SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa',Where does the staff member with the first name Elsa live? +customers_and_invoices,"SELECT account_id , date_account_opened , account_name , other_account_details FROM Accounts","Show the id, the date of account opened, the account name, and other account detail for all accounts." +customers_and_invoices,"SELECT T1.account_id , T1.date_account_opened , T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan'","Show the id, the account name, and other account details for all accounts by the customer with first name 'Meaghan'." +customers_and_invoices,"SELECT T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = ""Meaghan"" AND T2.customer_last_name = ""Keeling""",Show the account name and other account detail for all accounts by the customer with first name Meaghan and last name Keeling. +customers_and_invoices,"SELECT T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = ""900""",Show the first name and last name for the customer with account name 900. +customers_and_invoices,"SELECT DISTINCT T1.customer_first_name , T1.customer_last_name , T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id","Show the unique first names, last names, and phone numbers for all customers with any account." +customers_and_invoices,SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts,Show customer ids who don't have an account. +customers_and_invoices,"SELECT count(*) , customer_id FROM Accounts GROUP BY customer_id",How many accounts does each customer have? List the number and customer id. +customers_and_invoices,"SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1","What is the customer id, first and last name with most number of accounts." +customers_and_invoices,"SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name , count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id","Show id, first name and last name for all customers and the number of accounts." +customers_and_invoices,"SELECT T2.customer_first_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2",Show first name and id for all customers with at least 2 accounts. +customers_and_invoices,"SELECT gender , count(*) FROM Customers GROUP BY gender",Show the number of customers for each gender. +customers_and_invoices,SELECT count(*) FROM Financial_transactions,How many transactions do we have? +customers_and_invoices,"SELECT count(*) , account_id FROM Financial_transactions",How many transaction does each account have? Show the number and account id. +customers_and_invoices,"SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = ""337""",How many transaction does account with name 337 have? +customers_and_invoices,"SELECT avg(transaction_amount) , min(transaction_amount) , max(transaction_amount) , sum(transaction_amount) FROM Financial_transactions","What is the average, minimum, maximum, and total transaction amount?" +customers_and_invoices,SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amount) FROM Financial_transactions),Show ids for all transactions whose amounts are greater than the average. +customers_and_invoices,"SELECT transaction_type , sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type",Show the transaction types and the total amount of transactions. +customers_and_invoices,"SELECT T2.account_name , T1.account_id , count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id","Show the account name, id and the number of transactions for each account." +customers_and_invoices,SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1,Show the account id with most number of transactions. +customers_and_invoices,"SELECT T1.account_id , T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING count(*) >= 4",Show the account id and name with at least 4 transactions. +customers_and_invoices,SELECT DISTINCT product_size FROM Products,Show all product sizes. +customers_and_invoices,SELECT DISTINCT product_color FROM Products,Show all product colors. +customers_and_invoices,"SELECT invoice_number , count(*) FROM Financial_transactions GROUP BY invoice_number",Show the invoice number and the number of transactions for each invoice. +customers_and_invoices,"SELECT T2.invoice_number , T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1",What is the invoice number and invoice date for the invoice with most number of transactions? +customers_and_invoices,SELECT count(*) FROM Invoices,How many invoices do we have? +customers_and_invoices,"SELECT T1.invoice_date , T1.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id",Show invoice dates and order id and details for all invoices. +customers_and_invoices,"SELECT order_id , count(*) FROM Invoices GROUP BY order_id",Show the order ids and the number of invoices for each order. +customers_and_invoices,"SELECT T2.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING count(*) > 2",What is the order id and order details for the order more than two invoices. +customers_and_invoices,"SELECT T2.customer_last_name , T1.customer_id , T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1","What is the customer last name, id and phone number with most number of orders?" +customers_and_invoices,SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id = T2.product_id,Show all product names without an order. +customers_and_invoices,"SELECT T2.product_name , sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name",Show all product names and the total quantity ordered for each product name. +customers_and_invoices,"SELECT order_id , count(*) FROM Order_items GROUP BY order_id",Show the order ids and the number of items in each order. +customers_and_invoices,"SELECT product_id , count(DISTINCT order_id) FROM Order_items GROUP BY product_id",Show the product ids and the number of unique orders containing each product. +customers_and_invoices,"SELECT T2.product_name , count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name",Show all product names and the number of order items on each product. +customers_and_invoices,"SELECT order_id , count(DISTINCT product_id) FROM Order_items GROUP BY order_id",Show order ids and the number of products in each order. +customers_and_invoices,"SELECT order_id , sum(product_quantity) FROM Order_items GROUP BY order_id",Show order ids and the total quantity in each order. +department_management,SELECT count(*) FROM head WHERE age > 56,How many heads of the departments are older than 56 ? +department_management,"SELECT name , born_state , age FROM head ORDER BY age","List the name, born state and age of the heads of departments ordered by age." +department_management,"SELECT creation , name , budget_in_billions FROM department","List the creation year, name and budget of each department." +department_management,"SELECT max(budget_in_billions) , min(budget_in_billions) FROM department",What are the maximum and minimum budget of the departments? +department_management,SELECT avg(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15,What is the average number of employees of the departments whose rank is between 10 and 15? +department_management,SELECT name FROM head WHERE born_state != 'California',What are the names of the heads who are born outside the California state? +department_management,SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama',What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'? +department_management,SELECT born_state FROM head GROUP BY born_state HAVING count(*) >= 3,What are the names of the states where at least 3 heads were born? +department_management,SELECT creation FROM department GROUP BY creation ORDER BY count(*) DESC LIMIT 1,In which year were most departments established? +department_management,"SELECT T1.name , T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes'",Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'? +department_management,SELECT count(DISTINCT temporary_acting) FROM management,How many acting statuses are there? +department_management,SELECT count(*) FROM department WHERE department_id NOT IN (SELECT department_id FROM management);,How many departments are led by heads who are not mentioned? +department_management,SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes',What are the distinct ages of the heads who are acting? +department_management,SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Treasury' INTERSECT SELECT T3.born_state FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T1.name = 'Homeland Security',List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born. +department_management,"SELECT T1.department_id , T1.name , count(*) FROM management AS T2 JOIN department AS T1 ON T1.department_id = T2.department_id GROUP BY T1.department_id HAVING count(*) > 1","Which department has more than 1 head at a time? List the id, name and the number of heads." +city_record,SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1,What is id of the city that hosted events in the most recent year? +city_record,SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010,Find the cities which were once a host city after 2010? +city_record,SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1,Which city has hosted the most events? +city_record,"SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = ""Nanjing ( Jiangsu )"" AND T3.competition = ""1994 FIFA World Cup qualification""","What is the venue of the competition ""1994 FIFA World Cup qualification"" hosted by ""Nanjing ( Jiangsu )""?" +city_record,"SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = ""Shanghai""",Give me the temperature of Shanghai in January. +city_record,"SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = ""Taizhou ( Zhejiang )""","What is the host year of city ""Taizhou ( Zhejiang )""?" +city_record,SELECT city FROM city ORDER BY regional_population DESC LIMIT 3,Which three cities have the largest regional population? +city_record,"SELECT city , GDP FROM city ORDER BY GDP LIMIT 1",Which city has the lowest GDP? Please list the city name and its GDP. +city_record,SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1,Which city has the highest temperature in February? +city_record,SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct,Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct? +city_record,SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city,Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities? +city_record,SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city,Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities. +city_record,SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city,Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities? +city_record,SELECT city FROM city WHERE regional_population > 8000000 UNION SELECT city FROM city WHERE regional_population < 5000000,Please give me a list of cities whose regional population is over 8000000 or under 5000000. +city_record,SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1,what is the GDP of the city with the largest population. +shop_membership,SELECT count(*) FROM branch WHERE membership_amount > (SELECT avg(membership_amount) FROM branch),How many branches where have more than average number of memberships are there? +shop_membership,SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3,What are names for top three branches with most number of membership? +shop_membership,SELECT open_year FROM branch GROUP BY open_year HAVING count(*) >= 2,List all open years when at least two shops are opened. +shop_membership,"SELECT min(membership_amount) , max(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'",Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London. +shop_membership,"SELECT city , count(*) FROM branch WHERE open_year < 2010 GROUP BY city",Show the city and the number of branches opened before 2010 for each city. +shop_membership,SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY count(*) DESC LIMIT 1,Show the membership level with most number of members. +shop_membership,"SELECT T3.name , T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year",Show all member names and registered branch names sorted by register year. +shop_membership,"SELECT T2.name , count(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id",Show all branch names with the number of members in each branch registered after 2015. +shop_membership,SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch),Show member names without any registered branch. +shop_membership,"SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)",List the branch name and city without any registered members. +shop_membership,"SELECT T2.name , T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY count(*) DESC LIMIT 1",What is the name and open year for the branch with most number of memberships registered in 2016? +shop_membership,"SELECT T2.name , T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016",Show the member name and hometown who registered a branch in 2016. +shop_membership,SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100,Show all city with a branch opened in 2001 and a branch with more than 100 membership. +shop_membership,SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100,Show all cities without a branch having more than 100 memberships. +shop_membership,SELECT sum(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018,What is the sum of total pounds of purchase in year 2018 for all branches in London? +shop_membership,SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6,What is the total number of purchases for members with level 6? +shop_membership,"SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram , Georgia'","Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia." +perpetrator,SELECT count(*) FROM perpetrator;,How many perpetrators are there? +perpetrator,SELECT Date FROM perpetrator ORDER BY Killed DESC;,List the date of perpetrators in descending order of the number of people killed. +perpetrator,SELECT Injured FROM perpetrator ORDER BY Injured ASC;,List the number of people injured by perpetrators in ascending order. +perpetrator,SELECT avg(Injured) FROM perpetrator;,What is the average number of people injured by all perpetrators? +perpetrator,SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1;,What is the location of the perpetrator with the largest kills. +perpetrator,SELECT Name FROM People ORDER BY Height ASC;,What are the names of people in ascending order of height? +perpetrator,SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID;,What are the names of perpetrators? +perpetrator,"SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country != ""China"";","What are the names of perpetrators whose country is not ""China""?" +perpetrator,SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1;,What is the name of the perpetrator with the biggest weight. +perpetrator,SELECT sum(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84;,What is the total kills of the perpetrators with height more than 1.84. +perpetrator,"SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = ""China"" OR T2.Country = ""Japan""","What are the names of perpetrators in country ""China"" or ""Japan""?" +perpetrator,SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC;,What are the heights of perpetrators in descending order of the number of people they injured? +perpetrator,"SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country;",What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. +perpetrator,"SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1;",What is the country that has the most perpetrators? +perpetrator,"SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2;",What are the countries that have at least two perpetrators? +perpetrator,SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC;,List the names of perpetrators in descending order of the year. +perpetrator,SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM perpetrator);,List the names of people that are not perpetrators. +perpetrator,SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20,Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20. +perpetrator,SELECT count(DISTINCT LOCATION) FROM perpetrator;,How many distinct locations of perpetrators are there? +perpetrator,SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1,Show the date of the tallest perpetrator. +company_1,SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston',Find the names of departments that are located in Houston. +ship_1,"SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank",How many captains younger than 50 are in each rank? +ship_1,SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1,Which rank is the most common among captains? +ship_1,SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2,Which classes have more than two captains? +ship_1,SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant',Find the name of captains whose rank are either Midshipman or Lieutenant. +ship_1,"SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS",What are the average and minimum age of captains in different class? +ship_1,SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner',Find the captain rank that has some captains in both Cutter and Armed schooner classes. +ship_1,SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line',Find the captain rank that has no captain in Third-rate ship of the line class. +ship_1,SELECT name FROM captain ORDER BY age LIMIT 1,What is the name of the youngest captain? +ship_1,"SELECT name, type, flag from ship where built_year in (SELECT max(built_year) from ship)","Find the name, type, and flag of the ships that were built in the most recent year." +ship_1,SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1,Which flag is most widely used among all ships? +ship_1,SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta',Find the ship type that are used by both ships with Panama and Malta flags. +ship_1,SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1,In which year were most of ships built? +ship_1,SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1,Find the name of the ships that have more than one captain. +ship_1,"SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)",what are the names and classes of the ships that do not have any captain yet? +ship_1,SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1,Find the name of the ship that is steered by the youngest captain. +ship_1,"SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')",Find the name and flag of ships that are not steered by any captain with Midshipman rank. +game_injury,"SELECT max(home_games) , min(home_games) , avg(home_games) FROM stadium","What are the maximum, minimum and average home games each stadium held?" +game_injury,SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel',What is the season of the game which causes the player 'Walter Samuel' to get injured? +game_injury,"SELECT T1.id , T1.score , T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING count(*) >= 2","What are the ids, scores, and dates of the games which caused at least two injury accidents?" +game_injury,"SELECT T1.id , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1",What are the id and name of the stadium where the most injury accidents happened? +game_injury,"SELECT T1.season , T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'",In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'? +game_injury,SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident ),How many games are free of injury accidents? +game_injury,SELECT count(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010,How many distinct kinds of injuries happened after season 2010? +game_injury,SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Thiago Motta',List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured. +game_injury,"SELECT name , average_attendance , total_attendance FROM stadium EXCEPT SELECT T2.name , T2.average_attendance , T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id","Show the name, average attendance, total attendance for stadiums where no accidents happened." +game_injury,"SELECT name FROM stadium WHERE name LIKE ""%Bank%""","Which stadium name contains the substring ""Bank""?" +game_injury,"SELECT T1.name , count(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id",How many games has each stadium held? +small_bank_1,SELECT sum(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name != 'Brown',Find the total savings balance of all accounts except the account with name ‘Brown’. +small_bank_1,SELECT count(*) FROM savings WHERE balance > (SELECT avg(balance) FROM savings),How many accounts have a savings balance above the average savings balance? +small_bank_1,"SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT max(balance) FROM checking)",Find the name and id of accounts whose checking balance is below the maximum checking balance. +small_bank_1,SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%',What is the checking balance of the account whose owner’s name contains the substring ‘ee’? +small_bank_1,"SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'",Find the checking balance and saving balance in the Brown’s account. +small_bank_1,SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM savings),"Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance." +small_bank_1,SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM savings)),Find the checking balance of the accounts whose savings balance is higher than the average savings balance. +small_bank_1,SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance LIMIT 1,Find the name of account that has the lowest total checking and saving balance. +small_bank_1,"SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT avg(balance) FROM savings)",Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance. +small_bank_1,"SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1",Find the name and checking balance of the account with the lowest savings balance. +small_bank_1,"SELECT count(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name",Find the number of checking accounts for each account name. +small_bank_1,"SELECT sum(T2.balance) , T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name",Find the total saving balance for each account name. +small_bank_1,SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM checking),Find the name of accounts whose checking balance is below the average checking balance. +small_bank_1,SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1,Find the saving balance of the account with the highest checking balance. +small_bank_1,SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance,Find the total checking and saving balance of all accounts sorted by the total balance in ascending order. +small_bank_1,"SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1",Find the name and checking balance of the account with the lowest saving balance. +small_bank_1,"SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid","Find the name, checking balance and saving balance of all accounts in the bank." +small_bank_1,"SELECT T2.balance , T3.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC","Find the name, checking balance and savings balance of all accounts in the bank sorted by their total checking and savings balance in descending order." +small_bank_1,SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance,Find the name of accounts whose checking balance is higher than corresponding saving balance. +small_bank_1,"SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance",Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance. +chinook_1,"SELECT Name FROM ARTIST WHERE Name LIKE ""%a%""","Find the names of all artists that have ""a"" in their names." +chinook_1,"SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = ""AC/DC""","Find the title of all the albums of the artist ""AC/DC""." +chinook_1,"SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = ""Metallica""","How many albums does the artist ""Metallica"" have?" +chinook_1,"SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = ""Balls to the Wall""","Which artist does the album ""Balls to the Wall"" belong to?" +chinook_1,SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1,Which artist has the most albums? +chinook_1,SELECT Name FROM TRACK WHERE Name LIKE '%you%',"Find the names of all the tracks that contain the word ""you""." +chinook_1,"SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK",What are the durations of the longest and the shortest tracks in milliseconds? +chinook_1,"SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumID","Show the album names, ids and the number of tracks for each album." +chinook_1,SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1,What is the name of the most common genre in all tracks? +chinook_1,SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1,What is the least common media type in all tracks? +chinook_1,"SELECT T1.Title , T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 GROUP BY T2.AlbumID",Show the album names and ids for albums that contain tracks with unit price bigger than 1. +chinook_1,"SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = ""Rock""",How many tracks belong to rock genre? +chinook_1,"SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = ""Jazz""",What is the average unit price of tracks that belong to Jazz genre? +chinook_1,"SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE ""%gmail.com%""","How many customers have email that contains ""gmail.com""?" +chinook_1,"SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.FirstName = ""Leonie""",What is the first name and last name employee helps the customer with first name Leonie? +chinook_1,"SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = ""70174""",What city does the employee who helps the customer with postal code 70174 live in? +chinook_1,"SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = ""Astrid"" AND LastName = ""Gruber""",Find all invoice dates corresponding to customers with first name Astrid and last name Gruber. +chinook_1,SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T2.total > 20,Find all the customer last names that do not have invoice totals larger than 20. +chinook_1,"SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = ""Brazil""",Find the first names of all customers that live in Brazil and have an invoice. +chinook_1,"SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = ""Germany""",Find the address of all customers that live in Germany and have invoice. +chinook_1,"SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = ""AAC audio file""",How many tracks are in the AAC audio file media type? +chinook_1,"SELECT AVG(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = ""Latin"" OR T1.Name = ""Pop""",What is the average duration in milliseconds of tracks that belong to Latin or Pop genre? +chinook_1,"SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10",Please show the employee first names and ids of employees who serve at least 10 customers. +chinook_1,SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20,Please show the employee last names that serves no more than 20 customers. +chinook_1,"SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistID GROUP BY T1.ArtistId HAVING COUNT(*) >= 3 ORDER BY T2.Name",Please list the name and id of all artists that have at least 3 albums in alphabetical order. +chinook_1,SELECT Name FROM ARTIST EXCEPT SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId,Find the names of artists that do not have any albums. +chinook_1,"SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = ""Rock""",What is the average unit price of rock tracks? +chinook_1,"SELECT max(Milliseconds) , min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = ""Pop""",What are the duration of the longest and shortest pop tracks in milliseconds? +chinook_1,SELECT count(*) FROM ARTIST WHERE artistid NOT IN(SELECT artistid FROM ALBUM),How many artists do not have any album? +entrepreneur,"SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != ""Rachel Elnaugh""","What are the names of entrepreneurs whose investor is not ""Rachel Elnaugh""?" +entrepreneur,SELECT Weight FROM people ORDER BY Height ASC LIMIT 1,What is the weight of the shortest person? +entrepreneur,SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1,What is the name of the entrepreneur with the greatest weight? +entrepreneur,SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85,What is the total money requested by entrepreneurs with height more than 1.85? +entrepreneur,"SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = ""Simon Woodroffe"" OR T1.Investor = ""Peter Jones""","What are the dates of birth of entrepreneurs with investor ""Simon Woodroffe"" or ""Peter Jones""?" +entrepreneur,SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC,What are the weights of entrepreneurs in descending order of money requested? +entrepreneur,SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1,Who is the investor that has invested in the most number of entrepreneurs? +entrepreneur,SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2,Who are the investors that have invested in at least two entrepreneurs? +entrepreneur,"SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested",List the names of entrepreneurs and their companies in descending order of money requested? +entrepreneur,SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur),List the names of people that are not entrepreneurs. +entrepreneur,SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000,Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000. +farm,"SELECT max(Cows) , min(Cows) FROM farm",What are the maximum and minimum number of cows across all farms. +farm,"SELECT Official_Name , Status FROM city ORDER BY Population DESC LIMIT 1",List the official name and status of the city with the largest population. +farm,SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1,Show the official names of the cities that have hosted more than one competition. +farm,SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1,Show the status of the city that has hosted the greatest number of competitions. +farm,SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID WHERE T1.Population > 1000,Please show the themes of competitions with host cities having populations larger than 1000. +farm,SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) ASC,"Please show the different statuses, ordered by the number of cities that have each." +farm,SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1,List the most common type of Status across cities. +farm,SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition),List the official names of cities that have not held any competition. +farm,SELECT Status FROM city WHERE Population > 1500 INTERSECT SELECT Status FROM city WHERE Population < 500,Show the status shared by cities with population bigger than 1500 and smaller than 500. +gymnast,"SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown != ""Santo Domingo""","What are the names of gymnasts whose hometown is not ""Santo Domingo""?" +gymnast,SELECT Age FROM people ORDER BY Height DESC LIMIT 1,What is the age of the tallest person? +gymnast,SELECT Name FROM People ORDER BY Age DESC LIMIT 5,List the names of the top 5 oldest people. +gymnast,SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC LIMIT 1,What is the total point count of the youngest gymnast? +gymnast,SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5,What are the distinct hometowns of gymnasts with total points more than 57.5? +gymnast,"SELECT T2.Hometown , COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown",What are the hometowns of gymnasts and the corresponding number of gymnasts? +gymnast,SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1,What is the most common hometown of gymnasts? +gymnast,SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2,What are the hometowns that are shared by at least two gymnasts? +gymnast,SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC,List the names of gymnasts in ascending order by their heights. +gymnast,SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID,List the distinct hometowns that are not associated with any gymnast. +gymnast,SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20,Show the hometowns shared by people older than 23 and younger than 20. +phone_market,"SELECT Name FROM phone WHERE Carrier = ""Sprint"" OR Carrier = ""TMobile""","Show the names of phones with carrier either ""Sprint"" or ""TMobile""." +phone_market,SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1,What is the carrier of the most expensive phone? +phone_market,SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1,Show the most frequently used carrier of the phones. +phone_market,SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64,Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. +phone_market,"SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID",Show the names of phones and the districts of markets they are on. +phone_market,"SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking","Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market." +phone_market,SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50,Show the names of phones that are on market with number of shops greater than 50. +phone_market,"SELECT T2.Name , sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name","For each phone, show its names and total number of stocks." +phone_market,SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000 ORDER BY sum(T1.Num_of_stock) DESC,"Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks." +election_representative,"SELECT min(Vote_Percent) , max(Vote_Percent) FROM election",What are the minimum and maximum vote percents of elections? +election_representative,"SELECT Lifespan FROM representative WHERE State = ""New York"" OR State = ""Indiana""",What are the life spans of representatives from New York state or Indiana state? +election_representative,SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE Votes > 10000,What are the names of representatives with more than 10000 votes in election? +election_representative,SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC,What are the names of representatives in descending order of votes? +election_representative,SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes ASC LIMIT 1,What is the party of the representative that has the smallest number of votes. +election_representative,SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY Vote_Percent DESC,What are the lifespans of representatives in descending order of vote percent? +election_representative,"SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID WHERE T2.Party = ""Republican""","What is the average number of votes of representatives from party ""Republican""?" +election_representative,"SELECT Party , COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1",What is the party that has the largest number of representatives? +election_representative,SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3,What parties have at least three representatives? +election_representative,SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2,What states have at least two representatives? +election_representative,SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election),List the names of representatives that have not participated in elections listed here. +formula_1,SELECT name FROM races ORDER BY date DESC LIMIT 1,What is the name of the race held most recently? +formula_1,"SELECT name , date FROM races ORDER BY date DESC LIMIT 1",What is the name and date of the most recent race? +formula_1,SELECT name FROM races WHERE YEAR = 2017,Find the names of all races held in 2017. +formula_1,SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017,Find the distinct names of all races held between 2014 and 2017? +formula_1,"SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000",List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds? +formula_1,"SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000",Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds? +formula_1,"SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1",What are the forename and surname of the driver who has the smallest laptime? +formula_1,"SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1",What is the id and family name of the driver who has the longest laptime? +formula_1,"SELECT T1.driverid , T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING count(*) >= 2","What is the id, forename and surname of the driver who had the first position in terms of laptime at least twice?" +formula_1,"SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = ""Australian Grand Prix"" AND YEAR = 2009",How many drivers participated in the race Australian Grand Prix held in 2009? +formula_1,SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 ),How many drivers did not participate in the races held in 2009? +formula_1,"SELECT T2.name , T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = ""Lewis""",Give me a list of names and years of races that had any driver whose forename is Lewis? +formula_1,"SELECT forename , surname FROM drivers WHERE nationality = ""German""",Find the forename and surname of drivers whose nationality is German? +formula_1,"SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Australian Grand Prix"" INTERSECT SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Chinese Grand Prix""",Find the ids and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix? +formula_1,"SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Australian Grand Prix"" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = ""Chinese Grand Prix""",What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix? +formula_1,SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1,Find all the forenames of distinct drivers who was in position 1 as standing and won? +formula_1,SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20,Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points? +formula_1,"SELECT count(*) , nationality FROM constructors GROUP BY nationality",What are the numbers of constructors for different nationalities? +formula_1,"SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid",What are the numbers of races for each constructor id? +formula_1,"SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = ""Spain"" AND T1.year > 2017",What are the names of races that were held after 2017 and the circuits were in the country of Spain? +formula_1,"SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = ""Spain"" AND T1.year > 2000",What are the unique names of races that held after 2000 and the circuits were in Spain? +formula_1,"SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841)",Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841. +formula_1,"SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841)",Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841? +formula_1,SELECT DISTINCT forename FROM drivers ORDER BY forename ASC,List the forenames of all distinct drivers in alphabetical order? +formula_1,SELECT DISTINCT name FROM races ORDER BY name DESC,List the names of all distinct races in reversed lexicographic order? +formula_1,SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011,What are the names of races held between 2009 and 2011? +formula_1,"SELECT name FROM races WHERE TIME > ""12:00:00"" OR TIME < ""09:00:00""",What are the names of races held after 12:00:00 or before 09:00:00? +formula_1,"SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 8 UNION SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5","What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 races?" +formula_1,"SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) = 11 INTERSECT SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5",What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results? +formula_1,"SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1",What is the id and last name of the driver who participated in the most races after 2010? +formula_1,"SELECT name FROM circuits WHERE country = ""UK"" OR country = ""Malaysia""",What are the names of circuits that belong to UK or Malaysia? +formula_1,"SELECT circuitid , LOCATION FROM circuits WHERE country = ""France"" OR country = ""Belgium""",Find the id and location of circuits that belong to France or Belgium? +formula_1,"SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = ""Japanese"" AND T2.points > 5",Find the names of Japanese constructors that have once earned more than 5 points? +formula_1,"SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = ""Monaco Grand Prix""",What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ? +formula_1,"SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = ""Monaco Grand Prix""",What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ? +formula_1,"SELECT max(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year",What are the maximum fastest lap speed in races held after 2014 grouped by race name and ordered by year? +formula_1,"SELECT avg(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year",What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year? +formula_1,"SELECT T1.driverid , T1.forename , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) >= 2","Find the id, forename and number of races of all drivers who have at least participated in two races?" +formula_1,"SELECT T1.driverid , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) <= 30",Find the driver id and number of races of all drivers who have at most participated in 30 races? +phone_1,"SELECT Model_name , RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1;",Which model has the least amount of RAM? List the model name and the amount of RAM. +phone_1,"SELECT max(T1.RAM_MiB) , min(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = ""Nokia Corporation"";","What is maximum and minimum RAM size of phone produced by company named ""Nokia Corporation""?" +phone_1,"SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = ""Nokia Corporation"";","What is the average ROM size of phones produced by the company named ""Nokia Corporation""?" +phone_1,"SELECT T2.Hardware_Model_name , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32;",List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32. +phone_1,"SELECT Hardware_Model_name , Company_name FROM phone WHERE Accreditation_type LIKE 'Full';",Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name. +phone_1,"SELECT T1.Char_cells , T1.Pixels , T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = ""LG-P760"";","Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is ""LG-P760""." +phone_1,"SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = ""Graphics"";","List the hardware model name and company name for the phone whose screen mode type is ""Graphics""" +phone_1,"SELECT Company_name , count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;",Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company. +phone_1,SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*) > 1;,List the name of the company that produced more than one phone model. +phone_1,"SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode;","List the maximum, minimum and average number of used kb in screen mode." +phone_1,SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1;,List the name of the phone model launched in year 2002 and with the highest RAM size. +phone_1,"SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = ""LG-P760"";","What are the wifi and screen mode type of the hardware model named ""LG-P760""?" +phone_1,"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = ""Text"" OR T1.RAM_MiB > 32;","List the hardware model name for the phones that have screen mode type ""Text"" or RAM size greater than 32." +phone_1,"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = ""Graphics"" OR t2.Company_name = ""Nokia Corporation""","List the hardware model name for the phones that were produced by ""Nokia Corporation"" or whose screen mode type is ""Graphics.""" +phone_1,"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = ""Nokia Corporation"" AND T1.Type != ""Text"";","List the hardware model name for the phones that were produced by ""Nokia Corporation"" but whose screen mode type is not Text." +phone_1,"SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15;",List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15. +phone_1,SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*) > 3,Find the accreditation level that more than 3 phones use. +phone_1,SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone),Find the average ram mib size of the chip models that are never used by any phone. +phone_1,SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full',Find the names of the chip models that are not used by any phone with full accreditation type. +driving_school,"SELECT date_of_birth FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",What is the birthday of the staff member with first name as Janessa and last name as Sawayn? +driving_school,"SELECT date_joined_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",When did the staff member with first name as Janessa and last name as Sawayn join the company? +driving_school,"SELECT date_left_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",When did the staff member with first name as Janessa and last name as Sawayn leave the company? +driving_school,"SELECT nickname FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",What is the nickname of staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",Which city does staff with first name as Janessa and last name as Sawayn live? +driving_school,"SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",In which country and state does staff with first name as Janessa and last name as Sawayn live? +driving_school,"SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin"";",How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? +driving_school,"SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",What is the zip code of staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = ""Damianfort"";",Find out the first name and last name of staff living in city Damianfort. +driving_school,"SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;",In which city live the most staff? List the city name and number of staff. +driving_school,SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;,List the states which have between 2 to 4 staff living there. +driving_school,"SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = ""Marina"" OR last_name = ""Kohler""","What is the status code, mobile phone number and email address of the customer with last name as Kohler or first name as Marina?" +driving_school,"SELECT date_became_customer FROM Customers WHERE first_name = ""Carole"" AND last_name = ""Bernhard"";",When did customer with first name as Carole and last name as Bernhard became a customer? +driving_school,SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;,Which customer status code has least number of customers? +driving_school,"SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin"" AND T1.lesson_status_code = ""Completed"";",How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed? +driving_school,"SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers;","What is maximum, minimum and average amount of outstanding of customer?" +driving_school,"SELECT T1.first_name , T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = ""Lockmanfurt"";",List first name and last name of customers living in city Lockmanfurt. +driving_school,"SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""",Which country does customer with first name as Carole and last name as Bernhard live in? +driving_school,"SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""",What is zip code of customer with first name as Carole and last name as Bernhard? +driving_school,SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) DESC LIMIT 1;,Which city has most number of customers? +driving_school,"SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Carole"" AND T2.last_name = ""Bernhard""",How much in total has customer with first name as Carole and last name as Bernhard paid? +driving_school,SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );,List the number of customers that did not have any payment history. +driving_school,"SELECT T2.first_name , T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) > 2;",List first name and last name of customers that have more than 2 payments. +driving_school,"SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"" AND nickname LIKE ""%s%"";","List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'." +driving_school,"SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE ""%a%""",How many lessons taught by staff whose first name has letter 'a' in it? +driving_school,"SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Ray""",How many lessons did customer with first name Ray take? +driving_school,SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff,Which last names are both used by customers and by staff? +driving_school,SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id,What are the first names of staff who did not give any lesson? +driving_school,"SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1",What is the id and detail of the vehicle used in lessons for most of the times? +driving_school,"SELECT date_of_birth FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",What is the birthday of the staff member with first name as Janessa and last name as Sawayn? +driving_school,"SELECT date_joined_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",When did the staff member with first name as Janessa and last name as Sawayn join the company? +driving_school,"SELECT date_left_staff FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",When did the staff member with first name as Janessa and last name as Sawayn leave the company? +driving_school,"SELECT nickname FROM Staff WHERE first_name = ""Janessa"" AND last_name = ""Sawayn"";",What is the nickname of staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",Which city does staff with first name as Janessa and last name as Sawayn live? +driving_school,"SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",In which country and state does staff with first name as Janessa and last name as Sawayn live? +driving_school,"SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin"";",How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? +driving_school,"SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",What is the zip code of staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = ""Damianfort"";",Find out the first name and last name of staff living in city Damianfort. +driving_school,"SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;",In which city live the most staff? List the city name and number of staff. +driving_school,SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;,List the states which have between 2 to 4 staff living there. +driving_school,"SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = ""Marina"" OR last_name = ""Kohler""","What is the status code, mobile phone number and email address of the customer with last name as Kohler or first name as Marina?" +driving_school,"SELECT date_became_customer FROM Customers WHERE first_name = ""Carole"" AND last_name = ""Bernhard"";",When did customer with first name as Carole and last name as Bernhard became a customer? +driving_school,SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;,Which customer status code has least number of customers? +driving_school,"SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Rylan"" AND T2.last_name = ""Goodwin"" AND T1.lesson_status_code = ""Completed"";",How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed? +driving_school,"SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers;","What is maximum, minimum and average amount of outstanding of customer?" +driving_school,"SELECT T1.first_name , T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = ""Lockmanfurt"";",List first name and last name of customers living in city Lockmanfurt. +driving_school,"SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""",Which country does customer with first name as Carole and last name as Bernhard live in? +driving_school,"SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = ""Carole"" AND T1.last_name = ""Bernhard""",What is zip code of customer with first name as Carole and last name as Bernhard? +driving_school,SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) DESC LIMIT 1;,Which city has most number of customers? +driving_school,"SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Carole"" AND T2.last_name = ""Bernhard""",How much in total has customer with first name as Carole and last name as Bernhard paid? +driving_school,SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );,List the number of customers that did not have any payment history. +driving_school,"SELECT T2.first_name , T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) > 2;",List first name and last name of customers that have more than 2 payments. +driving_school,"SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"" AND nickname LIKE ""%s%"";","List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'." +driving_school,"SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE ""%a%""",How many lessons taught by staff whose first name has letter 'a' in it? +driving_school,"SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = ""Janessa"" AND T2.last_name = ""Sawayn"";",What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? +driving_school,"SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = ""Ray""",How many lessons did customer with first name Ray take? +driving_school,SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff,Which last names are both used by customers and by staff? +driving_school,SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id,What are the first names of staff who did not give any lesson? +decoration_competition,"SELECT Name FROM member WHERE Country = ""United States"" OR Country = ""Canada""","Show the names of members whose country is ""United States"" or ""Canada""." +decoration_competition,SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1,Show the most common country across members. +decoration_competition,SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2,Which countries have more than two members? +decoration_competition,"SELECT T2.Name , T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name ASC",Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names. +decoration_competition,"SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = ""Canada""","Show the distinct leader names of colleges associated with members from country ""Canada""." +decoration_competition,SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3,Show the names of members that have a rank in round higher than 3. +decoration_competition,SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC,Show the names of members in ascending order of their rank in rounds. +music_4,"SELECT max(Weeks_on_Top) , min(Weeks_on_Top) FROM volume",What are the maximum and minimum week on top of all volumes? +music_4,SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2,Please show the date of ceremony of the volumes that last more than 2 weeks on top. +music_4,"SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = ""Nominated""","Please show the songs that have result ""nominated"" at music festivals." +music_4,"SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = ""Gorgoroth""","What are the issue dates of volumes associated with the artist ""Gorgoroth""?" +music_4,SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32,What are the songs in volumes associated with the artist aged 32 or older? +music_4,SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25,What is the average weeks on top of volumes associated with the artist aged 25 or younger? +music_4,SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2,What are the famous title of the artists associated with volumes with more than 2 weeks on top? +music_4,SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1,What is the famous release date of the artist with the oldest age? +music_4,SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1,What is the most common result of the music festival? +music_4,SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1,Please show the categories of the music festivals with count more than 1. +music_4,SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1,What is the song in the volume with the maximum weeks on top? +music_4,SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume),Find the famous titles of artists that do not have any volume. +music_4,SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2,Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top. +music_4,"SELECT Date_of_ceremony FROM music_festival WHERE Category = ""Best Song"" AND RESULT = ""Awarded""","What are the date of ceremony of music festivals with category ""Best Song"" and result ""Awarded""?" +music_4,SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1,What is the issue date of the volume with the minimum weeks on top? +music_4,"SELECT RESULT , COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC","Please show the results of music festivals and the number of music festivals that have had each, ordered by this count." +baseball_1,"SELECT T1.name_full , T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY count(*) DESC LIMIT 1;",what is the full name and id of the college with the largest number of baseball players? +baseball_1,SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings',What is average salary of the players in the team named 'Boston Red Stockings' ? +baseball_1,"SELECT name_first , name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998",What are first and last names of players participating in all star game in 1998? +baseball_1,"SELECT T1.name_first , T1.name_last , T1.player_id , count(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 1;","What are the first name, last name and id of the player with the most all star game experiences? Also list the count." +baseball_1,"SELECT T2.team_id , T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY avg(T1.attendance) DESC LIMIT 1;","In 2014, what are the id and rank of the team that has the largest average number of attendance?" +baseball_1,"SELECT T1.name_first , T1.name_last , T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY count(*) DESC LIMIT 1;","What are the manager's first name, last name and id who won the most manager award?" +baseball_1,"SELECT T1.name_first , T1.name_last , T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 3;",Which 3 players won the most player awards? List their full name and id. +baseball_1,SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) ASC LIMIT 3;,List three countries which are the origins of the least players. +baseball_1,SELECT count(*) FROM player WHERE birth_country = 'USA' AND bats = 'R';,"How many players born in USA are right-handed batters? That is, have the batter value 'R'." +baseball_1,SELECT avg(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University';,What is the average height of the players from the college named 'Yale University'? +baseball_1,"SELECT T1.name , T1.team_id , max(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id;","What is the highest salary among each team? List the team name, id and maximum salary." +baseball_1,"SELECT T1.name , T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY avg(T2.salary) ASC LIMIT 1;",What are the name and id of the team offering the lowest average salary? +baseball_1,"SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 ON T1.Player_id = T2.Player_id WHERE T2.year = 1960 INTERSECT SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961",Find the players' first name and last name who won award both in 1960 and in 1961. +baseball_1,"SELECT name_first , name_last FROM player WHERE weight > 220 OR height < 75",List players' first name and last name who have weight greater than 220 or height shorter than 75. +baseball_1,SELECT max(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings';,List the maximum scores of the team Boston Red Stockings when the team won in postseason? +baseball_1,SELECT count(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009;,How many times did Boston Red Stockings lose in 2009 postseason? +baseball_1,"SELECT T2.name , T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY count(*) DESC LIMIT 1;",What are the name and id of the team with the most victories in 2008 postseason? +baseball_1,"SELECT count(*) , T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year",What is the number of wins the team Boston Red Stockings got in the postseasons each year in history? +baseball_1,SELECT count(*) FROM postseason WHERE YEAR = 1885 AND ties = 1;,"How many games in 1885 postseason resulted in ties (that is, the value of ""ties"" is '1')?" +baseball_1,SELECT sum(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010,What is the total salary paid by team Boston Red Stockings in 2010? +baseball_1,SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000,How many players were in the team Boston Red Stockings in 2000? +baseball_1,SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3;,List the 3 highest salaries of the players in 2001? +baseball_1,SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001,What were all the salary values of players in 2010 and 2001? +baseball_1,SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC LIMIT 1;,In which year did the least people enter hall of fame? +baseball_1,SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park';,"How many games were played in park ""Columbia Park"" in 1907?" +baseball_1,SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta';,How many games were played in city Atlanta in 2000? +baseball_1,SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010;,What is the total home game attendance of team Boston Red Stockings from 2000 to 2010? +baseball_1,SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990;,How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total? +baseball_1,"SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'",List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007. +baseball_1,SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000;,How many home games did the team Boston Red Stockings play from 1990 to 2000 in total? +baseball_1,SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC LIMIT 1;,Which team had the least number of attendances in home games in 1980? +baseball_1,SELECT state FROM park GROUP BY state HAVING count(*) > 2;,List the names of states that have more than 2 parks. +baseball_1,SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;,Which cities have 2 to 4 parks? +university_basketball,SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1,When was the school with the largest enrollment founded? +university_basketball,SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1,Find the founded year of the newest non public school. +university_basketball,SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1,What is the highest acc percent score in the competition? +university_basketball,SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1,What is the primary conference of the school that has the lowest acc percent score in the competition? +university_basketball,"SELECT t2.team_name , t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded LIMIT 1",What is the team name and acc regular season score of the school that was founded for the longest time? +university_basketball,"SELECT t2.All_Games , t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'",Find the location and all games score of the school that has Clemson as its team name. +university_basketball,"SELECT enrollment , primary_conference FROM university ORDER BY founded LIMIT 1",Show the enrollment and primary_conference of the oldest college. +university_basketball,"SELECT sum(enrollment) , min(enrollment) FROM university",What is the total and minimum enrollment of all schools? +university_basketball,SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match),How many schools do not participate in the basketball match? +university_basketball,SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public',Find the schools that were either founded after 1850 or public. +university_basketball,"SELECT count(*) FROM university WHERE LOCATION LIKE ""%NY%""",Find how many school locations have the word 'NY'. +university_basketball,SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT avg(enrollment) FROM university),Find the team names of the universities whose enrollments are smaller than the average enrollment size. +university_basketball,"SELECT count(*) , affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation",Find the number of universities that have over a 20000 enrollment size for each affiliation type. +e_learning,"SELECT date_of_latest_logon FROM Students WHERE family_name = ""Jaskolski"" OR family_name = ""Langosh""","What are the dates of the latest logon of the students with family name ""Jaskolski"" or ""Langosh""?" +e_learning,"SELECT COUNT(*) FROM Students WHERE personal_name LIKE ""%son%""","How many students have personal names that contain the word ""son""?" +e_learning,"SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC",List each test result and its count in descending order of count. +e_learning,"SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = ""advanced database""","Find the login name of the course author that teaches the course with name ""advanced database""." +e_learning,"SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = ""operating system"" OR T2.course_name = ""data structure""","Find the addresses of the course authors who teach the course with name ""operating system"" or ""data structure""." +e_learning,"SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1","Find the personal name, family name, and author ID of the course author that teaches the most courses." +e_learning,"SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2",Find the addresses and author IDs of the course authors that teach at least two courses. +e_learning,"SELECT T2.course_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T1.personal_name = ""Julio""","Find the names of courses taught by the tutor who has personal name ""Julio""." +e_learning,"SELECT T1.course_name , T1.course_description FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id WHERE T2.subject_name = ""Computer Science""","Find the names and descriptions of courses that belong to the subject named ""Computer Science""." +e_learning,"SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id","Find the subject ID, subject name, and the corresponding number of available courses for each subject." +e_learning,"SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) ASC","Find the subject ID, name of subject and the corresponding number of courses for each subject, and sort by the course count in ascending order." +e_learning,"SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = ""Spanish""","What is the date of enrollment of the course named ""Spanish""?" +e_learning,SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1,What is the name of the course that has the most student enrollment? +e_learning,SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 1,What are the names of the courses that have exactly 1 student enrollment? +e_learning,"SELECT T1.course_description , T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) > 2",What are the descriptions and names of the courses that have student enrollment bigger than 2? +e_learning,"SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name",What is the name of each course and the corresponding number of student enrollment? +e_learning,"SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = ""Pass""","What are the enrollment dates of all the tests that have result ""Pass""?" +e_learning,"SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = ""Fail""","What are the completion dates of all the tests that have result ""Fail""?" +e_learning,"SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.personal_name = ""Karson""","List the dates of enrollment and completion of the student with personal name ""Karson""." +e_learning,"SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = ""Zieme"" AND T2.personal_name = ""Bernie""","List the dates of enrollment and completion of the student with family name ""Zieme"" and personal name ""Bernie""." +e_learning,"SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1",Find the student ID and login name of the student with the most course enrollments +e_learning,"SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2",Find the student ID and personal name of the student with at least two enrollments. +e_learning,"SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2",Find the student ID and middle name for all the students with at most two enrollments. +e_learning,SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id,Find the personal names of students not enrolled in any course. +e_learning,SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment),How many students did not have any course enrollment? +e_learning,SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students,Find the common login name of course authors and students. +sports_competition,"SELECT max(Silver) , min(Silver) FROM club_rank",What are the maximum and minimum number of silver medals for clubs. +sports_competition,"SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = ""Right Wing""","Show the names of clubs that have players with position ""Right Wing""." +sports_competition,"SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = ""AIB""","What is the average points of players from club with name ""AIB""." +sports_competition,SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20,List the position of players with average number of points scored by players of that position bigger than 20. +sports_competition,SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1,List the most common type of competition. +sports_competition,SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5,List the types of competition that have at most five competitions of that type. +sports_competition,SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player),List the names of clubs that do not have any players. +sports_competition,SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10,What are the positions with both players having more than 20 points and less than 10 points. +sports_competition,SELECT name FROM player WHERE points > (SELECT avg(points) FROM player),what are the name of players who get more than the average points. +sports_competition,"SELECT count(*) , POSITION FROM player WHERE points < 30 GROUP BY POSITION",find the number of players whose points are lower than 30 in each position. +sports_competition,SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1,which country did participated in the most number of Tournament competitions? +sports_competition,SELECT country FROM competition WHERE competition_type = 'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type = 'Tournament',which countries did participated in both Friendly and Tournament type competitions. +assets_maintenance,"SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) = 2 INTERSECT SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) < 2",Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail. +assets_maintenance,"SELECT count(*) , T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id",How many assets does each maintenance contract contain? List the number and the contract id. +assets_maintenance,"SELECT count(*) , T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id",How many assets does each third party company supply? List the count and the company id. +assets_maintenance,"SELECT T1.company_id , T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING count(*) >= 2 UNION SELECT T3.company_id , T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id = T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING count(*) >= 2",Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name. +assets_maintenance,"SELECT T1.staff_name , T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id = T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name , T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id = T4.contact_staff_id",What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers? +assets_maintenance,"SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1","Which engineer has visited the most times? Show the engineer id, first name and last name." +assets_maintenance,"SELECT T1.part_name , T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id HAVING count(*) > 2",Which parts have more than 2 faults? Show the part name and id. +assets_maintenance,"SELECT T1.first_name , T1.last_name , T1.other_details , T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id","List all every engineer's first name, last name, details and coresponding skill description." +assets_maintenance,"SELECT T1.fault_short_name , T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id","For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description." +assets_maintenance,"SELECT T1.part_name , count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name",How many assets can each parts be used in? List the part name and the number. +assets_maintenance,"SELECT count(*) , T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1",How many engineer visits are required at most for a single fault log? List the number and the log entry id. +assets_maintenance,"SELECT first_name , last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)",Which engineers have never visited to maintain the assets? List the engineer first name and last name. +assets_maintenance,SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date ASC LIMIT 1,When was the first asset acquired? +assets_maintenance,"SELECT T1.part_id , T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) DESC LIMIT 1",Which part fault requires the most number of skills to fix? List part id and name. +assets_maintenance,SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY count(*) ASC LIMIT 1,Which kind of part has the least number of faults? List the part name. +assets_maintenance,"SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1","Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name." +assets_maintenance,"SELECT T1.staff_name , T3.first_name , T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id",Which staff have contacted which engineers? List the staff name and the engineer first name and last name. +assets_maintenance,"SELECT T1.fault_log_entry_id , T1.fault_description , T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1","Which fault log included the most number of faulty parts? List the fault log id, description and record time." +assets_maintenance,"SELECT T1.skill_id , T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1",Which skill is used in fixing the most number of faults? List the skill id and description. +assets_maintenance,"SELECT part_id , chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1",Which part has the least chargeable amount? List the part id and amount. +assets_maintenance,SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id = T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1,Which company started the earliest the maintenance contract? Show the company name. +assets_maintenance,SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1,Which gender makes up the majority of the staff? +assets_maintenance,"SELECT T1.staff_name , count(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name",How many engineers did each staff contact? List both the contact staff name and number of engineers contacted. +station_weather,"SELECT local_authority , services FROM station;",list the local authorities and services provided by all stations. +station_weather,"SELECT train_number , name FROM train ORDER BY TIME;",show all train numbers and names ordered by their time from early to late. +station_weather,"SELECT TIME , train_number FROM train WHERE destination = 'Chennai' ORDER BY TIME;","Give me the times and numbers of all trains that go to Chennai, ordered by time." +station_weather,"SELECT count(*) FROM train WHERE name LIKE ""%Express%"";",How many trains have 'Express' in their names? +station_weather,"SELECT train_number , TIME FROM train WHERE origin = 'Chennai' AND destination = 'Guruvayur';",Find the number and time of the train that goes from Chennai to Guruvayur. +station_weather,"SELECT origin , count(*) FROM train GROUP BY origin;",Find the number of trains starting from each origin. +station_weather,SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER BY count(*) DESC LIMIT 1;,Find the name of the train whose route runs through greatest number of stations. +station_weather,"SELECT count(*) , t1.network_name , t1.services FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id;","Find the number of trains for each station, as well as the station network name and services." +station_weather,"SELECT avg(high_temperature) , day_of_week FROM weekly_weather GROUP BY day_of_week;",What is the average high temperature for each day of week? +station_weather,"SELECT max(t1.low_temperature) , avg(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id WHERE t2.network_name = ""Amersham"";",Give me the maximum low temperature and average precipitation at the Amersham station. +station_weather,"SELECT t3.name , t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = ""Chiltern"";",Find names and times of trains that run through stations for the local authority Chiltern. +station_weather,SELECT count(DISTINCT services) FROM station;,How many different services are provided by all stations? +station_weather,"SELECT t2.id , t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id ORDER BY avg(high_temperature) DESC LIMIT 1",Find the id and local authority of the station with has the highest average high temperature. +station_weather,"SELECT t2.id , t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING max(t1.precipitation) > 50;",Find the id and local authority of the station whose maximum precipitation is higher than 50. +station_weather,"SELECT min(low_temperature) , max(wind_speed_mph) FROM weekly_weather;",show the lowest low temperature and highest wind speed in miles per hour. +culture_company,SELECT count(*) FROM book_club,How many book clubs are there? +culture_company,"SELECT book_title , author_or_editor FROM book_club WHERE YEAR > 1989","show the titles, and authors or editors for all books made after the year 1989." +culture_company,SELECT DISTINCT publisher FROM book_club,Show all distinct publishers for books. +culture_company,"SELECT YEAR , book_title , publisher FROM book_club ORDER BY YEAR DESC","Show the years, book titles, and publishers for all books, in descending order by year." +culture_company,"SELECT publisher , count(*) FROM book_club GROUP BY publisher",Show all publishers and the number of books for each publisher. +culture_company,SELECT publisher FROM book_club GROUP BY publisher ORDER BY count(*) DESC LIMIT 1,What is the publisher with most number of books? +culture_company,"SELECT category , count(*) FROM book_club GROUP BY category",Show all book categories and the number of books in each category. +culture_company,SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING count(*) >= 2,List categories that have at least two books after year 1989. +culture_company,SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990,Show publishers with a book published in 1989 and a book in 1990. +culture_company,SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989,Show all publishers which do not have a book in 1989. +culture_company,"SELECT title , YEAR , director FROM movie ORDER BY budget_million","Show all movie titles, years, and directors, ordered by budget." +culture_company,SELECT COUNT (DISTINCT director) FROM movie,How many movie directors are there? +culture_company,"SELECT title , director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1",What is the title and director for the movie with highest worldwide gross in the year 2000 or before? +culture_company,SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999,Show all director names who have a movie in both year 1999 and 2000. +culture_company,SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000,Show all director names who have a movie in the year 1999 or 2000. +culture_company,"SELECT avg(budget_million) , max(budget_million) , min(budget_million) FROM movie WHERE YEAR < 2000","What is the average, maximum, and minimum budget for all movies before 2000." +culture_company,SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson',List all company names with a book published by Alyson. +culture_company,"SELECT T1.title , T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'",Show the movie titles and book titles for all companies in China. +architecture,SELECT count(*) FROM architect WHERE gender = 'female',How many architects are female? +architecture,"SELECT name , nationality , id FROM architect WHERE gender = 'male' ORDER BY name","List the name, nationality and id of all male architects ordered by their names lexicographically." +architecture,"SELECT max(T1.length_meters) , T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id",What is the maximum length in meters for the bridges and what are the architects' names? +architecture,SELECT avg(length_feet) FROM bridge,What is the average length in feet of the bridges? +architecture,"SELECT name , built_year FROM mill WHERE TYPE = 'Grondzeiler'",What are the names and year of construction for the mills of 'Grondzeiler' type? +architecture,"SELECT DISTINCT T1.name , T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id",What are the distinct names and nationalities of the architects who have ever built a mill? +architecture,SELECT name FROM mill WHERE LOCATION != 'Donceel',What are the names of the mills which are not located in 'Donceel'? +architecture,SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian',What are the distinct types of mills that are built by American or Canadian architects? +architecture,"SELECT T1.id , T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) >= 3",What are the ids and names of the architects who built at least 3 bridges ? +architecture,"SELECT T1.id , T1.name , T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1","What is the id, name and nationality of the architect who built most mills?" +architecture,"SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 2 UNION SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 1","What are the ids, names and genders of the architects who built two bridges or one mill?" +architecture,SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch' OR name = 'Rainbow Bridge',What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'? +architecture,SELECT name FROM mill WHERE name LIKE '%Moulin%',Which of the mill names contains the french word 'Moulin'? +architecture,SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80,What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters? +architecture,"SELECT TYPE , count(*) FROM mill GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1","What is the most common mill type, and how many are there?" +architecture,SELECT count(*) FROM architect WHERE id NOT IN ( SELECT architect_id FROM mill WHERE built_year < 1850 );,How many architects haven't built a mill before year 1850? +school_finance,"SELECT sum(enrollment) , avg(enrollment) FROM school",What are the total and average enrollment of all schools? +school_finance,SELECT mascot FROM school WHERE enrollment > (SELECT avg(enrollment) FROM school),What are the mascots for schools with enrollments above the average? +school_finance,SELECT school_name FROM school ORDER BY enrollment LIMIT 1,List the name of the school with the smallest enrollment. +school_finance,"SELECT avg(enrollment) , max(enrollment) , min(enrollment) FROM school","Show the average, maximum, minimum enrollment of all schools." +school_finance,"SELECT county , count(*) , sum(enrollment) FROM school GROUP BY county",Show each county along with the number of schools and total enrollment in each county. +school_finance,"SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = ""Glenn""","How many donors have endowment for school named ""Glenn""?" +school_finance,"SELECT donator_name , sum(amount) FROM endowment GROUP BY donator_name ORDER BY sum(amount) DESC",List each donator name and the amount of endowment in descending order of the amount of endowment. +school_finance,SELECT school_name FROM school WHERE school_id NOT IN (SELECT school_id FROM endowment),List the names of the schools without any endowment. +school_finance,SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount) <= 10,List all the names of schools with an endowment amount smaller than or equal to 10. +school_finance,SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton',"Show the names of donors who donated to both school ""Glenn"" and ""Triton""" +school_finance,SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9,Show the names of all the donors except those whose donation amount less than 9. +school_finance,"SELECT amount , donator_name FROM endowment ORDER BY amount DESC LIMIT 1",List the amount and donor name for the largest amount of donation. +school_finance,SELECT count(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001,How many budgets are above 3000 in year 2001 or before? +school_finance,"SELECT T2.school_name , T1.budgeted , T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002","Show each school name, its budgeted amount, and invested amount in year 2002 or after." +school_finance,SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn',"What is the total budget amount for school ""Glenn"" in all years?" +school_finance,SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted) > 100 OR sum(T3.amount) > 10,Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10. +school_finance,SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING count(*) > 1,Find the names of schools that have more than one donator with donation amount above 8.5. +school_finance,SELECT count(*) FROM (SELECT * FROM endowment WHERE amount < 8.5 GROUP BY school_id HAVING count(*) > 1),Find the number of schools that have more than one donator whose donation amount is less than 8.5. +film_rank,"SELECT max(Number_cities) , min(Number_cities) FROM market",What are the maximum and minimum number of cities in all markets. +film_rank,SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995,Show the distinct director of films with market estimation in the year of 1995. +film_rank,SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000,What is the average number of cities of markets with low film market estimate bigger than 10000? +film_rank,"SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = ""Japan"" ORDER BY T1.Year DESC","Please list the years of film market estimations when the market is in country ""Japan"" in descending order." +film_rank,SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1,List the name of film studio that have the most number of films. +film_rank,SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2,List the names of studios that have at least two films. +film_rank,SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation),List the title of films that do not have any market estimation. +film_rank,"SELECT Studio FROM film WHERE Director = ""Nicholas Meyer"" INTERSECT SELECT Studio FROM film WHERE Director = ""Walter Hill""","Show the studios that have produced films with director ""Nicholas Meyer"" and ""Walter Hill""." +film_rank,"SELECT title , Studio FROM film WHERE Studio LIKE ""%Universal%""","Find the titles and studios of the films that are produced by some film studios that contained the word ""Universal""." +film_rank,"SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = ""Walter Hill""","Show the studios that have not produced films with director ""Walter Hill""." +film_rank,SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000,List the studios which average gross is above 4500000. +film_rank,SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1,What is the title of the film that has the highest high market estimation. +party_host,SELECT count(*) FROM party,How many parties are there? +party_host,SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC,List the themes of parties in ascending order of number of hosts. +party_host,"SELECT Party_Theme , LOCATION FROM party",What are the themes and locations of parties? +party_host,"SELECT First_year , Last_year FROM party WHERE Party_Theme = ""Spring"" OR Party_Theme = ""Teqnology""","Show the first year and last year of parties with theme ""Spring"" or ""Teqnology""." +party_host,SELECT avg(Number_of_hosts) FROM party,What is the average number of hosts for parties? +party_host,SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1,What is the location of the party with the most hosts? +party_host,"SELECT Nationality , COUNT(*) FROM HOST GROUP BY Nationality",Show different nationalities along with the number of hosts of each nationality. +party_host,SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1,Show the most common nationality of hosts. +party_host,SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35,Show the nations that have both hosts older than 45 and hosts younger than 35. +party_host,"SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID",Show the themes of parties and the names of the party hosts. +party_host,"SELECT T3.Location , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age",Show the locations of parties and the names of the party hosts in ascending order of the age of the host. +party_host,SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50,Show the locations of parties with hosts older than 50. +party_host,SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20,Show the host names for parties with number of hosts greater than 20. +party_host,"SELECT Name , Nationality FROM HOST ORDER BY Age DESC LIMIT 1",Show the name and the nationality of the oldest host. +ship_mission,"SELECT Name FROM ship WHERE Nationality = ""United States"" OR Nationality = ""United Kingdom""",Show the name of ships whose nationality is either United States or United Kingdom. +ship_mission,SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1,What is the name of the ship with the largest tonnage? +ship_mission,SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1,Please show the most common type of ships. +ship_mission,SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2,List the nations that have more than two ships. +ship_mission,SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928,Show names of ships involved in a mission launched after 1928. +ship_mission,"SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = ""United States""","Show the distinct fate of missions that involve ships with nationality ""United States""" +ship_mission,SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission),List the name of ships that are not involved in any mission +company_employee,"SELECT Name FROM company WHERE Industry = ""Banking"" OR Industry = ""Retailing""",Show the names of companies in the banking or retailing industry? +company_employee,"SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company",What is the maximum and minimum market value of companies? +company_employee,SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1,What is the headquarter of the company with the largest sales? +company_employee,SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1,Show the most common headquarter for companies. +company_employee,SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2,Show the headquarters that have at least two companies. +company_employee,"SELECT Headquarters FROM company WHERE Industry = ""Banking"" INTERSECT SELECT Headquarters FROM company WHERE Industry = ""Oil and gas""",Show the headquarters that have both companies in banking industry and companies in oil and gas industry. +company_employee,"SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID",Show the names of companies and of employees. +company_employee,"SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working",Show names of companies and that of employees in descending order of number of years working for that employee. +company_employee,SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200,Show the names of employees that work for companies with sales bigger than 200. +company_employee,"SELECT T3.Name , COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name",Show the names of companies and the number of employees they have +company_employee,SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment),List the names of people that are not employed by any company +tracking_share_transactions,"SELECT min(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = ""PUR"" AND share_count > 50","Show the minimum amount of transactions whose type code is ""PUR"" and whose share count is bigger than 50." +tracking_share_transactions,SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000,Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000. +tracking_share_transactions,"SELECT T1.transaction_type_description , T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10",Show the transaction type descriptions and dates if the share count is smaller than 10. +tracking_share_transactions,SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100,Show details of all investors if they make any transaction with share count greater than 100. +tracking_share_transactions,"SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = ""l""","Return the lot details of lots that belong to investors with details ""l""?" +tracking_share_transactions,SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000,What are the purchase details of transactions with amount bigger than 10000? +tracking_share_transactions,"SELECT T1.sales_details , T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000",What are the sale details and dates of transactions with amount smaller than 3000? +tracking_share_transactions,SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50,What are the lot details of lots associated with transactions with share count smaller than 50? +tracking_share_transactions,"SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = ""PUR""","What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is ""PUR""?" +tracking_share_transactions,"SELECT transaction_type_code , max(share_count) , min(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code",Show the maximum and minimum share count of different transaction types. +tracking_share_transactions,"SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY avg(share_count)","Show the average share count of transactions made by each investor, ordered by average share count." +tracking_share_transactions,"SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id",Show the average amount of transactions for different lots. +tracking_share_transactions,"SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY avg(amount_of_transaction)","Show the average amount of transactions for different lots, ordered by average amount of transactions." +tracking_share_transactions,"SELECT investor_id , COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = ""SALE"" GROUP BY investor_id","Show the number of transactions with transaction type code ""SALE"" for different investors if it is larger than 0." +tracking_share_transactions,SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC LIMIT 1,Show the transaction type code that occurs the fewest times. +tracking_share_transactions,SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1,Show the transaction type code that occurs the most frequently. +tracking_share_transactions,SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1,Show the description of the transaction type that occurs most frequently. +tracking_share_transactions,"SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1",Show the id and details of the investor that has the largest number of transactions. +tracking_share_transactions,"SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3",Show the id and details for the investors who have the top 3 number of transactions. +tracking_share_transactions,SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2,Show the ids of the investors who have at least two transactions. +tracking_share_transactions,"SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = ""SALE"" GROUP BY T2.investor_id HAVING COUNT(*) >= 2","Show the ids and details of the investors who have at least two transactions with type code ""SALE""." +tracking_share_transactions,SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100,What are the dates of transactions with at least 100 share count or amount bigger than 100? +tracking_share_transactions,SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases,What are the details of all sales and purchases? +news_report,"SELECT Name FROM journalist WHERE Nationality = ""England"" OR Nationality = ""Wales""","Show the names of journalists FROM ""England"" or ""Wales""." +news_report,SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1,What is the nationality of the journalist with the largest number of years working? +news_report,SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1,Show the most common nationality for journalists. +news_report,SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3,Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working. +news_report,"SELECT T3.Name , T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID",Show the names of journalists and the dates of the events they reported. +news_report,"SELECT T3.Name , T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance ASC",Show the names of journalists and the names of the events they reported in ascending order +news_report,"SELECT T3.Name , COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name",Show the names of journalists and the number of events they reported. +news_report,SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1,Show the names of journalists that have reported more than one event. +news_report,SELECT Name FROM journalist WHERE journalist_ID NOT IN (SELECT journalist_ID FROM news_report),List the names of journalists who have not reported any event. +news_report,"SELECT avg(Event_Attendance) , max(Event_Attendance) FROM event",what are the average and maximum attendances of all events? +news_report,"SELECT avg(t1.age) , avg(Years_working) , t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type",Find the average age and experience working length of journalists working on different role type. +storm_record,"SELECT region_code , region_name FROM region ORDER BY region_code;",Show all region code and region name sorted by the codes. +storm_record,SELECT region_name FROM region ORDER BY region_name;,List all region names in alphabetical order. +storm_record,SELECT region_name FROM region WHERE region_name != 'Denmark';,Show names for all regions except for Denmark. +storm_record,SELECT count(*) FROM storm WHERE Number_Deaths > 0;,How many storms had death records? +storm_record,"SELECT name , dates_active , number_deaths FROM storm WHERE number_deaths >= 1;","List name, dates active, and number of deaths for all storms with at least 1 death." +storm_record,"SELECT avg(damage_millions_USD) , max(damage_millions_USD) FROM storm WHERE max_speed > 1000;",Show the average and maximum damage for all storms with max speed higher than 1000. +storm_record,"SELECT sum(number_deaths) , sum(damage_millions_USD) FROM storm WHERE max_speed > (SELECT avg(max_speed) FROM storm);",What is the total number of deaths and damage for all storms with a max speed greater than the average? +storm_record,"SELECT name , damage_millions_USD FROM storm ORDER BY max_speed DESC;",List name and damage for all storms in a descending order of max speed. +storm_record,SELECT count(DISTINCT region_id) FROM affected_region,How many regions are affected? +storm_record,SELECT region_name FROM region WHERE region_id NOT IN (SELECT region_id FROM affected_region);,Show the name for regions not affected. +storm_record,"SELECT T1.region_name , count(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id;",Show the name for regions and the number of storms for each region. +storm_record,"SELECT T1.name , count(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id;",List the name for storms and the number of affected regions for each storm. +storm_record,"SELECT T1.name , T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY count(*) DESC LIMIT 1;",What is the storm name and max speed which affected the greatest number of regions? +storm_record,SELECT name FROM storm WHERE storm_id NOT IN (SELECT storm_id FROM affected_region);,Show the name of storms which don't have affected region in record. +storm_record,SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING count(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING sum(T2.number_city_affected) >= 10;,Show storm name with at least two regions and 10 cities affected. +storm_record,SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING count(*) >= 2;,Show all storm names except for those with at least two affected regions. +storm_record,SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10;,What are the region names affected by the storm with a number of deaths of least 10? +storm_record,SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark';,"Show all storm names affecting region ""Denmark""." +storm_record,SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING count(*) >= 2;,Show the region name with at least two storms. +storm_record,SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1,Find the names of the regions which were affected by the storm that killed the greatest number of people. +gas_company,SELECT count(*) FROM company,How many gas companies are there? +gas_company,"SELECT company , rank FROM company ORDER BY Sales_billion DESC",List the company name and rank for all companies in the decreasing order of their sales. +gas_company,"SELECT company , main_industry FROM company WHERE headquarters != 'USA'",Show the company name and the main industry for all companies whose headquarters are not from USA. +gas_company,"SELECT company , headquarters FROM company ORDER BY market_value DESC",Show all company names and headquarters in the descending order of market value. +gas_company,"SELECT min(market_value) , max(market_value) , avg(market_value) FROM company","Show minimum, maximum, and average market value for all companies." +gas_company,SELECT DISTINCT main_industry FROM company,Show all main industry for all companies. +gas_company,"SELECT headquarters , count(*) FROM company GROUP BY headquarters",List all headquarters and the number of companies in each headquarter. +gas_company,"SELECT main_industry , sum(market_value) FROM company GROUP BY main_industry",Show all main industry and total market value in each industry. +gas_company,"SELECT main_industry , count(*) FROM company GROUP BY main_industry ORDER BY sum(market_value) DESC LIMIT 1",List the main industry with highest total market value and its number of companies. +gas_company,SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING count(*) >= 2,Show headquarters with at least two companies in the banking industry. +gas_company,"SELECT station_id , LOCATION , manager_name FROM gas_station ORDER BY open_year","Show gas station id, location, and manager_name for all gas stations ordered by open year." +gas_company,SELECT count(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005,How many gas station are opened between 2000 and 2005? +gas_company,"SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*)",Show all locations and the number of gas stations in each location ordered by the count. +gas_company,SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas',Show all headquarters with both a company in banking industry and a company in Oil and gas. +gas_company,SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking',Show all headquarters without a company in banking industry. +gas_company,"SELECT T2.company , count(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id",Show the company name with the number of gas station. +gas_company,"SELECT company , main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)",Show company name and main industry without a gas station. +gas_company,SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil',Show the manager name for gas stations belonging to the ExxonMobil company. +gas_company,SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100,Show all locations where a gas station for company with market value greater than 100 is located. +gas_company,SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1,Show the manager name with most number of gas stations opened after 2000. +gas_company,SELECT LOCATION FROM gas_station ORDER BY open_year,order all gas station locations by the opening year. +gas_company,"SELECT rank , company , market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion , profits_billion","find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion." +solvency_ii,"SELECT Product_Price FROM Products WHERE Product_Name = ""Dining"" OR Product_Name = ""Trading Policy""","Show the prices of the products named ""Dining"" or ""Trading Policy""." +solvency_ii,SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1,What is the name of the product with the highest price? +solvency_ii,SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1,Show the most common type code across products. +cinema,SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800,Show all the locations where no cinema has capacity over 800. +cinema,SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011,Show all the locations where some cinemas were opened in both year 2010 and year 2011. +cinema,SELECT count(*) FROM cinema,How many cinema do we have? +cinema,"SELECT name , openning_year , capacity FROM cinema","Show name, opening year, and capacity for each cinema." +cinema,"SELECT name , LOCATION FROM cinema WHERE capacity > (SELECT avg(capacity) FROM cinema)",Show the cinema name and location for cinemas with capacity above average. +cinema,SELECT DISTINCT LOCATION FROM cinema,What are all the locations with a cinema? +cinema,"SELECT name , openning_year FROM cinema ORDER BY openning_year DESC",Show all the cinema names and opening years in descending order of opening year. +cinema,"SELECT name , LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1",What are the name and location of the cinema with the largest capacity? +cinema,"SELECT avg(capacity) , min(capacity) , max(capacity) FROM cinema WHERE openning_year >= 2011","Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later." +cinema,"SELECT LOCATION , count(*) FROM cinema GROUP BY LOCATION",Show each location and the number of cinemas there. +cinema,SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1,What is the location with the most cinemas opened in year 2010 or later? +cinema,SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 2,Show all the locations with at least two cinemas with capacity above 300. +cinema,"SELECT title , directed_by FROM film",Show the title and director for all films. +cinema,SELECT DISTINCT directed_by FROM film,Show all directors. +cinema,"SELECT directed_by , count(*) FROM film GROUP BY directed_by",List all directors along with the number of films directed by each director. +cinema,"SELECT T2.name , sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id",What is total number of show times per day for each cinema? +cinema,"SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id",What are the title and maximum price of each film? +cinema,"SELECT T3.name , T2.title , T1.date , T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id","Show cinema name, film title, date, and price for each record in schedule." +cinema,"SELECT title , directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule)",What are the title and director of the films without any schedule? +cinema,SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC LIMIT 1,Show director with the largest number of show times in total. +cinema,SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 1,Find the locations that have more than one movie theater with capacity above 300. +cre_Drama_Workshop_Groups,SELECT count(*) FROM BOOKINGS,How many bookings do we have? +cre_Drama_Workshop_Groups,SELECT Order_Date FROM BOOKINGS,List the order dates of all the bookings. +cre_Drama_Workshop_Groups,"SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS",Show all the planned delivery dates and actual delivery dates of bookings. +cre_Drama_Workshop_Groups,SELECT count(*) FROM CUSTOMERS,How many customers do we have? +cre_Drama_Workshop_Groups,"SELECT Customer_Phone , Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = ""Harold""",What are the phone and email for customer Harold? +cre_Drama_Workshop_Groups,SELECT Store_Name FROM Drama_Workshop_Groups,Show all the Store_Name of drama workshop groups. +cre_Drama_Workshop_Groups,"SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES","Show the minimum, average, maximum order quantity of all invoices." +cre_Drama_Workshop_Groups,SELECT DISTINCT payment_method_code FROM INVOICES,What are the distinct payment method codes in all the invoices? +cre_Drama_Workshop_Groups,"SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = ""China""",What is the description of the marketing region China? +cre_Drama_Workshop_Groups,SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS),Show all the distinct product names with price higher than the average. +cre_Drama_Workshop_Groups,SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1,What is the name of the most expensive product? +cre_Drama_Workshop_Groups,"SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = ""Ashley""",What is the phone number of the performer Ashley? +cre_Drama_Workshop_Groups,"SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code",Show all payment method codes and the number of orders for each code. +cre_Drama_Workshop_Groups,SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1,What is the payment method code used by the most orders? +cre_Drama_Workshop_Groups,"SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = ""FJA Filming""","Which city is the address of the store named ""FJA Filming"" located in?" +cre_Drama_Workshop_Groups,"SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = ""CA""","What are the states or counties of the address of the stores with marketing region code ""CA""?" +cre_Drama_Workshop_Groups,"SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = ""Rob Dinning""",What is the name of the marketing region that the store Rob Dinning belongs to? +cre_Drama_Workshop_Groups,SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100,What are the descriptions of the service types with product price above 100? +cre_Drama_Workshop_Groups,"SELECT T1.Service_Type_Description , T2.Service_Type_Code , COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code","What is the description, code and the corresponding count of each service type?" +cre_Drama_Workshop_Groups,"SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1",What is the description and code of the type of service that is performed the most often? +cre_Drama_Workshop_Groups,"SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID",What are the phones and emails of workshop groups in which services are performed? +cre_Drama_Workshop_Groups,"SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = ""film""","What are the names of workshop groups in which services with product name ""film"" are performed?" +cre_Drama_Workshop_Groups,"SELECT Product_Name , avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name",What are the different product names? What is the average product price for each of them? +cre_Drama_Workshop_Groups,SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000,What are the product names with average product price smaller than 1000000? +cre_Drama_Workshop_Groups,"SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = ""photo""",What are the total order quantities of photo products? +cre_Drama_Workshop_Groups,SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000,What are the order details of the products with price higher than 2000? +cre_Drama_Workshop_Groups,SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1,What are the actual delivery dates of orders with quantity 1? +cre_Drama_Workshop_Groups,SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000,What are the order dates of orders with price higher than 1000? +cre_Drama_Workshop_Groups,SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups,How many distinct currency codes are there for all drama workshop groups? +cre_Drama_Workshop_Groups,"SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = ""Feliciaberg""",What are the names of the drama workshop groups with address in Feliciaberg city? +cre_Drama_Workshop_Groups,"SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = ""Alaska""",What are the email addresses of the drama workshop groups with address in Alaska state? +cre_Drama_Workshop_Groups,"SELECT T1.City_Town , count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town",Show all cities along with the number of drama workshop groups in each city. +cre_Drama_Workshop_Groups,SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1,What is the marketing region code that has the most drama workshop groups? +cre_Drama_Workshop_Groups,SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID,Show all cities where at least one customer lives in but no performer lives in. +cre_Drama_Workshop_Groups,SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1,What is the most frequent status of bookings? +cre_Drama_Workshop_Groups,"SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = ""stop""","What are the names of the workshop groups that have bookings with status code ""stop""?" +cre_Drama_Workshop_Groups,SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID,Show the names of all the clients with no booking. +cre_Drama_Workshop_Groups,"SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = ""MasterCard""","What is the average quantities ordered with payment method code ""MasterCard"" on invoices?" +cre_Drama_Workshop_Groups,SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1,What is the product ID of the most frequently ordered item on invoices? +cre_Theme_park,"SELECT avg(price_range) FROM HOTELS WHERE star_rating_code = ""5"" AND pets_allowed_yn = 1",Show the average price range of hotels that have 5 star ratings and allow pets. +cre_Theme_park,"SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE ""%film%""","Which location names contain the word ""film""?" +cre_Theme_park,"SELECT Name , Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = ""bus"" OR How_to_Get_There = ""walk""",What are the names and opening hours of the tourist attractions that can be accessed by bus or walk? +cre_Theme_park,SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000,What are the star rating descriptions of the hotels with price above 10000? +cre_Theme_park,"SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = ""game1""","What is the name of the tourist attraction that is associated with the photo ""game1""?" +cre_Theme_park,"SELECT T1.Name , T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = ""film festival""","What are the names and descriptions of the photos taken at the tourist attraction ""film festival""?" +cre_Theme_park,"SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = ""walk""",What are the details of the shops that can be accessed by walk? +cre_Theme_park,"SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = ""US museum""","What is the name of the staff that is in charge of the attraction named ""US museum""?" +cre_Theme_park,"SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = ""walk"" OR T2.How_to_Get_There = ""bus""",What are the details of the markets that can be accessed by walk or bus? +cre_Theme_park,"SELECT T2.Visit_Date , T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = ""Vincent""",What are the visit date and details of the visitor whose detail is 'Vincent'? +cre_Theme_park,"SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = ""Vincent""",Which tourist attractions does the visitor with detail 'Vincent' visit? +cre_Theme_park,"SELECT T1.Name , T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Vincent"" OR T2.Tourist_Details = ""Vivian""",What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there? +cre_Theme_park,SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3,Show the details of the top 3 most expensive hotels. +cre_Theme_park,"SELECT other_hotel_details , star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3",Show the details and star ratings of the 3 least expensive hotels. +cre_Theme_park,SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1,Show the transportation method most people choose to get to tourist attractions. +cre_Theme_park,"SELECT T1.Attraction_Type_Description , T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1",Show the description and code of the attraction type most tourist attractions belong to. +cre_Theme_park,"SELECT T1.Name , T2.Tourist_Attraction_ID , COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID","Show different tourist attractions' names, ids, and the corresponding number of visits." +cre_Theme_park,"SELECT T1.Name , T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*) >= 2",Show the names and ids of tourist attractions that are visited at least two times. +cre_Theme_park,"SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = ""660 Shea Crescent"" OR T2.How_to_Get_There = ""walk""",What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent? +cre_Theme_park,SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'shopping',What are the names of the tourist attractions that have parking or shopping as their feature details? +cre_Theme_park,"SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = ""254 Ottilie Junction"" OR T2.How_to_Get_There = ""bus""",What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction? +cre_Theme_park,"SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Alison"" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = ""Rosalind""",What are the names of tourist attraction that Alison visited but Rosalind did not visit? +candidate_poll,SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1,Which poll resource provided the most number of candidate information? +candidate_poll,SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3,what are the top 3 highest support rates? +candidate_poll,SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1,Find the id of the candidate who got the lowest oppose rate. +candidate_poll,SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1,which poll source does the highest oppose rate come from? +candidate_poll,"SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'",Find the average height and weight for all males (sex is M). +candidate_poll,SELECT name FROM people WHERE height > 200 OR height < 190,find the names of people who are taller than 200 or lower than 190. +candidate_poll,"SELECT avg(weight) , min(weight) , sex FROM people GROUP BY sex",Find the average and minimum weight for each gender. +candidate_poll,"SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1",Find the name and gender of the candidate who got the highest support rate. +candidate_poll,"SELECT t1.name , t1.sex , min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex",Find the name of the candidates whose oppose percentage is the lowest for each sex. +candidate_poll,SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1,which gender got the highest average uncertain ratio. +candidate_poll,SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate),what are the names of people who did not participate in the candidate election. +candidate_poll,SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate,Find the names of the candidates whose support percentage is lower than their oppose rate. +candidate_poll,"SELECT count(*) , sex FROM people WHERE weight > 85 GROUP BY sex",how many people are there whose weight is higher than 85 for each gender? +candidate_poll,"SELECT max(support_rate) , min(consider_rate) , min(oppose_rate) FROM candidate","find the highest support percentage, lowest consider rate and oppose rate of all candidates." +candidate_poll,SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name,list all female (sex is F) candidate names in the alphabetical order. +twitter_1,"SELECT name , email FROM user_profiles WHERE name LIKE '%Swift%'",Find the name and email of the user whose name contains the word ‘Swift’. +twitter_1,SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%',Find the names of users whose emails contain ‘superstar’ or ‘edu’. +twitter_1,SELECT text FROM tweets WHERE text LIKE '%intern%',Return the text of tweets about the topic 'intern'. +twitter_1,SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift'),"Find the names of the users whose number of followers is greater than that of the user named ""Tyler Swift""." +twitter_1,"SELECT T1.name , T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > 1",Find the name and email for the users who have more than one follower. +twitter_1,SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1,Find the names of users who have more than one tweet. +twitter_1,"SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = ""Mary"" OR T1.name = ""Susan""",Find the id of users who are followed by Mary or Susan. +twitter_1,"SELECT name , email FROM user_profiles ORDER BY followers LIMIT 1",Find the name and email of the user followed by the least number of people. +twitter_1,SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5,List the names of 5 users followed by the largest number of other users. +twitter_1,"SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid",Find the name of each user and number of tweets tweeted by each of them. +twitter_1,"SELECT T1.name , T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) < 2",Find the name and partition id for users who tweeted less than twice. +twitter_1,"SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1","Find the name of the user who tweeted more than once, and number of tweets tweeted by them." +twitter_1,SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets),Find the average number of followers for the users who had some tweets. +tracking_orders,SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1,What is the id of the most recent order? +tracking_orders,"SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1",what are the order id and customer id of the oldest order? +tracking_orders,"SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Packing""","List the name of all the distinct customers who have orders with status ""Packing""." +tracking_orders,"SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road""","Find the details of all the distinct customers who have orders with status ""On Road""." +tracking_orders,SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1,What is the name of the customer who has the most orders? +tracking_orders,SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1,What is the customer id of the customer who has the most orders? +tracking_orders,"SELECT T2.order_id , T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = ""Jeramie""","Give me a list of id and status of orders which belong to the customer named ""Jeramie""." +tracking_orders,"SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = ""Jeramie""","Find the dates of orders which belong to the customer named ""Jeramie""." +tracking_orders,"SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= ""2009-01-01"" AND T2.date_order_placed <= ""2010-01-01""",Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01. +tracking_orders,"SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= ""1975-01-01"" AND T1.date_order_placed <= ""1976-01-01""",Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01? +tracking_orders,"SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road"" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Shipped""","Find the names of the customers who have order status both ""On Road"" and ""Shipped""." +tracking_orders,"SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""On Road"" INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = ""Shipped""","Find the id of the customers who have order status both ""On Road"" and ""Shipped""." +tracking_orders,SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452,When was the order placed whose shipment tracking number is 3452? Give me the date. +tracking_orders,SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10,What is the placement date of the order whose invoice number is 10? +tracking_orders,"SELECT count(*) , T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id",List the count and id of each product in all the orders. +tracking_orders,"SELECT T3.product_name , count(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id",List the name and count of each product in all orders. +tracking_orders,SELECT order_id FROM shipments WHERE shipment_date = (SELECT max(shipment_date) FROM shipments),Find the id of the order which is shipped most recently. +tracking_orders,SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY count(*) DESC LIMIT 1,What is the id of the order which has the most items? +tracking_orders,SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1,What is the name of the customer who has the largest number of orders? +tracking_orders,"SELECT invoice_number FROM invoices WHERE invoice_date < ""1989-09-03"" OR invoice_date > ""2007-12-25""",Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25. +tracking_orders,"SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < ""1989-09-03"" OR invoice_date > ""2007-12-25""",Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25. +tracking_orders,"SELECT T2.customer_name , count(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) >= 2","For each customer who has at least two orders, find the customer name and number of orders made." +tracking_orders,SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) <= 2,Find the name of the customers who have at most two orders. +tracking_orders,"SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = ""food"" GROUP BY T1.customer_id HAVING count(*) >= 1","List the names of the customers who have once bought product ""food""." +tracking_software_problems,SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1,What is the id of the problem log that is created most recently? +tracking_software_problems,"SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1",What is the oldest log id and its corresponding problem id? +tracking_software_problems,"SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1",List the first and last names of all distinct staff members who are assigned to the problem whose id is 1. +tracking_software_problems,"SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = ""Rylan"" AND T1.staff_last_name = ""Homenick""",List the problem id and log id which are assigned to the staff named Rylan Homenick. +tracking_software_problems,"SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = ""voluptatem""",How many problems are there for product voluptatem? +tracking_software_problems,"SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1",How many problems does the product with the most problems have? List the number of the problems and product name. +tracking_software_problems,"SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Christop""",Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop. +tracking_software_problems,"SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = ""Bosco""",Find the ids of the problems that are reported by the staff whose last name is Bosco. +tracking_software_problems,"SELECT count(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id","For each product which has problems, what are the number of problems and the product id?" +tracking_software_problems,"SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > ""1986-11-13"" GROUP BY T2.product_id","For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?" +tracking_software_problems,"SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Dameon"" AND T2.staff_last_name = ""Frami"" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Jolie"" AND T2.staff_last_name = ""Weber""",What are the id of problems reported by the staff named Dameon Frami or Jolie Weber? +tracking_software_problems,"SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Christop"" AND T2.staff_last_name = ""Berge"" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = ""Ashley"" AND T2.staff_last_name = ""Medhurst""",What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst? +tracking_software_problems,"SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = ""Lysanne"" AND T4.staff_last_name = ""Turcotte"" )",What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte? +tracking_software_problems,"SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = ""Rylan"" AND T4.staff_last_name = ""Homenick"" )",What are the ids of the problems reported after the date of any problems reported by Rylan Homenick? +tracking_software_problems,SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3,Find the top 3 products which have the largest number of problems? +tracking_software_problems,"SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = ""voluptatem"" AND T1.date_problem_reported > ""1995""","List the ids of the problems FROM the product ""voluptatem"" that are reported after 1995?" +tracking_software_problems,"SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = ""rem"" EXCEPT SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = ""aut""","Find the first and last name of the staff members who reported problems FROM the product ""rem"" but not ""aut""?" +student_assessment,SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1,which course has most number of registered students? +student_assessment,SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1,what is id of students who registered some courses but the least number of courses in these students? +student_assessment,SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance),List the id of students who never attends courses? +student_assessment,SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1,What is detail of the student who most recently registered course? +student_assessment,"SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = ""English""",How many students attend course English? +student_assessment,SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171,How many courses do the student whose id is 171 attend? +student_assessment,"SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = ""stanley.monahan@example.org""",Find id of the candidate whose email is stanley.monahan@example.org? +student_assessment,SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1,Find id of the candidate who most recently accessed the course? +student_assessment,SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1,What are the details of the student who registered the most number of courses? +student_assessment,"SELECT T1.student_id , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id",List the id of students who registered some courses and the number of their registered courses? +student_assessment,"SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id",How many registered students does each course have? List course name and the number of their registered students. +student_assessment,"SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = ""Fail""","Find the cell mobile number of the candidates whose assessment code is ""Fail""?" +student_assessment,SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1,What is the id of the student who most recently attended course is 301? +student_assessment,SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id,Find distinct cities of address of students? +student_assessment,SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance,What are the id of students who registered courses or attended courses? +student_assessment,SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121,Find the id of courses which are registered or attended by student whose id is 121? +student_assessment,SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance),What are all info of students who registered courses but not attended courses? +student_assessment,"SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = ""statistics"" ORDER BY T2.registration_date",List the id of students who registered course statistics in the order of registration date. +wrestler,SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1,What is the name of the wrestler with the fewest days held? +wrestler,"SELECT T2.Name , T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC",List the names of wrestlers and the teams in elimination in descending order of days held. +wrestler,SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1,List the time of elimination of the wrestlers with largest days held. +wrestler,SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50,Show times of elimination of wrestlers with days held more than 50. +wrestler,SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3,Show teams that have suffered more than three eliminations. +wrestler,SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1,Please show the most common reigns of wrestlers. +wrestler,SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2,List the locations that are shared by more than two wrestlers. +wrestler,SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination),List the names of wrestlers that have not been eliminated. +wrestler,"SELECT Team FROM Elimination WHERE Eliminated_By = ""Orton"" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = ""Benjamin""","Show the teams that have both wrestlers eliminated by ""Orton"" and wrestlers eliminated by ""Benjamin""." +local_govt_and_lot,"SELECT T1.property_id , count(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id",How many residents does each property have? List property id and resident count. +local_govt_and_lot,SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party',What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'? +local_govt_and_lot,"SELECT t1.resident_id , t1.other_details , count(*) FROM residents AS t1 JOIN residents_services AS t2 ON t1.resident_id = t2.resident_id GROUP BY t1.resident_id ORDER BY count(*) DESC","How many services has each resident requested? List the resident id, details, and the count in descending order of the count." +local_govt_and_lot,"SELECT T1.service_id , T1.service_details , count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1","What is the maximum number that a certain service is provided? List the service id, details and number." +local_govt_and_lot,"SELECT T1.customer_id , T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 3",What are the id and details of the customers who have at least 3 events? +local_govt_and_lot,"SELECT T1.Customer_Event_ID , T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING count(*) BETWEEN 1 AND 3",Which events have the number of notes between one and three? List the event id and the property id. +local_govt_and_lot,"SELECT DISTINCT T2.thing_id , T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21'",What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21' +local_govt_and_lot,SELECT count(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied',How many distinct locations have the things with service detail 'Unsatisfied' been located in? +local_govt_and_lot,SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations,Which organizations are not a parent organization of others? List the organization id. +local_govt_and_lot,SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%',What are the resident details containing the substring 'Miss'? +product_catalog,SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3,Find the list of attribute data types possessed by more than 3 attribute definitions. +product_catalog,"SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE ""%Murray%""","Find all the catalog publishers whose name contains ""Murray""" +product_catalog,SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1,Which catalog publisher has published the most catalogs? +product_catalog,"SELECT t1.catalog_name , t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5",Find the names and publication dates of all catalogs that have catalog level number greater than 5. +product_catalog,SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1),What are the entry names of catalog with the attribute possessed by most entries. +product_catalog,SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1,What is the entry name of the most expensive catalog (in USD)? +product_catalog,SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1,What is the level name of the cheapest catalog (in USD)? +product_catalog,"SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents",What are the average and minimum price (in Euro) of all products? +product_catalog,SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1,What is the product with the highest height? Give me the catalog entry name. +product_catalog,SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1,Find the name of the product that has the smallest capacity. +product_catalog,"SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE ""2%""","Find the names of all the products whose stock number starts with ""2""." +product_catalog,"SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = ""8""",Find the names of catalog entries with level number 8. +product_catalog,SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5,Find the names of the products with length smaller than 3 or height greater than 5. +product_catalog,"SELECT t1.attribute_name , t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0",Find the name and attribute ID of the attribute definitions with attribute value 0. +entertainment_awards,SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1,What is the location of the festival with the largest number of audience? +entertainment_awards,SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3,Show the names of the three most recent festivals. +entertainment_awards,"SELECT T2.Name , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID","For each nomination, show the name of the artwork and name of the festival where it is nominated." +entertainment_awards,SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007,Show distinct types of artworks that are nominated in festivals in 2007. +entertainment_awards,SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year,Show the names of artworks in ascending order of the year they are nominated in. +entertainment_awards,"SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = ""Program Talent Show""","Show the names of festivals that have nominated artworks of type ""Program Talent Show""." +entertainment_awards,"SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2",Show the ids and names of festivals that have at least two nominations for artworks. +entertainment_awards,"SELECT T1.Festival_ID , T3.Festival_Name , COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID","Show the id, name of each festival and the number of artworks it has nominated." +entertainment_awards,SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1,List the most common type of artworks. +entertainment_awards,SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1,List the year in which there are more than one festivals. +entertainment_awards,SELECT Name FROM Artwork WHERE Artwork_ID NOT IN (SELECT Artwork_ID FROM nomination),List the name of artworks that are not nominated. +entertainment_awards,SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010,Show the number of audience in year 2008 or 2010. +behavior_monitoring,"SELECT email_address FROM Students WHERE first_name = ""Emma"" AND last_name = ""Rohan""","What is the email of the student with first name ""Emma"" and last name ""Rohan""?" +behavior_monitoring,"SELECT max(monthly_rental) , min(monthly_rental) FROM Student_Addresses",Find the maximum and minimum monthly rental for all student addresses. +behavior_monitoring,SELECT first_name FROM Teachers WHERE email_address LIKE '%man%',"Find the first names of teachers whose email address contains the word ""man""." +behavior_monitoring,"SELECT T1.student_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1",Find the id and first name of the student that has the most number of assessment notes? +behavior_monitoring,"SELECT T1.teacher_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3",Find the ids and first names of the 3 teachers that have the most number of assessment notes? +behavior_monitoring,"SELECT T1.student_id , T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1",Find the id and last name of the student that has the most behavior incidents? +behavior_monitoring,"SELECT T1.teacher_id , T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = ""AFTER"" GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1","Find the id and last name of the teacher that has the most detentions with detention type code ""AFTER""?" +behavior_monitoring,"SELECT T1.student_id , T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1",What are the id and first name of the student whose addresses have the highest average monthly rental? +behavior_monitoring,"SELECT T2.address_id , T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1",Find the id and city of the student address with the highest average monthly rental. +behavior_monitoring,"SELECT T1.incident_type_code , T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY count(*) DESC LIMIT 1",What are the code and description of the most frequent behavior incident type? +behavior_monitoring,"SELECT T1.detention_type_code , T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1",What are the code and description of the least frequent detention type ? +behavior_monitoring,"SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = ""Fanny""","Find the dates of assessment notes for students with first name ""Fanny""." +behavior_monitoring,"SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = ""Schuster""","Find the texts of assessment notes for teachers with last name ""Schuster""." +behavior_monitoring,"SELECT T1.date_incident_start , date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = ""Fahey""","Find the start and end dates of behavior incidents of students with last name ""Fahey""." +behavior_monitoring,"SELECT T1.datetime_detention_start , datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = ""Schultz""","Find the start and end dates of detentions of teachers with last name ""Schultz""." +behavior_monitoring,"SELECT T2.address_id , T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1",What are the id and zip code of the address with the highest monthly rental? +behavior_monitoring,SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1,What is the cell phone number of the student whose address has the lowest monthly rental? +behavior_monitoring,"SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = ""Texas""",What are the monthly rentals of student addresses in Texas state? +behavior_monitoring,"SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = ""Wisconsin""",What are the first names and last names of students with address in Wisconsin state? +behavior_monitoring,"SELECT T1.line_1 , avg(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id",What are the line 1 and average monthly rentals of all student addresses? +behavior_monitoring,"SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = ""Lyla""","What is the zip code of the address where the teacher with first name ""Lyla"" lives?" +behavior_monitoring,"SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = ""918""","What are the email addresses of teachers whose address has zip code ""918""?" +behavior_monitoring,SELECT count(*) FROM STUDENTS WHERE student_id NOT IN ( SELECT student_id FROM Behavior_Incident ),How many students are not involved in any behavior incident? +behavior_monitoring,SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id,Find the last names of teachers who are not involved in any detention. +e_government,"SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name","List every individual's first name, middle name and last name in alphabetical order by last name." +e_government,SELECT DISTINCT form_type_code FROM forms,List all the types of forms. +e_government,SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1,Find the name of the most popular party form. +e_government,"SELECT payment_method_code , party_phone FROM parties WHERE party_email = ""enrico09@example.com""","Find the payment method and phone of the party with email ""enrico09@example.com""." +e_government,SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1),Find the emails of parties with the most popular party form. +e_government,SELECT organization_name FROM organizations ORDER BY date_formed ASC,List all the name of organizations in order of the date formed. +e_government,SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1,Find the name of the youngest organization. +e_government,"SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = ""Labour Party"" ORDER BY t2.date_contact_to DESC LIMIT 1","Find the last name of the latest contact individual of the organization ""Labour Party""." +e_government,SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1,Find the last name of the first ever contact person of the organization with the highest UK Vat number. +e_government,SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id,Find the names of the services that have never been used. +e_government,SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses,Find the name of all the cities and states. +e_government,"SELECT count(*) FROM addresses WHERE state_province_county = ""Colorado""","How many cities are there in state ""Colorado""?" +e_government,SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*) > 3,Find the payment method code used by more than 3 parties. +e_government,"SELECT organization_name FROM organizations WHERE organization_name LIKE ""%Party%""","Find the name of organizations whose names contain ""Party""." +e_government,SELECT count(DISTINCT payment_method_code) FROM parties,How many distinct payment methods are used by parties? +e_government,SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY count(*) DESC LIMIT 1,Which is the email of the party that has used the services the most number of times? +e_government,"SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE ""%6862 Kaitlyn Knolls%""","Which state can address ""6862 Kaitlyn Knolls"" possibly be in?" +e_government,SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY count(*) DESC LIMIT 1,What is the name of organization that has the greatest number of contact individuals? +products_for_hire,SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500,Are the customers holding coupons with amount 500 bad or good? +products_for_hire,"SELECT T1.customer_id , T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id","How many bookings did each customer make? List the customer id, first name, and the count." +products_for_hire,"SELECT customer_id , sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) DESC LIMIT 1",What is the maximum total amount paid by a customer? List the customer id and amount. +products_for_hire,"SELECT T1.booking_id , T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) DESC LIMIT 1",What are the id and the amount of refund of the booking that incurred the most times of payments? +products_for_hire,SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*) = 3,What is the id of the product that is booked for 3 times? +products_for_hire,SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76,What is the product description of the product booked with an amount of 102.76? +products_for_hire,"SELECT T3.booking_start_date , T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'",What are the start date and end date of the booking that has booked the product named 'Book collection A'? +products_for_hire,SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1,What are the names of products whose availability equals to 1? +products_for_hire,"SELECT first_name , last_name , gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name","What are the first name, last name, and gender of all the good customers? Order by their last name." +products_for_hire,"SELECT max(booked_count) , min(booked_count) , avg(booked_count) FROM products_booked","What are the maximum, minimum, and average booked count for the products booked?" +products_for_hire,SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%',What are the daily hire costs for the products with substring 'Book' in its name? +products_for_hire,SELECT count(*) FROM Products_for_hire WHERE product_id NOT IN ( SELECT product_id FROM products_booked WHERE booked_amount > 200 ),How many products are never booked with amount higher than 200? +products_for_hire,SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad',What are the coupon amount of the coupons owned by both good and bad customers? +products_for_hire,SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check',What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check' +journal_committee,SELECT Name FROM editor WHERE Age = 24 OR Age = 25,Show the names of editors of age either 24 or 25. +journal_committee,SELECT Name FROM editor ORDER BY Age ASC LIMIT 1,What is the name of the youngest editor? +journal_committee,SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1,Please show the most common age of editors. +journal_committee,"SELECT T2.Name , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID",Show the names of editors and the theme of journals for which they serve on committees. +journal_committee,"SELECT T2.Name , T2.age , T3.Theme FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID ORDER BY T3.Theme ASC","Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme." +journal_committee,SELECT T2.Name FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000,Show the names of editors that are on the committee of journals with sales bigger than 3000. +journal_committee,"SELECT T1.editor_id , T1.Name , COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.editor_id","Show the id, name of each editor and the number of journal committees they are on." +journal_committee,SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2,Show the names of editors that are on at least two journal committees. +journal_committee,SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee),List the names of editors that are not on any journal committee. +journal_committee,"SELECT date , theme , sales FROM journal EXCEPT SELECT T1.date , T1.theme , T1.sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID","List the date, theme and sales of the journal which did not have any of the listed editors serving on committee." +department_store,SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3,What are the ids of the top three products that were purchased in the largest amount? +department_store,"SELECT product_id , product_type_code FROM products ORDER BY product_price LIMIT 1",What are the product id and product type of the cheapest product? +department_store,SELECT count(DISTINCT product_type_code) FROM products,Find the number of different product types. +department_store,SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10,Return the address of customer 10. +department_store,"SELECT T1.staff_id , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Department Manager""",What are the staff ids and genders of all staffs whose job title is Department Manager? +department_store,"SELECT payment_method_code , count(*) FROM customers GROUP BY payment_method_code","For each payment method, return how many customers use it." +department_store,SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1,What is the id of the product that was ordered the most often? +department_store,"SELECT T1.customer_name , T1.customer_phone , T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1","What are the name, phone number and email address of the customer who made the largest number of orders?" +department_store,"SELECT product_type_code , avg(product_price) FROM products GROUP BY product_type_code",What is the average price for each type of product? +department_store,"SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = ""South""",How many department stores does the store chain South have? +department_store,"SELECT T1.staff_name , T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1",What is the name and job title of the staff who was assigned the latest? +department_store,"SELECT T2.product_type_code , T2.product_name , T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3","Give me the product type, name and price for all the products supplied by supplier id 3." +department_store,"SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""Pending"" ORDER BY T2.customer_id","Return the distinct name of customers whose order status is Pending, in the order of customer id." +department_store,"SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""New"" INTERSECT SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = ""Pending""",Find the name and address of the customers who have both New and Pending orders. +department_store,SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT avg(product_price) FROM products),Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products. +department_store,"SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = ""marketing"" INTERSECT SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = ""managing""",What is the id and name of the department store that has both marketing and managing department? +department_store,SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2,What are the ids of the two department store chains with the largest number of department stores? +department_store,SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1,What is the id of the department with the least number of staff? +department_store,"SELECT product_type_code , max(product_price) , min(product_price) FROM products GROUP BY product_type_code","For each product type, return the maximum and minimum price." +department_store,SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price) > (SELECT avg(product_price) FROM products),Find the product type whose average price is higher than the average price of all products. +department_store,"SELECT T1.staff_id , T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1",Find the id and name of the staff who has been assigned for the shortest period. +department_store,"SELECT product_name , product_id FROM products WHERE product_price BETWEEN 600 AND 700",Return the names and ids of all products whose price is between 600 and 700. +department_store,"SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code = ""Cancelled"")",Find the ids of all distinct customers who made order after some orders that were Cancelled. +department_store,SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code = 'Clerical Staff'),What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff? +department_store,"SELECT customer_name , customer_id FROM customers WHERE customer_address LIKE ""%TN%""",What are the names and ids of customers whose address contains TN? +department_store,"SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE ""2016%""",Return the name and gender of the staff who was assigned in 2016. +department_store,SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.staff_id HAVING COUNT (*) > 1,List the name of staff who has been assigned multiple jobs. +department_store,"SELECT T1.supplier_name , T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id ORDER BY T3.address_details",List the name and phone number of all suppliers in the alphabetical order of their addresses. +department_store,SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers,What are the phone numbers of all customers and suppliers? +department_store,SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased) > 80000,Return the ids of all products that were ordered more than three times or supplied more than 80000. +department_store,"SELECT product_id , product_name FROM products WHERE product_price < 600 OR product_price > 900",What are id and name of the products whose price is lower than 600 or higher than 900? +department_store,SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(total_amount_purchased) > 50000 OR avg(total_amount_purchased) < 30000,Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000. +department_store,"SELECT avg(total_amount_purchased) , avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id = (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)",What are the average amount purchased and value purchased for the supplier who supplies the most products. +department_store,"SELECT max(customer_code) , min(customer_code) FROM Customers",What is the largest and smallest customer codes? +department_store,"SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = ""keyboard""",List the names of all the distinct customers who bought a keyboard. +department_store,"SELECT DISTINCT T1.supplier_name , T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = ""red jeans""",List the names and phone numbers of all the distinct suppliers who supply red jeans. +department_store,"SELECT max(product_price) , min(product_price) , product_type_code FROM products GROUP BY product_type_code ORDER BY product_type_code","What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?" +department_store,"SELECT order_id , customer_id FROM customer_orders WHERE order_status_code = ""Cancelled"" ORDER BY order_date","List the order id, customer id for orders in Cancelled status, ordered by their order dates." +department_store,SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id) >= 2,Find the names of products that were bought by at least two distinct customers. +department_store,SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id) >= 3,Find the names of customers who have bought at least three distinct products. +department_store,"SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Sales Person"" EXCEPT SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = ""Clerical Staff""",Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff. +department_store,"SELECT customer_id , customer_name FROM customers WHERE customer_address LIKE ""%WY%"" AND payment_method_code != ""Credit Card""",Find the id and name of customers whose address contains WY state and do not use credit card for payment. +department_store,SELECT avg(product_price) FROM products WHERE product_type_code = 'Clothes',Find the average price of all product clothes. +mountain_photos,SELECT count(*) FROM camera_lens WHERE focal_length_mm > 15,How many camera lenses have a focal length longer than 15 mm? +mountain_photos,"SELECT brand , name FROM camera_lens ORDER BY max_aperture DESC","Find the brand and name for each camera lens, and sort in descending order of maximum aperture." +mountain_photos,"SELECT id , color , name FROM photos","List the id, color scheme, and name for all the photos." +mountain_photos,SELECT height FROM mountain,What are the maximum and average height of the mountains? +mountain_photos,SELECT avg(prominence) FROM mountain WHERE country = 'Morocco',What are the average prominence of the mountains in country 'Morocco'? +mountain_photos,"SELECT name , height , prominence FROM mountain WHERE range != 'Aberdare Range'","What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?" +mountain_photos,"SELECT T1.id , T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000",What are the id and name of mountains that have photos and height above 4000? +mountain_photos,"SELECT T1.id , T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id GROUP BY T1.id HAVING count(*) >= 2",What are the id and name of the mountains that have at least 2 photos? +mountain_photos,SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1,What are the names of the cameras that have taken picture of the most mountains? +mountain_photos,SELECT T2.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus',What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'? +mountain_photos,SELECT count(DISTINCT brand) FROM camera_lens,How many different kinds of lens brands are there? +mountain_photos,SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos ),How many camera lenses are not used in taking any photos? +mountain_photos,SELECT count(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia',How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'? +mountain_photos,SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Lasta Massif',List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif' +mountain_photos,"SELECT name , prominence FROM mountain EXCEPT SELECT T1.name , T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma'",Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'. +mountain_photos,"SELECT name FROM camera_lens WHERE name LIKE ""%Digital%""","List the camera lens names containing substring ""Digital""." +insurance_policies,"SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.Claim_id HAVING count(*) > 2 UNION SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id WHERE T1.Amount_Claimed = ( SELECT max(Amount_Claimed) FROM Claims )",Which claims caused more than 2 settlements or have the maximum claim value? List the date the claim was made and the claim id. +insurance_policies,"SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 EXCEPT SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.customer_id JOIN Claims AS T3 ON T2.policy_id = T3.policy_id",Which customer had at least 2 policies but did not file any claims? List the customer details and id. +insurance_policies,"SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1","Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount." +insurance_policies,"SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1","Among all the claims, what is the amount claimed in the claim with the least amount settled? List both the settlement amount and claim amount." +insurance_policies,"SELECT Date_Claim_Made , Date_Claim_Settled FROM Claims WHERE Amount_Claimed > ( SELECT avg(Amount_Claimed) FROM Claims )","Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled." +insurance_policies,SELECT Date_Claim_Made FROM Claims WHERE Amount_Settled <= ( SELECT avg(Amount_Settled) FROM Claims ),"Among all the claims, which settlements have a claimed amount that is no more than the average? List the claim start date." +insurance_policies,"SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id",How many settlements does each claim correspond to? List the claim id and the number of settlements. +insurance_policies,"SELECT T1.claim_id , T1.date_claim_made , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY count(*) DESC LIMIT 1","Which claim incurred the most number of settlements? List the claim id, the date the claim was made, and the number." +insurance_policies,"SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1",How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id. +insurance_policies,SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made ASC LIMIT 1,"Of all the claims, what was the earliest date when any claim was made?" +insurance_policies,"SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count(*) > 1",Who are the customers that had more than 1 policy? List the customer details and id. +insurance_policies,SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1,What is the most popular payment method? +insurance_policies,SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1,With which kind of payment method were the least number of payments processed? +insurance_policies,SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code ORDER BY count(*) DESC LIMIT 1,Which kind of policy type was chosen by the most customers? +insurance_policies,SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id,List the details of the customers who do not have any policies. +train_station,SELECT count(*) FROM station,How many train stations are there? +train_station,"SELECT name , LOCATION , number_of_platforms FROM station","Show the name, location, and number of platforms for all stations." +train_station,SELECT DISTINCT LOCATION FROM station,What are all locations of train stations? +train_station,"SELECT name , total_passengers FROM station WHERE LOCATION != 'London'",Show the names and total passengers for all train stations not in London. +train_station,"SELECT name , main_services FROM station ORDER BY total_passengers DESC LIMIT 3",Show the names and main services for train stations that have the top three total number of passengers. +train_station,"SELECT avg(total_passengers) , max(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow'",What is the average and maximum number of total passengers for train stations in London or Glasgow? +train_station,"SELECT LOCATION , sum(number_of_platforms) , sum(total_passengers) FROM station GROUP BY LOCATION",Show all locations and the total number of platforms and passengers for all train stations in each location. +train_station,SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25,Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers. +train_station,SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15,Show all locations which don't have a train station with at least 15 platforms. +train_station,SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1,Show the location with most number of train stations. +train_station,"SELECT name , TIME , service FROM train","Show the name, time, and service for all trains." +train_station,SELECT count(*) FROM train,Show the number of trains +train_station,"SELECT name , service FROM train ORDER BY TIME",Show the name and service for all trains in order by time. +train_station,"SELECT T2.name , count(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id",Show the station name and number of trains in each station. +train_station,"SELECT T2.name , T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id",show the train name and station name for each train. +train_station,"SELECT T3.name , T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC",Show all train names and times in stations in London in descending order by train time. +train_station,SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY count(*) DESC LIMIT 1,Show the station name with greatest number of trains. +train_station,SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING count(*) >= 2,Show the station name with at least two trains. +train_station,SELECT LOCATION FROM station GROUP BY LOCATION HAVING count(*) = 1,Show all locations with only 1 station. +train_station,SELECT name FROM station WHERE station_id NOT IN (SELECT station_id FROM train_station),Show station names without any trains. +train_station,"SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = ""Ananthapuri Express"" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = ""Guruvayur Express""","What are the names of the stations which serve both ""Ananthapuri Express"" and ""Guruvayur Express"" trains?" +train_station,"SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE T1.station_id NOT IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = ""London"")",Find the names of the trains that do not pass any station located in London. +club_1,"SELECT t3.Lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubName = ""Bootup Baltimore""","Find the last names of the members of the club ""Bootup Baltimore""." +club_1,"SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises""","Who are the members of the club named ""Hopkins Student Enterprises""? Show the last name." +club_1,"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Tennis Club""","How many members does the club ""Tennis Club"" has?" +club_1,"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Pen and Paper Gaming""","Find the number of members of club ""Pen and Paper Gaming""." +club_1,"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Linda"" AND t3.lname = ""Smith""","How many clubs does ""Linda Smith"" belong to?" +club_1,"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Tracy"" AND t3.lname = ""Kim""","Find the number of clubs where ""Tracy Kim"" is a member." +club_1,"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.sex = ""F""","Find all the female members of club ""Bootup Baltimore"". Show the first name and last name." +club_1,"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises"" AND t3.sex = ""M""","Find all the male members of club ""Hopkins Student Enterprises"". Show the first name and last name." +club_1,"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.major = ""600""","Find all members of ""Bootup Baltimore"" whose major is ""600"". Show the first name and last name." +club_1,"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = ""600"" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1","Which club has the most members majoring in ""600""?" +club_1,"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = ""F"" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1",Find the name of the club that has the most female students. +club_1,"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t2.position = ""President""","What are the first and last name of the president of the club ""Bootup Baltimore""?" +club_1,"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises"" AND t2.position = ""CTO""","Who is the ""CTO"" of club ""Hopkins Student Enterprises""? Show the first name and last name." +club_1,"SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = ""Bootup Baltimore""","How many different roles are there in the club ""Bootup Baltimore""?" +club_1,"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.age > 18","How many members of ""Bootup Baltimore"" are older than 18?" +club_1,"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore"" AND t3.age < 18","How many members of club ""Bootup Baltimore"" are younger than 18?" +club_1,"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = ""BAL""","Find the names of all the clubs that have at least a member from the city with city code ""BAL""." +club_1,"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = ""HOU""","Find the names of the clubs that have at least a member from the city with city code ""HOU""." +club_1,"SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Eric"" AND t3.lname = ""Tai""","How many clubs does the student named ""Eric Tai"" belong to?" +club_1,"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = ""Davis"" AND t3.lname = ""Steven""","List the clubs having ""Davis Steven"" as a member." +club_1,SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121,"List the clubs that have at least a member with advisor ""1121""." +club_1,"SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Bootup Baltimore""","What is the average age of the members of the club ""Bootup Baltimore""?" +club_1,"SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = ""Hopkins Student Enterprises""","Find the average age of members of the club ""Hopkins Student Enterprises""." +wedding,SELECT count(*) FROM Church WHERE Open_Date < 1850,How many churches opened before 1850 are there? +wedding,"SELECT name , open_date , organized_by FROM Church","Show the name, open date, and organizer for all churches." +wedding,SELECT name FROM church ORDER BY open_date DESC,List all church names in descending order of opening date. +wedding,SELECT open_date FROM church GROUP BY open_date HAVING count(*) >= 2,Show the opening year in which at least two churches opened. +wedding,"SELECT organized_by , name FROM church WHERE open_date BETWEEN 1830 AND 1840",Show the organizer and name for churches that opened between 1830 and 1840. +wedding,"SELECT open_date , count(*) FROM church GROUP BY open_date",Show all opening years and the number of churches that opened in that year. +wedding,"SELECT name , open_date FROM church ORDER BY open_date DESC LIMIT 3",Show the name and opening year for three churches that opened most recently. +wedding,SELECT count(*) FROM people WHERE is_male = 'F' AND age > 30,How many female people are older than 30 in our record? +wedding,SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30,Show the country where people older than 30 and younger than 25 are from. +wedding,"SELECT min(age) , max(age) , avg(age) FROM people","Show the minimum, maximum, and average age for all people." +wedding,"SELECT name , country FROM people WHERE age < (SELECT avg(age) FROM people)",Show the name and country for all people whose age is smaller than the average. +wedding,"SELECT T2.name , T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014",Show the pair of male and female names in all weddings after year 2014 +wedding,"SELECT name , age FROM people WHERE is_male = 'T' AND people_id NOT IN (SELECT male_id FROM wedding)",Show the name and age for all male people who don't have a wedding. +wedding,SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015,Show all church names except for those that had a wedding in year 2015. +wedding,SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING count(*) >= 2,Show all church names that have hosted least two weddings. +wedding,SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada',Show the names for all females from Canada having a wedding in year 2016. +wedding,SELECT count(*) FROM wedding WHERE YEAR = 2016,How many weddings are there in year 2016? +wedding,SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30,Show the church names for the weddings of all people older than 30. +wedding,"SELECT country , count(*) FROM people GROUP BY country",Show all countries and the number of people from each country. +debate,SELECT Name FROM people WHERE Age = 35 OR Age = 36,Show the names of people aged either 35 or 36. +debate,SELECT Party FROM people ORDER BY Age ASC LIMIT 1,What is the party of the youngest people? +debate,SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1,Show the party that has the most people. +debate,"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 affirmative side." +debate,"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","Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name." +debate,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 that are on affirmative side of debates with number of audience bigger than 200. +debate,"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 and the number of times they have been on the affirmative side of debates. +debate,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,Show the names of people who have been on the negative side of debates at least twice. +flight_company,SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200,What are the distinct types of the companies that have operated any flights with velocity less than 200? +flight_company,"SELECT T1.id , T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING count(*) > 1",What are the ids and names of the companies that operated more than one flight? +flight_company,"SELECT T1.id, T1.name, T1.IATA FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1","What is the id, name and IATA code of the airport that had most number of flights?" +flight_company,SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport',What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'? +flight_company,"SELECT TYPE , count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1","What is the most common company type, and how many are there?" +flight_company,SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' );,How many airports haven't the pilot 'Thompson' driven an aircraft? +flight_company,SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services',List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities. +flight_company,SELECT name FROM airport WHERE name LIKE '%international%',Which of the airport names contains the word 'international'? +flight_company,"SELECT T3.id , count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id",How many companies operates airlines in each airport? +flight_company,SELECT country FROM airport GROUP BY country HAVING count(*) > 2,which countries have more than 2 airports? +election,SELECT count(*) FROM county,How many counties are there in total? +election,"SELECT County_name , Population FROM county",Show the county name and population of all counties. +election,SELECT avg(Population) FROM county,Show the average population of all counties. +election,"SELECT max(Population) , min(Population) FROM county",Return the maximum and minimum population among all counties. +election,SELECT DISTINCT District FROM election,Show all the distinct districts for elections. +election,"SELECT Zip_code FROM county WHERE County_name = ""Howard""","Show the zip code of the county with name ""Howard""." +election,SELECT Delegate FROM election WHERE District = 1,Show the delegate from district 1 in election. +election,"SELECT Delegate , Committee FROM election",Show the delegate and committee information of elections. +election,SELECT count(DISTINCT Governor) FROM party,How many distinct governors are there? +election,"SELECT Lieutenant_Governor , Comptroller FROM party WHERE Party = ""Democratic""",Show the lieutenant governor and comptroller from the democratic party. +election,"SELECT DISTINCT YEAR FROM party WHERE Governor = ""Eliot Spitzer""","In which distinct years was the governor ""Eliot Spitzer""?" +election,SELECT * FROM election,Show all the information about election. +election,"SELECT T2.Delegate , T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District",Show the delegates and the names of county they belong to. +election,SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000,Which delegates are from counties with population smaller than 100000? +election,SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000,How many distinct delegates are from counties with population larger than 50000? +election,"SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = ""Appropriations""","What are the names of the county that the delegates on ""Appropriations"" committee belong to?" +election,"SELECT T1.Delegate , T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID",Show the delegates and the names of the party they belong to. +election,SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1,Who were the governors of the parties associated with delegates from district 1? +election,SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2,Who were the comptrollers of the parties associated with the delegates from district 1 or district 2? +election,"SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = ""Democratic""",Return all the committees that have delegates from Democratic party. +election,"SELECT T1.County_name , COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id",Show the name of each county along with the corresponding number of delegates from that county. +election,"SELECT T2.Party , COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party",Show the name of each party and the corresponding number of delegates from that party. +election,SELECT County_name FROM county ORDER BY Population ASC,Return the names of all counties sorted by population in ascending order. +election,SELECT County_name FROM county ORDER BY County_name DESC,Return the names of all counties sorted by county name in descending alphabetical order. +election,SELECT County_name FROM county ORDER BY Population DESC LIMIT 1,Show the name of the county with the biggest population. +election,SELECT County_name FROM county ORDER BY Population ASC LIMIT 3,Show the 3 counties with the smallest population. +election,SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2,Show the names of counties that have at least two delegates. +election,SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2,Show the name of the party that has at least two records. +election,SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1,Show the name of the party that has the most delegates. +election,SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1,Show the people that have been governor the most times. +election,"SELECT Comptroller , COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1",Show the people that have been comptroller the most times and the corresponding number of times. +election,SELECT Party FROM party WHERE Party_ID NOT IN (SELECT Party FROM election),What are the names of parties that do not have delegates in election? +election,"SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = ""Appropriations"" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = ""Economic Matters""","What are the names of parties that have both delegates on ""Appropriations"" committee and ""Economic Matters"" committee" +loan_1,SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount),List the name of all different customers who have an loan sorted by their total loan amount. +loan_1,"SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%'",Find the name and account balance of the customer whose name includes the letter ‘a’. +loan_1,SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas',Find the total account balance of each customer from Utah or Texas. +loan_1,SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking',Find the name of customers who have both saving and checking account types. +loan_1,SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving',Find the name of customers who do not have a saving account. +loan_1,SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages',Find the name of customers who do not have a loan with a type of Mortgages. +loan_1,SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto',Find the name of customers who have loans of both Mortgages and Auto. +loan_1,SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer),Find the name of customers whose credit score is below the average credit scores of all customers. +loan_1,SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1,Find the branch name of the bank that has the most number of customers. +loan_1,SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1,Find the name of customer who has the lowest credit score. +loan_1,"SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1","Find the name, account type, and account balance of the customer who has the highest credit score." +loan_1,SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1,Find the name of customer who has the highest amount of loans. +loan_1,SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1,Find the state which has the most number of customers. +loan_1,"SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type","For each account type, find the average account balance of customers with credit score lower than 50." +loan_1,"SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state","For each state, find the total account balance of customers whose credit score is above 100." +loan_1,"SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname",Find the total amount of loans offered by each bank branch. +loan_1,SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1,Find the name of customers who have more than one loan. +loan_1,"SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount) > 5000",Find the name and account balance of the customers who have loans with a total amount of more than 5000. +loan_1,SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1,Find the name of bank branch that provided the greatest total amount of loans. +loan_1,SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1,Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100. +loan_1,SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000,Find the the name of the customers who have a loan with amount more than 3000. +loan_1,"SELECT T1.bname, T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business'",Find the city and name of bank branches that provide business loans. +loan_1,SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100,Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. +loan_1,SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York',Find the total amount of loans provided by bank branches in the state of New York. +loan_1,SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan),Find the average credit score of the customers who have some loan. +flight_1,SELECT count(*) FROM Aircraft,How many aircrafts do we have? +flight_1,"SELECT name , distance FROM Aircraft",Show name and distance for all aircrafts. +flight_1,SELECT aid FROM Aircraft WHERE distance > 1000,Show ids for all aircrafts with more than 1000 distance. +flight_1,SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000,How many aircrafts have distance between 1000 and 5000? +flight_1,"SELECT name , distance FROM Aircraft WHERE aid = 12",What is the name and distance for aircraft with id 12? +flight_1,"SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft","What is the minimum, average, and maximum distance of all aircrafts." +flight_1,"SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1",Show the id and name of the aircraft with the maximum distance. +flight_1,SELECT name FROM Aircraft ORDER BY distance LIMIT 3,Show the name of aircrafts with top three lowest distances. +flight_1,SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft),Show names for all aircrafts with distances more than the average. +flight_1,SELECT count(*) FROM Employee,How many employees do we have? +flight_1,"SELECT name , salary FROM Employee ORDER BY salary",Show name and salary for all employees sorted by salary. +flight_1,SELECT eid FROM Employee WHERE salary > 100000,Show ids for all employees with at least 100000 salary. +flight_1,SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000,How many employees have salary between 100000 and 200000? +flight_1,"SELECT name , salary FROM Employee WHERE eid = 242518965",What is the name and salary for employee with id 242518965? +flight_1,"SELECT avg(salary) , max(salary) FROM Employee",What is average and maximum salary of all employees. +flight_1,"SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1",Show the id and name of the employee with maximum salary. +flight_1,SELECT name FROM Employee ORDER BY salary ASC LIMIT 3,Show the name of employees with three lowest salaries. +flight_1,SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee),Show names for all employees with salary more than the average. +flight_1,"SELECT eid , salary FROM Employee WHERE name = 'Mark Young'",Show the id and salary of Mark Young. +flight_1,SELECT count(*) FROM Flight,How many flights do we have? +flight_1,"SELECT flno , origin , destination FROM Flight ORDER BY origin","Show flight number, origin, destination of all flights in the alphabetical order of the departure cities." +flight_1,"SELECT flno FROM Flight WHERE origin = ""Los Angeles""",Show all flight number from Los Angeles. +flight_1,"SELECT origin FROM Flight WHERE destination = ""Honolulu""",Show origins of all flights with destination Honolulu. +flight_1,"SELECT departure_date , arrival_date FROM Flight WHERE origin = ""Los Angeles"" AND destination = ""Honolulu""",Show me the departure date and arrival date for all flights from Los Angeles to Honolulu. +flight_1,SELECT flno FROM Flight WHERE distance > 2000,Show flight number for all flights with more than 2000 distance. +flight_1,"SELECT avg(price) FROM Flight WHERE origin = ""Los Angeles"" AND destination = ""Honolulu""",What is the average price for flights from Los Angeles to Honolulu. +flight_1,"SELECT origin , destination FROM Flight WHERE price > 300",Show origin and destination for flights with price higher than 300. +flight_1,"SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1",Show the flight number and distance of the flight with maximum price. +flight_1,SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3,Show the flight number of flights with three lowest distances. +flight_1,"SELECT avg(distance) , avg(price) FROM Flight WHERE origin = ""Los Angeles""",What is the average distance and average price for flights from Los Angeles. +flight_1,"SELECT origin , count(*) FROM Flight GROUP BY origin",Show all origins and the number of flights from each origin. +flight_1,"SELECT destination , count(*) FROM Flight GROUP BY destination",Show all destinations and the number of flights to each destination. +flight_1,SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1,Which origin has most number of flights? +flight_1,SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1,Which destination has least number of flights? +flight_1,SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99,What is the aircraft name for the flight with number 99 +flight_1,"SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = ""Airbus A340-300""",Show all flight numbers with aircraft Airbus A340-300. +flight_1,"SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid",Show aircraft names and number of flights for each aircraft. +flight_1,SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2,Show names for all aircraft with at least two flights. +flight_1,SELECT count(DISTINCT eid) FROM Certificate,How many employees have certificate. +flight_1,SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate,Show ids for all employees who do not have a certificate. +flight_1,"SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = ""John Williams""",Show names for all aircrafts of which John Williams has certificates. +flight_1,"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = ""Boeing 737-800""",Show names for all employees who have certificate of Boeing 737-800. +flight_1,"SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = ""Boeing 737-800"" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = ""Airbus A340-300""",Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300. +flight_1,"SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = ""Boeing 737-800""",Show names for all employees who do not have certificate of Boeing 737-800. +flight_1,SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) LIMIT 1,Show the name of aircraft which fewest people have its certificate. +flight_1,"SELECT T2.name, T2.distance FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5",Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate. +flight_1,"SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1",what is the salary and name of the employee who has the most number of aircraft certificates? +party_people,SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959,Show the minister who took office after 1961 or before 1959. +party_people,SELECT minister FROM party ORDER BY left_office DESC LIMIT 1,Return the minister who left office at the latest time. +party_people,"SELECT T2.party_name , count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id",Show all party names and the number of members in each party. +party_people,SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY count(*) DESC LIMIT 1,What is the name of party with most number of members? +party_people,SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member),Show names of parties that does not have any members. +party_people,SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1,Show the member names which are in both the party with id 3 and the party with id 1. +party_people,"SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name != ""Progress Party""",Show member names that are not in the Progress Party. +party_people,"SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id",Show party names and the number of events for each party. +party_people,SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id,Show all member names who are not in charge of any event. +party_people,SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING count(*) >= 2,What are the names of parties with at least 2 events? +party_people,SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY count(*) DESC LIMIT 1,What is the name of member in charge of greatest number of events? +party_people,SELECT event_name FROM party_events GROUP BY event_name HAVING count(*) > 2,find the event names that have more than 2 records. +architecture,"SELECT name , nationality , id FROM architect WHERE gender = 'male' ORDER BY name","List the name, nationality and id of all male architects ordered by their names lexicographically." +architecture,SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian',What are the distinct types of mills that are built by American or Canadian architects? +architecture,"SELECT T1.id , T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) >= 3",What are the ids and names of the architects who built at least 3 bridges ? +architecture,"SELECT T1.id , T1.name , T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1","What is the id, name and nationality of the architect who built most mills?" +architecture,"SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 2 UNION SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 1","What are the ids, names and genders of the architects who built two bridges or one mill?" +architecture,SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch' OR name = 'Rainbow Bridge',What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'? +architecture,SELECT name FROM mill WHERE name LIKE '%Moulin%',Which of the mill names contains the french word 'Moulin'? +architecture,SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80,What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters? +architecture,"SELECT TYPE , count(*) FROM mill GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1","What is the most common mill type, and how many are there?" +architecture,SELECT count(*) FROM architect WHERE id NOT IN ( SELECT architect_id FROM mill WHERE built_year < 1850 );,How many architects haven't built a mill before year 1850? +school_player,SELECT LOCATION FROM school ORDER BY Enrollment ASC,List the locations of schools in ascending order of enrollment. +school_player,SELECT LOCATION FROM school ORDER BY Founded DESC;,List the locations of schools in descending order of founded year. +school_player,"SELECT Enrollment FROM school WHERE Denomination != ""Catholic"";","What are the enrollments of schools whose denomination is not ""Catholic""?" +school_player,SELECT avg(Enrollment) FROM school;,What is the average enrollment of schools? +school_player,SELECT Team FROM player ORDER BY Team ASC;,"What are the teams of the players, sorted in ascending alphabetical order?" +school_player,SELECT Team FROM player ORDER BY Age DESC LIMIT 1;,Find the team of the player of the highest age. +school_player,SELECT Team FROM player ORDER BY Age DESC LIMIT 5;,List the teams of the players with the top 5 largest ages. +school_player,"SELECT T1.Team , T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID;","For each player, show the team and the location of school they belong to." +school_player,SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1;,Show the locations of schools that have more than 1 player. +school_player,SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1;,Show the denomination of the school that has the most players. +school_player,"SELECT T1.Location , T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID;",Show locations and nicknames of schools. +school_player,"SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination",Please show different denominations and the corresponding number of schools. +school_player,"SELECT Denomination , COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC",Please show different denominations and the corresponding number of schools in descending order. +school_player,SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1,List the school color of the school that has the largest enrollment. +school_player,SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player),List the locations of schools that do not have any player. +school_player,SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900;,Show the denomination shared by schools founded before 1890 and schools founded after 1900 +school_player,"SELECT Nickname FROM school_details WHERE Division != ""Division 1"";",Show the nicknames of schools that are not in division 1. +store_product,SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*) > 3,Find the list of page size which have more than 3 product listed +store_product,SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000,Find the name all districts with city area greater than 10 or population larger than 100000 +store_product,SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1,Which district has the largest population? +store_product,SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1,Which district has the least area? +store_product,"SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = ""Khanewal District""",Find the names of all stores in Khanewal District. +store_product,SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1),Find all the stores in the district with the most population. +store_product,"SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = ""Blackville""","Which city is the headquarter of the store named ""Blackville"" in?" +store_product,"SELECT t3.headquartered_city , count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city",Find the number of stores in each city. +store_product,SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1,Find the city with the most number of stores. +store_product,"SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = ""Miramichi""","What products are available at store named ""Miramichi""?" +store_product,"SELECT product FROM product WHERE max_page_size = ""A4"" AND pages_per_minute_color < 5","Find products with max page size as ""A4"" and pages per minute color smaller than 5." +store_product,"SELECT product FROM product WHERE max_page_size = ""A4"" OR pages_per_minute_color < 5","Find products with max page size as ""A4"" or pages per minute color smaller than 5." +store_product,"SELECT product FROM product WHERE product LIKE ""%Scanner%""","Find all the product whose name contains the word ""Scanner""." +store_product,SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1,Find the most prominent max page size among all the products. +store_product,SELECT product FROM product WHERE max_page_size != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1),Find the name of the products that are not using the most frequently-used max page size. +store_product,SELECT sum(city_population) FROM district WHERE city_area > (SELECT avg(city_area) FROM district),Find the total population of the districts where the area is bigger than the average city area. +network_2,SELECT count(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan',How many friends does Dan have? +network_2,SELECT name FROM Person WHERE age = (SELECT max(age) FROM person),Who is the oldest person? +network_2,SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' ),Who is the oldest person whose job is student? +network_2,SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' ),Who is the youngest male? +network_2,SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach',How old is the doctor named Zach? +network_2,SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer',How many people whose age is greater 30 and job is engineer? +network_2,"SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job",What is average age of male for different job title? +network_2,"SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender",Find the number of people who is under 40 for each gender. +network_2,SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age,Find the name of people whose age is greater than any engineer sorted by their age. +network_2,SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer'),Find the number of people whose age is greater than all engineers. +network_2,"SELECT name, age FROM Person WHERE gender = 'male' ORDER BY age",Find the name and age of all males in order of their age. +network_2,"SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'",Find the name and age of the person who is a friend of both Dan and Alice. +network_2,"SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'",Find the name and age of the person who is a friend of Dan or Alice. +network_2,SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30),Find the name of the person who has friends with age above 40 and under age 30? +network_2,SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30),Find the name of the person who has friends with age above 40 but not under age 30? +network_2,SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student',Find the name of the person who has no student friends. +network_2,SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1,Find the person who has exactly one friend. +network_2,SELECT friend FROM PersonFriend WHERE name = 'Bob',Who are the friends of Bob? +network_2,SELECT name FROM PersonFriend WHERE friend = 'Bob',Find the name of persons who are friends with Bob. +network_2,SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female',Find the names of females who are friends with Zach +network_2,SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female',Find the female friends of Alice. +network_2,SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor',Find the male friend of Alice whose job is a doctor? +network_2,SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city',Who has a friend that is from new york city? +network_2,SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person),Who has friends that are younger than the average age? +network_2,"SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person)",Who has friends that are older than the average age? Print their friends and their ages as well +network_2,SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach'),Who is the friend of Zach with longest year relationship? +network_2,SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach'),What is the age of the friend of Zach with longest year relationship? +network_2,SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice'),Find the name of persons who are friends with Alice for the shortest years. +network_2,"SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')","Find the name, age, and job title of persons who are friends with Alice for the longest years." +network_2,SELECT name FROM person EXCEPT SELECT name FROM PersonFriend,Who is the person that has no friend? +network_2,"SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1",Which person whose friends have the oldest average age? +network_2,SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin'),What is the total number of people who has no friend living in the city of Austin. +browser_web,"SELECT max(market_share) , min(market_share) , avg(market_share) FROM browser","What is the maximum, minimum and average market share of the listed browsers?" +browser_web,SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998,What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ? +browser_web,"SELECT T1.id , T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING count(*) >= 2",What are the ids and names of the web accelerators that are compatible with two or more browsers? +browser_web,"SELECT T1.id , T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1",What is the id and name of the browser that is compatible with the most web accelerators? +browser_web,SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer',When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible? +browser_web,SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );,How many accelerators are not compatible with the browsers listed ? +browser_web,SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15;,What distinct accelerator names are compatible with the browswers that have market share higher than 15? +browser_web,SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox',List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'. +browser_web,"SELECT name , operating_system FROM web_client_accelerator EXCEPT SELECT T1.name , T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'",Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'. +browser_web,"SELECT name FROM web_client_accelerator WHERE name LIKE ""%Opera%""","Which accelerator name contains substring ""Opera""?" +roller_coaster,SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100,Show the statuses of roller coasters longer than 3300 or higher than 100. +roller_coaster,SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1,What is the speed of the longest roller coaster? +roller_coaster,SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1,Please show the most common status of roller coasters. +roller_coaster,SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2,List the status shared by more than two roller coasters. +roller_coaster,SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1,Show the park of the roller coaster with the highest speed. +roller_coaster,SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1,Show the names of countries that have more than one roller coaster. +roller_coaster,"SELECT T1.Name , T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1",Show the name and population of the country that has the highest roller coaster. +roller_coaster,"SELECT T1.Name , avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name",Show the names of countries and the average speed of roller coasters from each country. +roller_coaster,SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000 ),How many countries do not have an roller coaster longer than 3000? +dorm_1,SELECT count(*) FROM student WHERE sex = 'F' AND age < 25,How many female students (sex is F) whose age is below 25? +dorm_1,SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25,Find the first name of students living in city PHL whose age is between 20 and 25. +dorm_1,"SELECT avg(student_capacity) , sum(student_capacity) FROM dorm WHERE gender = 'X'",Find the average and total capacity of dorms for the students with gender X. +dorm_1,SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity),Find the name of dorms that do not have any amenity. +dorm_1,"SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'",Find the capacity and gender type of the dorm whose name has substring ‘Donor’. +dorm_1,"SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100",Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100. +dorm_1,"SELECT count(DISTINCT major), count(DISTINCT city_code) FROM student",Find the numbers of different majors and cities. +dorm_1,SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room',Find the name of dorms which have both TV Lounge and Study Room as amenities. +dorm_1,SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room',Find the name of dorms which have TV Lounge but no Study Room as amenity. +dorm_1,SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20,Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20. +dorm_1,SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1,Find the name of the dorm with the largest capacity. +dorm_1,SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1,Find the code of city where most of students are living in. +dorm_1,"SELECT fname , lname FROM student WHERE age < (SELECT avg(age) FROM student)",Find the first and last name of students whose age is younger than the average age. +dorm_1,"SELECT fname, lname FROM student WHERE city_code != 'HKG' ORDER BY age","List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages." +dorm_1,SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name,"List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order." +dorm_1,"SELECT count(*) , sum(student_capacity) , gender FROM dorm GROUP BY gender",Find the number of dorms and total capacity for each gender. +dorm_1,"SELECT avg(age) , max(age) , sex FROM student GROUP BY sex",Find the average and oldest age for students with different sex. +dorm_1,"SELECT count(*) , avg(age) , city_code FROM student GROUP BY city_code",Find the number and average age of students living in each city. +dorm_1,"SELECT count(*) , avg(age) , city_code FROM student WHERE sex = 'M' GROUP BY city_code",Find the average age and number of male students (with sex M) from each city. +dorm_1,"SELECT count(*) , city_code FROM student GROUP BY city_code HAVING count(*) > 1",Find the number of students for the cities where have more than one student. +dorm_1,"SELECT fname , lname FROM student WHERE major != (SELECT major FROM student GROUP BY major ORDER BY count(*) DESC LIMIT 1)",Find the first and last name of students who are not in the largest major. +dorm_1,"SELECT count(*) , sex FROM student WHERE age > (SELECT avg(age) FROM student) GROUP BY sex",Find the number of students whose age is older than the average age for each gender. +dorm_1,"SELECT avg(T1.age) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name",Find the average age of students living in each dorm and the name of dorm. +dorm_1,"SELECT count(*) , T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid",Find the number of amenities for each of the dorms that can accommodate more than 100 students. +dorm_1,"SELECT count(*) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name",Find the number of students who is older than 20 in each dorm. +dorm_1,SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall',Find the first name of students who are living in the Smith Hall. +dorm_1,SELECT avg(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT max(student_capacity) FROM dorm),Find the average age of students who are living in the dorm with the largest capacity. +dorm_1,SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M',Find the total number of students living in the male dorm (with gender M). +dorm_1,SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F',Find the number of female students (with F sex) living in Smith Hall +dorm_1,SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall',Find the name of amenities Smith Hall dorm have. +dorm_1,SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name,Find the name of amenities Smith Hall dorm have. ordered the results by amenity names. +dorm_1,SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1,Find the name of amenity that is the most common in all dorms. +dorm_1,SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1),Find the first name of students who are living in the dorm that has most number of amenities. +dorm_1,"SELECT T1.dorm_name , T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1",Find the name and capacity of the dorm with least number of amenities. +dorm_1,SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge',Find the name of dorms that do not have amenity TV Lounge. +dorm_1,"SELECT T1.fname , T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')",Find the first and last name of students who are living in the dorms that have amenity TV Lounge. +dorm_1,"SELECT T1.fname , T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid NOT IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')",Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge. +cre_Doc_Control_Systems,SELECT document_status_code FROM Ref_Document_Status;,What document status codes do we have? +cre_Doc_Control_Systems,"SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = ""working"";",What is the description of document status code 'working'? +cre_Doc_Control_Systems,SELECT document_type_code FROM Ref_Document_Types;,What document type codes do we have? +cre_Doc_Control_Systems,"SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = ""Paper"";",What is the description of document type 'Paper'? +cre_Doc_Control_Systems,SELECT shipping_agent_name FROM Ref_Shipping_Agents;,What are the shipping agent names? +cre_Doc_Control_Systems,"SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = ""UPS"";",What is the shipping agent code of shipping agent UPS? +cre_Doc_Control_Systems,SELECT role_code FROM ROLES;,What are all role codes? +cre_Doc_Control_Systems,"SELECT role_description FROM ROLES WHERE role_code = ""ED"";",What is the description of role code ED? +cre_Doc_Control_Systems,SELECT count(*) FROM Employees;,How many employees do we have? +cre_Doc_Control_Systems,"SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = ""Koby"";",What is the role of the employee named Koby? +cre_Doc_Control_Systems,"SELECT document_id , receipt_date FROM Documents;",List all document ids and receipt dates of documents. +cre_Doc_Control_Systems,"SELECT T1.role_description , T2.role_code , count(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code;","How many employees does each role have? List role description, id and number of employees." +cre_Doc_Control_Systems,"SELECT Roles.role_description , count(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING count(Employees.employee_id) > 1;",List roles that have more than one employee. List the role description and number of employees. +cre_Doc_Control_Systems,SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1;,What is the document status description of the document with id 1? +cre_Doc_Control_Systems,"SELECT count(*) FROM Documents WHERE document_status_code = ""done"";",How many documents have the status code done? +cre_Doc_Control_Systems,SELECT document_type_code FROM Documents WHERE document_id = 2;,List the document type code for the document with the id 2. +cre_Doc_Control_Systems,"SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper"";",List the document ids for any documents with the status code done and the type code paper. +cre_Doc_Control_Systems,SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2;,What is the name of the shipping agent of the document with id 2? +cre_Doc_Control_Systems,"SELECT count(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS"";",How many documents were shipped by USPS? +cre_Doc_Control_Systems,"SELECT Ref_Shipping_Agents.shipping_agent_name , count(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY count(Documents.document_id) DESC LIMIT 1;",Which shipping agent shipped the most documents? List the shipping agent name and the number of documents. +cre_Doc_Control_Systems,SELECT receipt_date FROM Documents WHERE document_id = 3;,What is the receipt date of the document with id 3? +cre_Doc_Control_Systems,SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4;,What address was the document with id 4 mailed to? +cre_Doc_Control_Systems,SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7;,What is the mail date of the document with id 7? +cre_Doc_Control_Systems,"SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper"" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS"";","List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS." +cre_Doc_Control_Systems,"SELECT document_id FROM Documents WHERE document_status_code = ""done"" AND document_type_code = ""Paper"" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = ""USPS"";",List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS. +cre_Doc_Control_Systems,SELECT draft_details FROM Document_Drafts WHERE document_id = 7;,What is draft detail of the document with id 7? +cre_Doc_Control_Systems,SELECT count(*) FROM Draft_Copies WHERE document_id = 2;,How many draft copies does the document with id 2 have? +cre_Doc_Control_Systems,"SELECT document_id , count(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY count(copy_number) DESC LIMIT 1;",Which document has the most draft copies? List its document id and number of draft copies. +cre_Doc_Control_Systems,"SELECT document_id , count(*) FROM Draft_Copies GROUP BY document_id HAVING count(*) > 1;",Which documents have more than 1 draft copies? List document id and number of draft copies. +cre_Doc_Control_Systems,SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1;,List all employees in the circulation history of the document with id 1. List the employee's name. +cre_Doc_Control_Systems,SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id,List the employees who have not showed up in any circulation history of documents. List the employee's name. +cre_Doc_Control_Systems,"SELECT Employees.employee_name , count(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id , Circulation_History.draft_number , Circulation_History.copy_number ORDER BY count(*) DESC LIMIT 1;",Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies. +customers_and_products_contacts,SELECT count(*) FROM addresses WHERE country = 'USA',How many addresses are there in country USA? +customers_and_products_contacts,SELECT DISTINCT city FROM addresses,Show all distinct cities in the address record. +customers_and_products_contacts,"SELECT state_province_county , count(*) FROM addresses GROUP BY state_province_county",Show each state and the number of addresses in each state. +customers_and_products_contacts,"SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM customer_address_history)",Show names and phones of customers who do not have address information. +customers_and_products_contacts,SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1,Show the name of the customer who has the most orders. +customers_and_products_contacts,SELECT product_type_code FROM products GROUP BY product_type_code HAVING count(*) >= 2,Show the product type codes which have at least two products. +customers_and_products_contacts,SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part',Show the names of customers who have both an order in completed status and an order in part status. +customers_and_products_contacts,"SELECT customer_name , customer_phone , payment_method_code FROM customers ORDER BY customer_number DESC","Show the name, phone, and payment method code for all customers in descending order of customer number." +customers_and_products_contacts,"SELECT T1.product_name , sum(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id",Show the product name and total order quantity for each product. +customers_and_products_contacts,"SELECT min(product_price) , max(product_price) , avg(product_price) FROM products","Show the minimum, maximum, average price for all products." +customers_and_products_contacts,SELECT count(*) FROM products WHERE product_price > (SELECT avg(product_price) FROM products),How many products have a price higher than the average? +customers_and_products_contacts,"SELECT T2.customer_name , T3.city , T1.date_from , T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id","Show the customer name, customer address city, date from, and date to for each customer address history." +customers_and_products_contacts,SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING count(*) > 2,Show the names of customers who use Credit Card payment method and have more than 2 orders. +customers_and_products_contacts,"SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY sum(T3.order_quantity) DESC LIMIT 1",What are the name and phone of the customer with the most ordered product quantity? +student_1,SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5,Find the last names of the teachers that teach fifth grade. +student_1,SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1,Find the first names of the teachers that teach first grade. +student_1,"SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""OTHA"" AND T2.lastname = ""MOYER""",Find all students taught by OTHA MOYER. Output the first and last names of the students. +student_1,"SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""MARROTTE"" AND T2.lastname = ""KIRK""",Find all students taught by MARROTTE KIRK. Output first and last names of students. +student_1,"SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""EVELINA"" AND T1.lastname = ""BROMLEY""",Find the first and last name of all the teachers that teach EVELINA BROMLEY. +student_1,"SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""GELL"" AND T1.lastname = ""TAMI""",Find the last names of all the teachers that teach GELL TAMI. +student_1,"SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""LORIA"" AND T2.lastname = ""ONDERSMA""",How many students does LORIA ONDERSMA teaches? +student_1,"SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""KAWA"" AND T2.lastname = ""GORDON""",How many students does KAWA GORDON teaches? +student_1,"SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""TARRING"" AND T2.lastname = ""LEIA""",Find the number of students taught by TARRING LEIA. +student_1,"SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""CHRISSY"" AND T1.lastname = ""NABOZNY""",How many teachers does the student named CHRISSY NABOZNY have? +student_1,"SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = ""MADLOCK"" AND T1.lastname = ""RAY""",How many teachers does the student named MADLOCK RAY have? +student_1,"SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = ""OTHA"" AND T2.lastname = ""MOYER""",Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names. +student_1,"SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname != ""COVIN"" AND T2.lastname != ""JEROME""",Find the last names of the students in third grade that are not taught by COVIN JEROME. +student_1,"SELECT grade , count(DISTINCT classroom) , count(*) FROM list GROUP BY grade","For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade." +student_1,SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1,Which classroom has the most students? +student_1,"SELECT classroom , count(*) FROM list WHERE grade = ""0"" GROUP BY classroom","For each grade 0 classroom, report the total number of students." +student_1,"SELECT classroom , count(*) FROM list WHERE grade = ""4"" GROUP BY classroom",Report the total number of students for each fourth-grade classroom. +voter_2,"SELECT max(Age) , min(Age) FROM STUDENT WHERE Major = 600",What are the maximum and minimum age of students with major 600? +voter_2,"SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = ""Fall""",Find the distinct ages of students who have secretary votes in the fall election cycle. +voter_2,"SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = ""Spring""",Find the distinct Advisor of students who have treasurer votes in the spring election cycle. +voter_2,"SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = ""F""",Find the first and last names of all the female (sex is F) students who have president votes. +voter_2,"SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18",Find the first and last name of all the students of age 18 who have vice president votes. +voter_2,"SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = ""M"" AND T2.Election_Cycle = ""Fall""",How many male (sex is M) students have class senator votes in the fall election cycle? +voter_2,"SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = ""NYC"" AND T2.Election_Cycle = ""Spring""",Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle. +voter_2,"SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = ""NYC"" AND T2.Election_Cycle = ""Spring""","Find the average age of students who live in the city with code ""NYC"" and have secretary votes in the spring election cycle." +voter_2,"SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = ""F"" AND T2.Election_Cycle = ""Spring""",Find the average age of female (sex is F) students who have secretary votes in the spring election cycle. +voter_2,"SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = ""PIT""",Find the distinct first names of all the students who have vice president votes and whose city code is not PIT. +voter_2,"SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = ""2192""",Find the distinct last names of all the students who have president votes and whose advisor is not 2192. +voter_2,"SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = ""8741""",Find the distinct last names of all the students who have president votes and whose advisor is 8741. +voter_2,SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2,Report all advisors that advise more than 2 students. +voter_2,SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3,Report all majors that have less than 3 students. +voter_2,SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1,Which major has the most students? +voter_2,"SELECT Major FROM STUDENT WHERE Sex = ""F"" GROUP BY major ORDER BY count(*) DESC LIMIT 1",What is the most common major among female (sex is F) students? +voter_2,SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY count(*) DESC LIMIT 1,What is the city_code of the city that the most students live in? +movie_1,SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000,What is the name of the movie produced after 2000 and directed by James Cameron? +movie_1,"SELECT rID FROM Reviewer WHERE name LIKE ""%Mike%""",What is the id of the reviewer whose name has substring “Mike”? +movie_1,"SELECT max(stars) , min(stars) FROM Rating",What is the lowest and highest rating star? +movie_1,SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year,"Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year." +movie_1,"SELECT T1.director , T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5",What are the names of directors who directed movies with 5 star rating? Also return the title of these movies. +movie_1,"SELECT T2.name , avg(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name",What is the average rating star for each reviewer? +movie_1,SELECT title FROM Movie WHERE mID NOT IN (SELECT mID FROM Rating),Find the titles of all movies that have no ratings. +movie_1,"SELECT avg(T1.stars) , T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT min(YEAR) FROM Movie)",What is the average rating stars and title for the oldest movie? +movie_1,SELECT title FROM Movie WHERE YEAR = (SELECT max(YEAR) FROM Movie),What is the name of the most recent movie? +movie_1,"SELECT max(T1.stars) , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT max(YEAR) FROM Movie)",What is the maximum stars and year for the most recent movie? +movie_1,"SELECT title FROM Movie WHERE YEAR > (SELECT max(YEAR) FROM Movie WHERE director = ""Steven Spielberg"")",What are the names of movies whose created year is after all movies directed by Steven Spielberg? +movie_1,"SELECT T2.title , T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = ""James Cameron"")",What are the titles and directors of the movies whose star is greater than the average stars of the movies directed by James Cameron? +movie_1,"SELECT T3.name , T2.title , T1.stars , T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name , T2.title , T1.stars","Return reviewer name, movie title, stars, and rating date. And sort the data first by reviewer name, then by movie title, and lastly by number of stars." +movie_1,SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3,Find the names of all reviewers who have contributed three or more ratings. +movie_1,SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind',Find the names of all reviewers who rated Gone with the Wind. +movie_1,SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez',Find the names of all directors whose movies are rated by Sarah Martinez. +movie_1,"SELECT DISTINCT T3.name , T2.title , T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name","For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars." +movie_1,SELECT name FROM Reviewer UNION SELECT title FROM Movie,Return all reviewer names and movie names together in a single list. +movie_1,SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson',Find the titles of all movies not reviewed by Chris Jackson. +movie_1,"SELECT T1.title , T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title ORDER BY T1.director , T1.title","For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title." +movie_1,"SELECT T1.title , T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title","For directors who had more than one movie, return the titles and produced years of all movies directed by them." +movie_1,SELECT director FROM Movie GROUP BY director HAVING count(*) = 1,What are the names of the directors who made exactly one movie? +movie_1,"SELECT director FROM Movie WHERE director != ""null"" GROUP BY director HAVING count(*) = 1",What are the names of the directors who made exactly one movie excluding director NULL? +movie_1,"SELECT count(*) , T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director",How many movie reviews does each director get? +movie_1,"SELECT T2.title , avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY avg(T1.stars) DESC LIMIT 1",Find the movies with the highest average rating. Return the movie titles and average rating. +movie_1,"SELECT T2.title , avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY avg(T1.stars) LIMIT 1",What are the movie titles and average rating of the movies with the lowest average rating? +movie_1,"SELECT T2.title , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3",What are the names and years of the movies that has the top 3 highest rating star? +movie_1,"SELECT T2.title , T2.director , max(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director != ""null"" GROUP BY director","For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL." +movie_1,"SELECT T2.title , T1.rID , T1.stars , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID",Find the title and star rating of the movie that got the least rating star for each reviewer. +movie_1,"SELECT T2.title , T1.stars , T2.director , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director",Find the title and score of the movie with the lowest rating among all movies directed by each director. +movie_1,"SELECT T2.title , T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY count(*) DESC LIMIT 1",What is the name of the movie that is rated by most of times? +movie_1,SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5,What are the titles of all movies that have rating star is between 3 and 5? +movie_1,SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3,Find the names of reviewers who had given higher than 3 stars ratings. +movie_1,"SELECT mID , avg(stars) FROM Rating WHERE mID NOT IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = ""Brittany Harris"") GROUP BY mID",Find the average rating star for each movie that are not reviewed by Brittany Harris. +movie_1,"SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = ""Brittany Harris""",What are the ids of the movies that are not reviewed by Brittany Harris. +movie_1,"SELECT mID , avg(stars) FROM Rating GROUP BY mID HAVING count(*) >= 2",Find the average rating star for each movie that received at least 2 ratings. +movie_1,SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4,find the ids of reviewers who did not give 4 star. +movie_1,SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000,What are names of the movies that are either made after 2000 or reviewed by Brittany Harris? +movie_1,"SELECT title FROM Movie WHERE director = ""James Cameron"" OR YEAR < 1980",What are names of the movies that are either made before 1980 or directed by James Cameron? +movie_1,SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4,What are the names of reviewers who had rated 3 star and 4 star? +epinions_1,"SELECT avg(rating) , max(rating) FROM review",Find the average and maximum rating of all reviews. +epinions_1,SELECT count(*) FROM item WHERE i_id NOT IN (SELECT i_id FROM review),Find the number of items that did not receive any review. +epinions_1,SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating = 10,Find the names of goods that receive a rating of 10. +epinions_1,SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT avg(rating) FROM review),Find the titles of items whose rating is higher than the average review rating of all items. +epinions_1,SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5,Find the titles of items that received any rating below 5. +epinions_1,SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5,Find the titles of items that received both a rating higher than 8 and a rating below 5. +epinions_1,SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING avg(T2.rating) > 5,Find the names of items whose rank is higher than 3 and whose average rating is above 5. +epinions_1,SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg(T2.rating) LIMIT 1,Find the name of the item with the lowest average rating. +epinions_1,SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY count(*) DESC LIMIT 1,Find the name of the user who gives the most reviews. +epinions_1,"SELECT T1.title , T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg(T2.rating) DESC LIMIT 1",Find the name and id of the item with the highest average rating. +epinions_1,"SELECT T1.title , T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg(T2.rank) DESC LIMIT 1",Find the name and id of the good with the highest average rank. +epinions_1,"SELECT T1.name , avg(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id","For each user, return the name and the average rating of reviews given by them." +epinions_1,"SELECT T1.name , count(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id","For each user, find their name and the number of reviews written by them." +epinions_1,SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1,Find the name of the user who gave the highest rating. +epinions_1,SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id ORDER BY avg(trust) DESC LIMIT 1,Find the name of the source user with the highest average trust score. +epinions_1,"SELECT T1.name , avg(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id",Find each target user's name and average trust score. +epinions_1,SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust LIMIT 1,Find the name of the target user with the lowest trust score. +epinions_1,SELECT title FROM item WHERE i_id NOT IN (SELECT i_id FROM review),Find the names of the items that did not receive any review. +epinions_1,SELECT name FROM useracct WHERE u_id NOT IN (SELECT u_id FROM review),Find the names of users who did not leave any review. +customer_complaints,"SELECT town_city FROM customers WHERE customer_type_code = ""Good Credit Rating"" GROUP BY town_city ORDER BY count(*) LIMIT 1","Which city has the least number of customers whose type code is ""Good Credit Rating""?" +customer_complaints,"SELECT t1.product_name , count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name",List the name of all products along with the number of complaints that they have received. +customer_complaints,SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) DESC LIMIT 1,Find the email of the customer who has filed the most complaints. +customer_complaints,SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1,Which products has been complained by the customer who has filed least amount of complaints? +customer_complaints,SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1,What is the phone number of the customer who has filed the most recent complaint? +customer_complaints,"SELECT email_address , phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)",Find the email and phone number of the customers who have never filed a complaint before. +customer_complaints,SELECT phone_number FROM customers UNION SELECT phone_number FROM staff,Find the phone number of all the customers and staff. +customer_complaints,"SELECT product_name , product_category_code FROM products ORDER BY product_price DESC LIMIT 1",Find the name and category of the most expensive product. +customer_complaints,SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints),Find the prices of products which has never received a single complaint. +customer_complaints,SELECT last_name from staff where staff_id in (SELECT staff_id from complaints WHERE product_id in (SELECT product_id FROM products ORDER BY product_price ASC LIMIT 1)),Find the last names of the staff members who processed complaints about the cheapest product. +customer_complaints,SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING count(*) > 3,Which complaint status has more than 3 records on file? +customer_complaints,"SELECT last_name FROM staff WHERE email_address LIKE ""%wrau%""","Find the last name of the staff whose email address contains ""wrau""." +customer_complaints,SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1,How many customers are there in the customer type with the most customers? +customer_complaints,SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1,What is the last name of the staff who has handled the first ever complaint? +customer_complaints,"SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = ""Product Failure"" GROUP BY complaint_status_code",Find the number of complaints with Product Failure type for each complaint status. +customer_complaints,SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5,What are the first names of the top 5 staff who have handled the greatest number of complaints? +restaurant_1,"SELECT ResName , Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1;",Which restaurant has highest rating? List the restaurant name and its rating. +restaurant_1,"SELECT Age FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith"";",What is the age of student Linda Smith? +restaurant_1,"SELECT Sex FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith"";",What is the gender of the student Linda Smith? +restaurant_1,"SELECT city_code FROM Student WHERE Fname = ""Linda"" AND Lname = ""Smith"";",Which city does student Linda Smith live in? +restaurant_1,"SELECT Advisor , count(*) FROM Student GROUP BY Advisor ORDER BY count(Advisor) DESC LIMIT 1;",Which Advisor has most of students? List advisor and the number of students. +restaurant_1,"SELECT Major , count(*) FROM Student GROUP BY Major ORDER BY count(Major) ASC LIMIT 1;",Which major has least number of students? List the major and the number of students. +restaurant_1,"SELECT Major , count(*) FROM Student GROUP BY Major HAVING count(Major) BETWEEN 2 AND 30;",Which major has between 2 and 30 number of students? List major and the number of students. +restaurant_1,"SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major = 600;",Which student's age is older than 18 and is majoring in 600? List each student's first and last name. +restaurant_1,"SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major != 600 AND Sex = 'F';",List all female students older than 18 who are not majoring in 600. List students' first name and last name. +restaurant_1,SELECT count(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich',How many restaurant is the Sandwich type restaurant? +restaurant_1,"SELECT sum(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith"";",How long does student Linda Smith spend on the restaurant in total? +restaurant_1,"SELECT count(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith"" AND Restaurant.ResName = ""Subway"";",How many times has the student Linda Smith visited Subway? +restaurant_1,"SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = ""Linda"" AND Student.Lname = ""Smith"" AND Restaurant.ResName = ""Subway"";",When did Linda Smith visit Subway? +restaurant_1,"SELECT Restaurant.ResName , sum(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY sum(Visits_Restaurant.Spent) ASC LIMIT 1;",At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total. +insurance_and_eClaims,"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""","Find all the policy type codes associated with the customer ""Dayana Robel""" +insurance_and_eClaims,SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1,Which type of policy is most frequently used? Give me the policy type code. +insurance_and_eClaims,SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING count(*) > 2,Find all the policy types that are used by more than 2 customers. +insurance_and_eClaims,"SELECT sum(amount_piad) , avg(amount_piad) FROM claim_headers",Find the total and average amount paid in claim headers. +insurance_and_eClaims,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 LIMIT 1),Find the total amount claimed in the most recently created document. +insurance_and_eClaims,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),What is the name of the customer who has made the largest amount of claim in a single claim? +insurance_and_eClaims,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_piad = (SELECT min(amount_piad) FROM claim_headers),What is the name of the customer who has made the minimum amount of payment in one claim? +insurance_and_eClaims,SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id,Find the names of customers who have no policies associated. +insurance_and_eClaims,SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1,What is the name of the claim processing stage that most of the claims are on? +insurance_and_eClaims,"SELECT customer_details FROM customers WHERE customer_details LIKE ""%Diana%""","Find the names of customers whose name contains ""Diana""." +insurance_and_eClaims,"SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = ""Deputy""",Find the names of the customers who have an deputy policy. +insurance_and_eClaims,"SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = ""Deputy"" OR t1.policy_type_code = ""Uniformed""",Find the names of customers who either have an deputy policy or uniformed policy. +insurance_and_eClaims,SELECT customer_details FROM customers UNION SELECT staff_details FROM staff,Find the names of all the customers and staff members. +insurance_and_eClaims,SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1,Find the name of the customer that has been involved in the most policies. +aircraft,"SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE ""%London%""","What are the total number of Domestic Passengers of airports that contain the word ""London""." +aircraft,"SELECT max(Transit_Passengers), min(Transit_Passengers) FROM airport",What are the maximum and minimum number of transit passengers of all airports. +aircraft,SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC,List names of all pilot aged 30 or younger in descending alphabetical order. +aircraft,"SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Gatwick""","Please show the names of aircrafts associated with airport with name ""London Gatwick""." +aircraft,"SELECT T1.Aircraft , T1.Description FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Total_Passengers > 10000000",Please show the names and descriptions of aircrafts associated with airports that have a total number of passengers bigger than 10000000. +aircraft,"SELECT avg(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = ""Robinson R-22""","What is the average total number of passengers of airports that are associated with aircraft ""Robinson R-22""?" +aircraft,SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1,List the name of the aircraft that has been named winning aircraft the most number of times. +aircraft,"SELECT T1.Aircraft, COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft",List the names of aircrafts and the number of times it won matches. +aircraft,SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*) >= 2,List the names of aircrafts and that won matches at least twice. +aircraft,SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH),List the names of aircrafts and that did not win any match. +aircraft,"SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Heathrow"" INTERSECT SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = ""London Gatwick""","Show the names of aircrafts that are associated with both an airport named ""London Heathrow"" and an airport named ""London Gatwick""" +aircraft,SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1,Show all information on the airport that has the largest number of international passengers. +aircraft,"SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY count(*) DESC LIMIT 1",find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30. +aircraft,"SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1",what is the name and age of the youngest winning pilot? +cre_Docs_and_Epenses,"SELECT account_id , account_details FROM Accounts",Show all account ids and account details. +cre_Docs_and_Epenses,SELECT count(*) FROM Statements,How many statements do we have? +cre_Docs_and_Epenses,"SELECT STATEMENT_ID , statement_details FROM Statements",List all statement ids and statement details. +cre_Docs_and_Epenses,"SELECT T1.statement_id , T2.statement_details , T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id","Show statement id, statement detail, account detail for accounts." +cre_Docs_and_Epenses,"SELECT STATEMENT_ID , count(*) FROM Accounts GROUP BY STATEMENT_ID",Show all statement id and the number of accounts for each statement. +cre_Docs_and_Epenses,"SELECT T1.statement_id , T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY count(*) DESC LIMIT 1",Show the statement id and the statement detail for the statement with most number of accounts. +cre_Docs_and_Epenses,SELECT count(*) FROM Documents,Show the number of documents. +cre_Docs_and_Epenses,"SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'","List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'." +cre_Docs_and_Epenses,"SELECT document_id , document_name FROM Documents",Show the ids and names of all documents. +cre_Docs_and_Epenses,"SELECT document_name , document_id FROM Documents WHERE document_type_code = ""BK""",Find names and ids of all documents with document type code BK. +cre_Docs_and_Epenses,"SELECT count(*) , project_id FROM Documents WHERE document_type_code = ""BK"" GROUP BY project_id",How many documents are with document type code BK for each product id? +cre_Docs_and_Epenses,"SELECT document_name , document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project'",Show the document name and the document date for all documents on project with details 'Graph Database project'. +cre_Docs_and_Epenses,"SELECT project_id , count(*) FROM Documents GROUP BY project_id",Show project ids and the number of documents in each project. +cre_Docs_and_Epenses,SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1,What is the id of the project with least number of documents? +cre_Docs_and_Epenses,SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2,Show the ids for projects with at least 2 documents. +cre_Docs_and_Epenses,"SELECT document_type_code , count(*) FROM Documents GROUP BY document_type_code",List document type codes and the number of documents in each code. +cre_Docs_and_Epenses,SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1,What is the document type code with most number of documents? +cre_Docs_and_Epenses,SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*) < 3,Show the document type code with fewer than 3 documents. +cre_Docs_and_Epenses,"SELECT T1.statement_details , T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project'",Show the statement detail and the corresponding document name for the statement with detail 'Private Project'. +cre_Docs_and_Epenses,"SELECT document_type_code , document_type_name , document_type_description FROM Ref_document_types","Show all document type codes, document type names, document type descriptions." +cre_Docs_and_Epenses,"SELECT document_type_description FROM Ref_document_types WHERE document_type_name = ""Film""",What is the document type description for document type named Film? +cre_Docs_and_Epenses,"SELECT T1.document_type_name , T1.document_type_description , T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code",What is the document type name and the document type description and creation date for all the documents? +cre_Docs_and_Epenses,SELECT count(*) FROM Projects,Show the number of projects. +cre_Docs_and_Epenses,"SELECT project_id , project_details FROM Projects",List ids and details for all projects. +cre_Docs_and_Epenses,"SELECT T1.project_id , T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING count(*) > 2",What is the project id and detail for the project with at least two documents? +cre_Docs_and_Epenses,"SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = ""King Book""","What is the project detail for the project with document ""King Book""?" +cre_Docs_and_Epenses,SELECT count(*) FROM Ref_budget_codes,How many budget types do we have? +cre_Docs_and_Epenses,"SELECT budget_type_code , budget_type_description FROM Ref_budget_codes",List all budget type codes and descriptions. +cre_Docs_and_Epenses,"SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = ""ORG""",What is the description for the budget type with code ORG? +cre_Docs_and_Epenses,SELECT count(*) FROM Documents_with_expenses,How many documents have expenses? +cre_Docs_and_Epenses,SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF',What are the document ids for the budget type code 'SF'? +cre_Docs_and_Epenses,"SELECT T2.budget_type_code , T2.budget_type_description , T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code",Show the budget type code and description and the corresponding document id. +cre_Docs_and_Epenses,"SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = ""Government""",Show ids for all documents with budget types described as 'Government'. +cre_Docs_and_Epenses,"SELECT budget_type_code , count(*) FROM Documents_with_expenses GROUP BY budget_type_code",Show budget type codes and the number of documents in each budget type. +cre_Docs_and_Epenses,SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1,What is the budget type code with most number of documents. +cre_Docs_and_Epenses,SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses,What are the ids of documents which don't have expense budgets? +cre_Docs_and_Epenses,"SELECT document_id FROM Documents WHERE document_type_code = ""CV"" EXCEPT SELECT document_id FROM Documents_with_expenses",Show ids for all documents in type CV without expense budgets. +cre_Docs_and_Epenses,SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%',What are the ids of documents with letter 's' in the name with any expense budgets. +cre_Docs_and_Epenses,SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses ),How many documents do not have any expense? +cre_Docs_and_Epenses,SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF',What are the dates for the documents with both 'GV' type and 'SF' type expenses? +manufactory_1,"SELECT avg(revenue) , max(revenue) , sum(revenue) FROM manufacturers","What are the average, maximum and total revenues of all companies?" +manufactory_1,SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing',Find the number of manufactures that are based in Tokyo or Beijing. +manufactory_1,SELECT founder FROM manufacturers WHERE name LIKE 'S%',Find the founder of the company whose name begins with the letter 'S'. +manufactory_1,SELECT sum(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan',What is the total revenue of all companies whose main office is at Tokyo or Taiwan? +manufactory_1,SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony',Find the name of product that is produced by both companies Creative Labs and Sony. +manufactory_1,"SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1","Find the name, headquarter and founder of the manufacturer that has the highest revenue." +manufactory_1,SELECT name FROM manufacturers WHERE revenue > (SELECT avg(revenue) FROM manufacturers),Find the name of companies whose revenue is greater than the average revenue of all companies. +manufactory_1,SELECT name FROM manufacturers WHERE revenue < (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin'),Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin. +manufactory_1,SELECT sum(revenue) FROM manufacturers WHERE revenue > (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin'),Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin. +manufactory_1,"SELECT avg(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name","Find the average prices of all products from each manufacture, and list each company's name." +manufactory_1,"SELECT count(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter",Find the number of different products that are produced by companies at different headquarter cities. +manufactory_1,SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'),Find number of products which Sony does not make. +manufactory_1,SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive',Find the name of companies that do not make DVD drive. +manufactory_1,"SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name","Find the number of products for each manufacturer, showing the name of each company." +manufactory_1,"SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC , name ASC","Select the name and price of all products with a price larger than or equal to 180, and sort first by price (in descending order), and then by name (in ascending order)." +manufactory_1,"SELECT avg(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name","Select the average price of each manufacturer's products, showing the manufacturer's name." +manufactory_1,"SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150",Select the names of manufacturer whose products have an average price higher than or equal to $150. +manufactory_1,"SELECT name , price FROM Products ORDER BY price ASC LIMIT 1",Select the name and price of the cheapest product. +flight_4,SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina',Find the name of the airports located in Cuba or Argentina. +flight_4,SELECT country FROM airlines WHERE name LIKE 'Orbit%',Find the country of the airlines whose name starts with 'Orbit'. +flight_4,SELECT country FROM airports ORDER BY elevation DESC LIMIT 1,Which country is the airport that has the highest altitude located in? +flight_4,SELECT count(*) FROM airports WHERE name LIKE '%International%',Find the number of airports whose name contain the word 'International'. +flight_4,SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines',Find the number of routes operated by American Airlines. +flight_4,SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada',Find the number of routes whose destination airports are in Canada. +flight_4,"SELECT name , city , country FROM airports ORDER BY elevation LIMIT 1","Find the name, city, and country of the airport that has the lowest altitude." +flight_4,"SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1","Find the name, city, and country of the airport that has the highest latitude." +flight_4,"SELECT T1.name, T1.city FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1",Find the name and city of the airport which is the destination of the most number of routes. +flight_4,SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10,Find the names of the top 10 airlines that operate the most number of routes. +flight_4,"SELECT T1.name, T1.city FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1",Find the name and city of the airport which is the source for the most number of flight routes. +flight_4,SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines',Find the number of different airports which are the destinations of the American Airlines. +flight_4,SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1,Which countries has the most number of airlines? +flight_4,SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1,Which countries has the most number of airlines whose active status is 'Y'? +flight_4,"SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC",List all countries and their number of airlines in the descending order of number of airlines. +flight_4,"SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC",How many airports are there per country? Order the countries by decreasing number of airports. +flight_4,"SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC",How many airports are there per city in the United States? Order the cities by decreasing number of airports. +flight_4,SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3,Return the cities with more than 3 airports in the United States. +flight_4,SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 3),How many cities are there that have more than 3 airports? +flight_4,"SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1",List the cities which have more than one airport and number of airports. +flight_4,SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*),List the cities which have more than 2 airports sorted by the number of airports. +flight_4,"SELECT count(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name",Find the number of routes for each source airport and the airport name. +flight_4,"SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC","Find the number of routes and airport name for each source airport, order the results by decreasing number of routes." +flight_4,SELECT city FROM airports GROUP BY city HAVING count(*) = 2,Find the cities which have exactly two airports. +flight_4,"SELECT T1.country, T1.name, count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name","For each country and airline name, how many routes are there?" +flight_4,SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy',Find the number of routes with destination airports in Italy. +flight_4,SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines',Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'. +flight_4,SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport',Find the number of routes that list John F Kennedy International Airport as a destination. +flight_4,SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States'),Find the number of routes from the United States to Canada. +flight_4,SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States'),Find the id of routes whose source and destination airports are in the United States. +flight_4,SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1,Find the name of airline which runs the most number of routes. +flight_4,SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1,Find the busiest source airport that runs most number of routes in China. +store_1,"SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;",A list of the top 5 countries by number of invoices. List country name and number of invoices. +store_1,"SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;",A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size. +store_1,"SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10;",A list of the top 10 countries by average invoice size. List country name and average invoice size. +store_1,"SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;",Find out 5 customers who most recently purchased something. List customers' first and last name. +store_1,"SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10;",Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders. +store_1,"SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10;",List the top 10 customers by total gross sales. List customers' first and last name and total gross sales. +store_1,"SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;",List the top 5 genres by number of tracks. List genres name and total tracks. +store_1,SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;,List every album whose title starts with A in alphabetical order. +store_1,"SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10;",List the customers first and last name of 10 least expensive invoices. +store_1,"SELECT sum(total) FROM invoices WHERE billing_city = ""Chicago"" AND billing_state = ""IL"";","List total amount of invoice from Chicago, IL." +store_1,"SELECT COUNT(*) FROM invoices WHERE billing_city = ""Chicago"" AND billing_state = ""IL"";","List the number of invoices from Chicago, IL." +store_1,"SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = ""USA"" GROUP BY billing_state;","List the number of invoices from the US, grouped by state." +store_1,"SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = ""USA"" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;",List the state in the US with the most invoices. +store_1,"SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = ""CA"";",List the number of invoices and the invoice total from California. +store_1,"SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = ""Aerosmith"";",List Aerosmith's albums. +store_1,"SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = ""Billy Cobham"";",How many albums does Billy Cobham has? +store_1,"SELECT company FROM customers WHERE first_name = ""Eduardo"" AND last_name = ""Martins"";",Eduardo Martins is a customer at which company? +store_1,"SELECT email , phone FROM customers WHERE first_name = ""Astrid"" AND last_name = ""Gruber"";",What is Astrid Gruber's email and phone number? +store_1,"SELECT country FROM customers WHERE first_name = ""Roberto"" AND last_name = ""Almeida"";",What country does Roberto Almeida live? +store_1,SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%',List the name of albums that are released by artist whose name has 'Led' +store_1,"SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = ""Steve"" AND T1.last_name = ""Johnson"";",How many customers does Steve Johnson support? +store_1,"SELECT title , phone , hire_date FROM employees WHERE first_name = ""Nancy"" AND last_name = ""Edwards"";","What is the title, phone and hire date of Nancy Edwards?" +store_1,"SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = ""Nancy"" AND T1.last_name = ""Edwards"";",find the full name of employees who report to Nancy Edwards? +store_1,"SELECT address FROM employees WHERE first_name = ""Nancy"" AND last_name = ""Edwards"";",What is the address of employee Nancy Edwards? +store_1,"SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1",Find the full name of employee who supported the most number of customers. +store_1,"SELECT phone FROM employees WHERE first_name = ""Nancy"" AND last_name = ""Edwards"";",What is employee Nancy Edwards's phone number? +store_1,"SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;",Who is the youngest employee in the company? List employee's first and last name. +store_1,"SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;",List top 10 employee work longest in the company. List employee's first and last name. +store_1,"SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city",Find the number of employees whose title is IT Staff from each city? +store_1,"SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;","Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee." +store_1,"SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = ""Lucas"" AND T1.last_name = ""Mancini"";",How many orders does Lucas Mancini has? +store_1,"SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = ""Lucas"" AND T1.last_name = ""Mancini"";",What is the total amount of money spent by Lucas Mancini? +store_1,"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = ""Rock"";",What is the name of tracks whose genre is Rock? +store_1,"SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id WHERE T2.name = ""Balls to the Wall"";",What is title of album which track Balls to the Wall belongs to? +store_1,"SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = ""Balls to the Wall"";",List name of all tracks in Balls to the Wall. +store_1,SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10;,List title of albums have the number of tracks greater than 10. +store_1,"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = ""Rock"" AND T3.name = ""MPEG audio file"";",List the name of tracks belongs to genre Rock and whose media type is MPEG audio file. +store_1,"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = ""Rock"" OR T3.name = ""MPEG audio file"";",List the name of tracks belongs to genre Rock or media type is MPEG audio file. +store_1,"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = ""Rock"" OR T1.name = ""Jazz""",List the name of tracks belongs to genre Rock or genre Jazz. +store_1,"SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = ""Movies"";",List the name of all tracks in the playlists of Movies. +store_1,SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100;,List the name of playlist which has number of tracks greater than 100. +store_1,"SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = ""Daan"" AND T4.last_name = ""Peeters"";",List all tracks bought by customer Daan Peeters. +store_1,SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music',Find the name of tracks which are in Movies playlist but not in music playlist. +store_1,SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music',Find the name of tracks which are in both Movies and music playlists. +protein_institute,SELECT name FROM building ORDER BY height_feet DESC LIMIT 1,What is the name of the tallest building? +protein_institute,"SELECT avg(floors) , max(floors) , min(floors) FROM building","What are the average, maximum, and minimum number of floors for all buildings?" +protein_institute,SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building) OR floors > (SELECT avg(floors) FROM building),Show the number of buildings with a height above the average or a number of floors above the average. +protein_institute,SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20,List the names of buildings with at least 200 feet of height and with at least 20 floors. +protein_institute,"SELECT institution , LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'","Show the names and locations of institutions that are founded after 1990 and have the type ""Private""." +protein_institute,"SELECT TYPE , count(*) , sum(enrollment) FROM institution GROUP BY TYPE","Show institution types, along with the number of institutions and total enrollment for each type." +protein_institute,SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1,Show the institution type with the largest number of institutions. +protein_institute,SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000,Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment. +protein_institute,SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution),Show the name of buildings that do not have any institution. +protein_institute,SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003,Show the names of buildings except for those having an institution founded in 2003. +protein_institute,"SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id","For each building, show the name of the building and the number of institutions in it." +protein_institute,"SELECT T1.name , T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING count(*) >= 2",Show the names and heights of buildings with at least two institutions founded after 1880. +protein_institute,"SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id",Show institution names along with the number of proteins for each institution. +protein_institute,SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private',"How many proteins are associated with an institution founded after 1880 or an institution with type ""Private""?" +protein_institute,SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20,How many proteins are associated with an institution in a building with at least 20 floors? +coffee_shop,SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury',Give me the names of members whose address is in Harford or Waterbury. +coffee_shop,"SELECT name , member_id FROM member WHERE Membership_card = 'Black' OR age < 30",Find the ids and names of members who are under age 30 or with black membership card. +coffee_shop,SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*) > 5,Which membership card has more than 5 members? +coffee_shop,SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40,Which address has both members younger than 30 and members older than 40? +coffee_shop,SELECT membership_card FROM member WHERE address = 'Hartford' INTERSECT SELECT membership_card FROM member WHERE address = 'Waterbury',What is the membership card held by both members living in Hartford and ones living in Waterbury address? +coffee_shop,SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card = 'Black',Which address do not have any member with the black membership card? +coffee_shop,"SELECT avg(num_of_staff) , avg(score) FROM shop",What are the average score and average staff number of all shops? +coffee_shop,"SELECT shop_id , address FROM shop WHERE score < (SELECT avg(score) FROM shop)",Find the id and address of the shops whose score is below the average score. +coffee_shop,"SELECT address , num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)",Find the address and staff number of the shops that do not have any happy hour. +coffee_shop,"SELECT t1.address , t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id = t2.shop_id WHERE MONTH = 'May'",What are the id and address of the shops which have a happy hour in May? +coffee_shop,"SELECT shop_id , count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1",which shop has happy hour most frequently? List its id and number of happy hours. +coffee_shop,SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1,Which month has the most happy hours? +customers_campaigns_ecommerce,SELECT count(*) FROM premises,How many premises are there? +customers_campaigns_ecommerce,SELECT DISTINCT premises_type FROM premises,What are all the distinct premise types? +customers_campaigns_ecommerce,"SELECT premises_type , premise_details FROM premises ORDER BY premises_type",Find the types and details for all premises and order by the premise type. +customers_campaigns_ecommerce,"SELECT premises_type , count(*) FROM premises GROUP BY premises_type",Show each premise type and the number of premises in that type. +customers_campaigns_ecommerce,"SELECT product_category , count(*) FROM mailshot_campaigns GROUP BY product_category",Show all distinct product categories along with the number of mailshots in each category. +customers_campaigns_ecommerce,"SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_customers)",Show the name and phone of the customer without any mailshot. +customers_campaigns_ecommerce,"SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response'",Show the name and phone for customers with a mailshot with outcome code 'No Response'. +customers_campaigns_ecommerce,"SELECT outcome_code , count(*) FROM mailshot_customers GROUP BY outcome_code",Show the outcome code of mailshots along with the number of mailshots in each outcome code. +customers_campaigns_ecommerce,SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING count(*) >= 2,Show the names of customers who have at least 2 mailshots with outcome code 'Order'. +customers_campaigns_ecommerce,SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1,Show the names of customers who have the most mailshots. +customers_campaigns_ecommerce,"SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response'",What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome. +customers_campaigns_ecommerce,"SELECT T2.premises_type , T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id",Show the premise type and address type code for all customer addresses. +customers_campaigns_ecommerce,SELECT DISTINCT address_type_code FROM customer_addresses,What are the distinct address type codes for all customer addresses? +customers_campaigns_ecommerce,"SELECT order_shipping_charges , customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'",Show the shipping charge and customer id for customer orders with order status Cancelled or Paid. +local_govt_mdm,SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax',what are the details of the cmi masters that have the cross reference code 'Tax'? +local_govt_mdm,"SELECT T1.cmi_cross_ref_id , T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*) >= 1",What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code. +local_govt_mdm,"SELECT T2.cmi_cross_ref_id , T2.master_customer_id , count(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id","How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the number of business rates." +local_govt_mdm,"SELECT T1.source_system_code , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id","What is the tax source system code related to the benefits and overpayments? List the code and the benefit id, order by benefit id." +local_govt_mdm,"SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details != 'Schmidt , Kertzmann and Lubowitz'","What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?" +local_govt_mdm,SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax',What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'? +local_govt_mdm,"SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb, Becker and Wyman'","What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'?" +local_govt_mdm,SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines,Which cmi cross reference id is not related to any parking taxes? +csu_1,SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939,Which campus was opened between 1935 and 1939? +csu_1,"SELECT campus FROM campuses WHERE LOCATION = ""Northridge"" AND county = ""Los Angeles"" UNION SELECT campus FROM campuses WHERE LOCATION = ""San Francisco"" AND county = ""San Francisco""","Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco." +csu_1,"SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = ""San Jose State University"" AND T2.year = 1996","What is the campus fee of ""San Jose State University"" in year 1996?" +csu_1,"SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = ""San Francisco State University"" AND T2.year = 1996","What is the campus fee of ""San Francisco State University"" in year 1996?" +csu_1,SELECT count(*) FROM csu_fees WHERE campusfee > (SELECT avg(campusfee) FROM csu_fees),Find the count of universities whose campus fee is greater than the average campus fee. +csu_1,"SELECT campus FROM campuses WHERE county = ""Los Angeles"" AND YEAR > 1950",Which university is in Los Angeles county and opened after 1950? +csu_1,SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY sum(degrees) DESC LIMIT 1,Which year has the most degrees conferred? +csu_1,SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1,Which campus has the most degrees conferred in all times? +csu_1,SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1,Which campus has the most faculties in year 2003? +csu_1,"SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus",report the total number of degrees granted between 1998 and 2002 in each campus. +csu_1,"SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = ""Orange"" AND T2.year >= 2000 GROUP BY T1.campus","For each Orange county campus, report the number of degrees granted after 2000." +csu_1,"SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = ""Orange"")",Find the names of the campus which has more faculties in 2002 than every campus in Orange county. +csu_1,SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200,What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956? +csu_1,"SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = ""San Jose State University"" AND t2.year = 2000","How many degrees were conferred in ""San Jose State University"" in 2000?" +csu_1,"SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = ""Long Beach State University""","What is the number of faculty lines in campus ""Long Beach State University"" in 2002?" +csu_1,SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T2.year = 2004,List the campus that have between 600 and 1000 faculty lines in year 2004. +csu_1,SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1,How many faculty lines are there in the university that conferred the most number of degrees in year 2002? +csu_1,"SELECT sum(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = ""San Jose State University""","How many undergraduates are there in ""San Jose State University"" in year 2004?" +csu_1,"SELECT sum(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = ""San Francisco State University""","What is the number of graduates in ""San Francisco State University"" in year 2004?" +csu_1,"SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = ""San Francisco State University"" AND t1.year = 2000","What is the campus fee of ""San Francisco State University"" in year 2000?" +activity_1,SELECT count(*) FROM Faculty,How many faculty do we have? +activity_1,SELECT DISTINCT rank FROM Faculty,What ranks do we have for faculty? +activity_1,SELECT DISTINCT building FROM Faculty,Show all the distinct buildings that have faculty rooms. +activity_1,"SELECT rank , Fname , Lname FROM Faculty","Show the rank, first name, and last name for all the faculty." +activity_1,"SELECT Fname , Lname , phone FROM Faculty WHERE Sex = 'F'","Show the first name, last name, and phone number for all female faculty members." +activity_1,SELECT FacID FROM Faculty WHERE Sex = 'M',Show ids for all the male faculty. +activity_1,"SELECT count(*) FROM Faculty WHERE Sex = 'F' AND Rank = ""Professor""",How many female Professors do we have? +activity_1,"SELECT phone , room , building FROM Faculty WHERE Fname = ""Jerry"" AND Lname = ""Prince""","Show the phone, room, and building for the faculty named Jerry Prince." +activity_1,"SELECT count(*) FROM Faculty WHERE Rank = ""Professor"" AND building = ""NEB""",How many Professors are in building NEB? +activity_1,"SELECT fname , lname FROM Faculty WHERE Rank = ""Instructor""",Show the first name and last name for all the instructors. +activity_1,"SELECT building , count(*) FROM Faculty GROUP BY building",Show all the buildings along with the number of faculty members the buildings have. +activity_1,SELECT building FROM Faculty GROUP BY building ORDER BY count(*) DESC LIMIT 1,Which building has most faculty members? +activity_1,"SELECT building FROM Faculty WHERE rank = ""Professor"" GROUP BY building HAVING count(*) >= 10",Show all the buildings that have at least 10 professors. +activity_1,"SELECT rank , count(*) FROM Faculty GROUP BY rank","For each faculty rank, show the number of faculty members who have it." +activity_1,"SELECT rank , sex , count(*) FROM Faculty GROUP BY rank , sex",Show all the ranks and the number of male and female faculty for each rank. +activity_1,SELECT rank FROM Faculty GROUP BY rank ORDER BY count(*) ASC LIMIT 1,Which rank has the smallest number of faculty members? +activity_1,"SELECT sex , count(*) FROM Faculty WHERE rank = ""AsstProf"" GROUP BY sex",Show the number of male and female assistant professors. +activity_1,"SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = ""Linda"" AND T2.lname = ""Smith""",What are the first name and last name of Linda Smith's advisor? +activity_1,"SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = ""Professor""",Show the ids of students whose advisors are professors. +activity_1,"SELECT T2.fname , T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = ""Michael"" AND T1.lname = ""Goodrich""",Show first name and last name for all the students advised by Michael Goodrich. +activity_1,"SELECT T1.FacID , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID","Show the faculty id of each faculty member, along with the number of students he or she advises." +activity_1,"SELECT T1.rank , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank",Show all the faculty ranks and the number of students advised by each rank. +activity_1,"SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1",What are the first and last name of the faculty who has the most students? +activity_1,SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING count(*) >= 2,Show the ids for all the faculty members who have at least 2 students. +activity_1,SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student,Show ids for the faculty members who don't advise any student. +activity_1,SELECT activity_name FROM Activity,What activities do we have? +activity_1,SELECT count(*) FROM Activity,How many activities do we have? +activity_1,SELECT count(DISTINCT FacID) FROM Faculty_participates_in,How many faculty members participate in an activity? +activity_1,SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in,Show the ids of the faculty who don't participate in any activity. +activity_1,SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student,Show the ids of all the faculty members who participate in an activity and advise a student. +activity_1,"SELECT count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = ""Mark"" AND T1.lname = ""Giuliano""",How many activities does Mark Giuliano participate in? +activity_1,"SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = ""Mark"" AND T1.lname = ""Giuliano""",Show the names of all the activities Mark Giuliano participates in. +activity_1,"SELECT T1.fname , T1.lname , count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID","Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in." +activity_1,"SELECT T1.activity_name , count(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID",Show all the activity names and the number of faculty involved in each activity. +activity_1,"SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1",What is the first and last name of the faculty participating in the most activities? +activity_1,SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1,What is the name of the activity that has the most faculty members involved in? +activity_1,SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in,Show the ids of the students who don't participate in any activity. +activity_1,SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20,Show the ids for all the students who participate in an activity and are under 20. +activity_1,"SELECT T1.fname , T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1",What is the first and last name of the student participating in the most activities? +activity_1,SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1,What is the name of the activity with the most students? +activity_1,SELECT DISTINCT T1.fname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking',Find the first names of the faculty members who are playing Canoeing or Kayaking. +activity_1,SELECT fname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.fname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking',Find the first names of professors who are not playing Canoeing or Kayaking. +activity_1,SELECT T1.fname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.fname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking',Find the first names of the faculty members who participate in Canoeing and Kayaking. +workshop_paper,"SELECT Author FROM submission WHERE College = ""Florida"" OR College = ""Temple""","Show the names of authors from college ""Florida"" or ""Temple""" +workshop_paper,SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1,What is the author of the submission with the highest score? +workshop_paper,SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1,Show the most common college of authors of submissions. +workshop_paper,SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80,Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80. +workshop_paper,SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1,Show the result of the submission with the highest score. +workshop_paper,"SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author",Show each author and the number of workshops they submitted to. +workshop_paper,SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1,Show the authors who have submissions to more than one workshop. +race_track,"SELECT name , seating FROM track WHERE year_opened > 2000 ORDER BY seating","Show names and seatings, ordered by seating for all tracks opened after 2000." +race_track,"SELECT name , LOCATION , seating FROM track ORDER BY year_opened DESC LIMIT 1","What is the name, location and seating for the most recently opened track?" +race_track,"SELECT min(seating) , max(seating) , avg(seating) FROM track","What is the minimum, maximum, and average seating for all tracks." +race_track,"SELECT name , LOCATION , year_opened FROM track WHERE seating > (SELECT avg(seating) FROM track)","Show the name, location, open year for all tracks with a seating higher than the average." +race_track,SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1,What is the race class with most number of races. +race_track,SELECT CLASS FROM race GROUP BY CLASS HAVING count(*) >= 2,List the race class with at least two races. +race_track,SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT',What are the names for tracks without a race in class 'GT'. +race_track,SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race),Show all track names that have had no races. +race_track,"SELECT T2.name , count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id",Show the name of track and the number of races in each track. +race_track,SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1,Show the name of track with most number of races. +race_track,"SELECT T2.name , T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING count(*) = 1",Show the name and location of track with 1 race. +apartment_rentals,SELECT count(*) FROM Apartment_Bookings,How many apartment bookings are there in total? +apartment_rentals,"SELECT booking_start_date , booking_end_date FROM Apartment_Bookings",Show the start dates and end dates of all the apartment bookings. +apartment_rentals,SELECT DISTINCT building_description FROM Apartment_Buildings,Show all distinct building descriptions. +apartment_rentals,"SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = ""Emma""","Show the short names of the buildings managed by ""Emma""." +apartment_rentals,"SELECT building_address , building_phone FROM Apartment_Buildings WHERE building_manager = ""Brenden""","Show the addresses and phones of all the buildings managed by ""Brenden""." +apartment_rentals,"SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE ""%court%""","What are the building full names that contain the word ""court""?" +apartment_rentals,"SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments",What is the minimum and maximum number of bathrooms of all the apartments? +apartment_rentals,SELECT avg(bedroom_count) FROM Apartments,What is the average number of bedrooms of all apartments? +apartment_rentals,"SELECT apt_number , room_count FROM Apartments",Return the apartment number and the number of rooms for each apartment. +apartment_rentals,"SELECT avg(room_count) FROM Apartments WHERE apt_type_code = ""Studio""","What is the average number of rooms of apartments with type code ""Studio""?" +apartment_rentals,"SELECT apt_number FROM Apartments WHERE apt_type_code = ""Flat""","Return the apartment numbers of the apartments with type code ""Flat""." +apartment_rentals,"SELECT guest_first_name , guest_last_name FROM Guests",Return the first names and last names of all guests +apartment_rentals,"SELECT date_of_birth FROM Guests WHERE gender_code = ""Male""","Return the date of birth for all the guests with gender code ""Male""." +apartment_rentals,"SELECT T2.apt_number , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id","Show the apartment numbers, start dates, and end dates of all the apartment bookings." +apartment_rentals,"SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = ""Duplex""","What are the booking start and end dates of the apartments with type code ""Duplex""?" +apartment_rentals,"SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2",What are the booking start and end dates of the apartments with more than 2 bedrooms? +apartment_rentals,"SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_number = ""Suite 634""","What is the booking status code of the apartment with apartment number ""Suite 634""?" +apartment_rentals,"SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = ""Confirmed""","Show the distinct apartment numbers of the apartments that have bookings with status code ""Confirmed""." +apartment_rentals,"SELECT avg(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = ""Provisional""","Show the average room count of the apartments that have booking status code ""Provisional""." +apartment_rentals,"SELECT T2.guest_first_name , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id","Show the guest first names, start dates, and end dates of all the apartment bookings." +apartment_rentals,"SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = ""Female""","Show the start dates and end dates of all the apartment bookings made by guests with gender code ""Female""." +apartment_rentals,"SELECT T2.guest_first_name , T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = ""Confirmed""","Show the first names and last names of all the guests that have apartment bookings with status code ""Confirmed""." +apartment_rentals,SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4,Show the facility codes of apartments with more than 4 bedrooms. +apartment_rentals,"SELECT sum(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = ""Gym""","Show the total number of rooms of all apartments with facility code ""Gym""." +apartment_rentals,"SELECT sum(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = ""Columbus Square""","Show the total number of rooms of the apartments in the building with short name ""Columbus Square""." +apartment_rentals,SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2,Show the addresses of the buildings that have apartments with more than 2 bathrooms. +apartment_rentals,"SELECT T2.apt_type_code , T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = ""Kyle""","Show the apartment type codes and apartment numbers in the buildings managed by ""Kyle""." +apartment_rentals,"SELECT booking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code",Show the booking status code and the corresponding number of bookings. +apartment_rentals,SELECT apt_number FROM Apartments ORDER BY room_count ASC,Return all the apartment numbers sorted by the room count in ascending order. +apartment_rentals,SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1,Return the apartment number with the largest number of bedrooms. +apartment_rentals,"SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC",Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order. +apartment_rentals,SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3,Show the top 3 apartment type codes sorted by the average number of rooms in descending order. +apartment_rentals,"SELECT apt_type_code , bathroom_count , bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1","Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms." +apartment_rentals,SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1,Show the most common apartment type code. +apartment_rentals,SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1,Show the most common apartment type code among apartments with more than 1 bathroom. +apartment_rentals,"SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code","Show each apartment type code, and the maximum and minimum number of rooms for each type." +apartment_rentals,"SELECT gender_code , COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC",Show each gender code and the corresponding count of guests sorted by the count in descending order. +apartment_rentals,SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities),How many apartments do not have any facility? +apartment_rentals,"SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = ""Confirmed"" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = ""Provisional""","Show the apartment numbers of apartments with bookings that have status code both ""Provisional"" and ""Confirmed""" +match_season,"SELECT Official_native_language FROM country WHERE Official_native_language LIKE ""%English%""","Show all official native languages that contain the word ""English""." +match_season,"SELECT DISTINCT POSITION FROM match_season WHERE College = ""UCLA"" OR College = ""Duke""",Show the distinct position of players from college UCLA or Duke. +match_season,"SELECT T2.Player FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Country_name = ""Indonesia""",Which players are from Indonesia? +match_season,"SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T1.Capital = ""Dublin""",What are the distinct positions of the players from a country whose capital is Dublin? +match_season,"SELECT T1.Official_native_language FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.College = ""Maryland"" OR T2.College = ""Duke""",What are the official languages of the countries of players from Maryland or Duke college? +match_season,"SELECT count(DISTINCT T1.Official_native_language) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = ""Defender""",How many distinct official languages are there among countries of players whose positions are defenders. +match_season,"SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = ""Ryley Goldner""","Show the positions of the players from the team with name ""Ryley Goldner""." +match_season,"SELECT count(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = ""Columbus Crew""","How many distinct colleges are associated with players from the team with name ""Columbus Crew""." +match_season,"SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = ""Columbus Crew""","Show the players and years played for players from team ""Columbus Crew""." +match_season,"SELECT Country_name , COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name",Show the country names and the corresponding number of players. +match_season,SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1,Show the most common position of players in match seasons. +match_season,SELECT College FROM match_season GROUP BY College ORDER BY count(*) DESC LIMIT 3,Show the top 3 most common colleges of players in match seasons. +match_season,SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2,Show the name of colleges that have at least two players. +match_season,SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC,Show the name of colleges that have at least two players in descending alphabetical order. +match_season,SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season),What are the names of teams that do no have match season record? +match_season,"SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = ""Forward"" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = ""Defender""",What are the names of countries that have both players with position forward and players with position defender? +music_1,"SELECT song_name , releasedate FROM song ORDER BY releasedate DESC LIMIT 1",What is the name of the song that was released in the most recent year? +music_1,SELECT f_id FROM files ORDER BY duration DESC LIMIT 1,What is the id of the longest song? +music_1,"SELECT DISTINCT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9",List the name and country of origin for all singers who have produced songs with rating above 9. +music_1,"SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800",List the file size and format for all songs that have resolution lower than 800. +music_1,SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1,What is the name of the artist who produced the shortest song? +music_1,"SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3",What are the names and countries of origin for the artists who produced the top three highly rated songs. +music_1,"SELECT count(*) FROM files WHERE duration LIKE ""4:%""",How many songs have 4 minute duration? +music_1,"SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = ""Female""",What is the average rating of songs produced by female artists? +music_1,SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1,What is the most popular file format? +music_1,"SELECT artist_name FROM artist WHERE country = ""UK"" INTERSECT SELECT artist_name FROM song WHERE languages = ""english""",Find the names of the artists who are from UK and have produced English songs. +music_1,"SELECT f_id FROM files WHERE formats = ""mp4"" INTERSECT SELECT f_id FROM song WHERE resolution < 1000",Find the id of songs that are available in mp4 format and have resolution lower than 1000. +music_1,"SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = ""Female"" AND T2.languages = ""bangla""",What is the country of origin of the artist who is female and produced a song in Bangla? +music_1,"SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = ""mp3"" AND T2.resolution < 800",What is the average duration of songs that have mp3 format and resolution below 800? +music_1,"SELECT T1.gender , T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1",Return the gender and name of artist who produced the song with the lowest resolution. +music_1,"SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT min(resolution) FROM song WHERE languages = ""english"")",Find the distinct names of all songs that have a higher resolution than some songs in English. +music_1,"SELECT song_name FROM song WHERE rating < (SELECT max(rating) FROM song WHERE genre_is = ""blues"")",What are the names of all songs that have a lower rating than some song of blues genre? +music_1,"SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE ""%love%""","What is the name and country of origin of the artist who released a song that has ""love"" in its title?" +music_1,"SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE ""%Mar%""",List the name and gender for all artists who released songs in March. +music_1,"SELECT f_id FROM files WHERE formats = ""mp4"" UNION SELECT f_id FROM song WHERE resolution > 720",What are the ids of songs that are available in either mp4 format or have resolution above 720? +music_1,"SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE ""4:%"" UNION SELECT song_name FROM song WHERE languages = ""english""",List the names of all songs that have 4 minute duration or are in English. +music_1,SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1,What is the language used most often in the songs? +music_1,SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1,What is the language that was used most often in songs with resolution above 500? +music_1,"SELECT artist_name FROM artist WHERE country = ""UK"" AND gender = ""Male""",What are the names of artists who are Male and are from UK? +music_1,"SELECT song_name FROM song WHERE genre_is = ""modern"" OR languages = ""english""",Find the names of songs whose genre is modern or language is English. +music_1,"SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = ""mp3"" INTERSECT SELECT song_name FROM song WHERE resolution < 1000",Return the names of songs for which format is mp3 and resolution is below 1000. +music_1,"SELECT artist_name FROM artist WHERE country = ""UK"" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""english""",Return the names of singers who are from UK and released an English song. +music_1,"SELECT avg(rating) , avg(resolution) FROM song WHERE languages = ""bangla""",What are the average rating and resolution of songs that are in Bangla? +music_1,"SELECT max(T2.resolution) , min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE ""3:%""",What are the maximum and minimum resolution of songs whose duration is 3 minutes? +music_1,"SELECT max(T1.duration) , max(T2.resolution) , T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages",What are the maximum duration and resolution of songs grouped and ordered by languages? +music_1,"SELECT min(T1.duration) , min(T2.rating) , T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is",What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre? +music_1,"SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""english"" GROUP BY T2.artist_name HAVING count(*) >= 1",Find the names and number of works of all artists who have at least one English songs. +music_1,"SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING count(*) >= 1",Find the name and country of origin for all artists who have release at least one song of resolution above 900. +music_1,"SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3",Find the names and number of works of the three artists who have produced the most songs. +music_1,SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1,Find the country of origin for the artist who made the least number of songs? +music_1,SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english'),What are the names of the songs whose rating is below the rating of all songs in English? +music_1,SELECT f_id FROM song WHERE resolution > (SELECT max(resolution) FROM song WHERE rating < 8),What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8? +music_1,"SELECT f_id FROM song WHERE resolution > (SELECT avg(resolution) FROM song WHERE genre_is = ""modern"")",What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre? +music_1,"SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = ""bangla"" GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3",Find the top 3 artists who have the largest number of songs works whose language is Bangla. +music_1,"SELECT f_id , genre_is , artist_name FROM song WHERE languages = ""english"" ORDER BY rating","List the id, genre and artist name of English songs ordered by rating." +music_1,"SELECT T1.duration , T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = ""pop"" ORDER BY T2.song_name","List the duration, file size and format of songs whose genre is pop, ordered by title?" +music_1,"SELECT DISTINCT artist_name FROM song WHERE languages = ""english"" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8",Find the names of the artists who have produced English songs but have never received rating higher than 8. +machine_repair,SELECT Name FROM technician WHERE Age = 36 OR Age = 37,Show the name of technicians aged either 36 or 37 +machine_repair,SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1,What is the starting year of the oldest technicians? +machine_repair,SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1,Please show the team that has the most number of technicians. +machine_repair,SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2,Show the team that have at least two technicians. +machine_repair,"SELECT T3.Name , T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID",Show names of technicians and series of machines they are assigned to repair. +machine_repair,SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank,Show names of technicians in ascending order of quality rank of the machine they are assigned. +machine_repair,SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70,Show names of technicians who are assigned to repair machines with value point more than 70. +machine_repair,"SELECT T2.Name , COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name",Show names of technicians and the number of machines they are assigned to repair. +machine_repair,SELECT Name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment),List the names of technicians who have not been assigned to repair machines. +tracking_grants_for_research,SELECT T1.grant_amount FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id WHERE T2.sent_date < '1986-08-26 20:49:27' INTERSECT SELECT grant_amount FROM grants WHERE grant_end_date > '1989-03-16 18:27:16';,What are the distinct grant amount for the grants where the documents were sent before '1986-08-26 20:49:27' and grant were ended after '1989-03-16 18:27:16'? +tracking_grants_for_research,SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent',List the project details of the project both producing patent and paper as outcomes. +tracking_grants_for_research,SELECT sum(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research';,What is the total grant amount of the organisations described as research? +tracking_grants_for_research,"SELECT date_from , date_to FROM Project_Staff WHERE project_id IN( SELECT project_id FROM Project_Staff GROUP BY project_id ORDER BY count(*) DESC LIMIT 1 ) UNION SELECT date_from , date_to FROM Project_Staff WHERE role_code = 'leader';",List from which date and to which date these staff work: project staff of the project which hires the most staffs +tracking_grants_for_research,"SELECT T2.organisation_id , T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_id HAVING sum(T1.grant_amount) > 6000;",Find the organisation ids and details of the organisations which are involved in more than 6000 grant amount. +tracking_grants_for_research,"SELECT T1.organisation_type , T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1;",What is the organisation type and id of the organisation which has the most number of research staff? +tracking_grants_for_research,SELECT T1.organisation_type FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY count(*) DESC LIMIT 1;,Which organisation type hires most research staff? +tracking_grants_for_research,SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research',Find out the send dates of the documents with the grant amount of more than 5000 which were granted by organisation type described research. +tracking_grants_for_research,SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100,What are the response received dates for the documents described as 'Regular' or granted with more than 100? +tracking_grants_for_research,SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_Staff WHERE role_code = 'researcher' ),List the project details of the projects which did not hire any staff for a researcher role. +tracking_grants_for_research,"SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING count(*) > 2","What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?" +tracking_grants_for_research,SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%';,List the project details of the projects with the research outcome described with the substring 'Published'. +tracking_grants_for_research,"SELECT T1.project_id , count(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY count(*) ASC;",How many staff does each project has? List the project id and the number in an ascending order. +tracking_grants_for_research,SELECT date_from FROM Project_Staff ORDER BY date_from ASC LIMIT 1;,When did the first staff for the projects started working? +tracking_grants_for_research,"SELECT T1.project_details , T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY count(*) DESC LIMIT 1;",Which project made the most number of outcomes? List the project details and the project id. +tracking_grants_for_research,SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_outcomes );,Which projects have no outcome? List the project details. +tracking_grants_for_research,"SELECT T1.organisation_id , T1.organisation_type , T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1;","Which organisation hired the most number of research staff? List the organisation id, type and detail." +tracking_grants_for_research,"SELECT T1.role_description , T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY count(*) DESC LIMIT 1;",Show the role description and the id of the project staff involved in most number of project outcomes? +tracking_grants_for_research,SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%';,Which document type is described with the prefix 'Initial'? +tracking_grants_for_research,SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application',"For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date." +tracking_grants_for_research,"SELECT grant_id , count(*) FROM Documents GROUP BY grant_id ORDER BY count(*) DESC LIMIT 1;",How many documents can one grant have at most? List the grant id and number. +tracking_grants_for_research,SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo';,Find the organisation type description of the organisation detailed as 'quo'. +tracking_grants_for_research,SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details ASC;,What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order. +tracking_grants_for_research,SELECT count(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54';,How many project staff worked as leaders or started working before '1989-04-24 23:51:54'? +tracking_grants_for_research,SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1;,What is the last date of the staff leaving the projects? +tracking_grants_for_research,SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint';,What are the result description of the project whose detail is 'sint'? +tracking_grants_for_research,"SELECT T1.organisation_id , count(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1;","List the organisation id with the maximum outcome count, and the count." +tracking_grants_for_research,SELECT project_details FROM Projects WHERE organisation_id IN ( SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY count(*) DESC LIMIT 1 );,List the project details of the projects launched by the organisation with the most number of projects. +tracking_grants_for_research,"SELECT count(*) , T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id;",How many tasks does each project have? List the task count and the project detail. +tracking_grants_for_research,SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18',What are the staff roles of the staff who starts working after 2003-04-19 15:06:20 and ends working before 2016-03-15 00:33:18? +icfp_1,"SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Jeremy"" AND t1.lname = ""Gibbons""","What are the titles of papers published by ""Jeremy Gibbons""?" +icfp_1,"SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Aaron"" AND t1.lname = ""Turon""","Find all the papers published by ""Aaron Turon""." +icfp_1,"SELECT count(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Atsushi"" AND t1.lname = ""Ohori""","How many papers have ""Atsushi Ohori"" published?" +icfp_1,"SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = ""Matthias"" AND t1.lname = ""Blume""","What is the name of the institution that ""Matthias Blume"" belongs to?" +icfp_1,"SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = ""Katsuhiro"" AND t1.lname = ""Ueno""","Which institution does ""Katsuhiro Ueno"" belong to?" +icfp_1,"SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""University of Oxford""","Who belong to the institution ""University of Oxford""? Show the first names and last names." +icfp_1,"SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Google""","Which authors belong to the institution ""Google""? Show the first names and last names." +icfp_1,"SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = ""Binders Unbound""","What are the last names of the author of the paper titled ""Binders Unbound""?" +icfp_1,"SELECT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = ""Nameless , Painless""","Find the first and last name of the author(s) who wrote the paper ""Nameless, Painless""." +icfp_1,"SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Indiana University""","What are the papers published under the institution ""Indiana University""?" +icfp_1,"SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Google""","Find all the papers published by the institution ""Google""." +icfp_1,"SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""Tokohu University""","How many papers are published by the institution ""Tokohu University""?" +icfp_1,"SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = ""University of Pennsylvania""","Find the number of papers published by the institution ""University of Pennsylvania""." +icfp_1,"SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Olin"" AND t1.lname = ""Shivers""","Find the papers which have ""Olin Shivers"" as an author." +icfp_1,"SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = ""Stephanie"" AND t1.lname = ""Weirich""","Which papers have ""Stephanie Weirich"" as an author?" +icfp_1,"SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = ""USA"" AND t2.authorder = 2 AND t1.lname = ""Turon""","Which paper is published in an institution in ""USA"" and have ""Turon"" as its second author?" +icfp_1,"SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = ""Japan"" AND t2.authorder = 1 AND t1.lname = ""Ohori""","Find the titles of papers whose first author is affiliated with an institution in the country ""Japan"" and has last name ""Ohori""?" +icfp_1,"SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname , t1.lname ORDER BY count(*) DESC LIMIT 1",What is the last name of the author that has published the most papers? +icfp_1,SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY count(*) DESC LIMIT 1,Retrieve the country that has published the most papers. +icfp_1,SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY count(*) DESC LIMIT 1,Find the name of the organization that has published the largest number of papers. +icfp_1,"SELECT title FROM papers WHERE title LIKE ""%ML%""","Find the titles of the papers that contain the word ""ML""." +icfp_1,"SELECT title FROM papers WHERE title LIKE ""%Database%""","Which paper's title contains the word ""Database""?" +icfp_1,"SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE ""%Functional%""","Find the first names of all the authors who have written a paper with title containing the word ""Functional""." +icfp_1,"SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE ""%Monadic%""","Find the last names of all the authors that have written a paper with title containing the word ""Monadic""." +customers_card_transactions,"SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = ""162""","What is the first name, last name, and phone of the customer with account name 162?" +customers_card_transactions,"SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = ""Art"" AND T2.customer_last_name = ""Turcotte""",How many accounts does the customer with first name Art and last name Turcotte have? +customers_card_transactions,"SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1",Show the customer id and number of accounts with most accounts. +customers_card_transactions,"SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1","What is the customer first, last name and id with least number of accounts." +customers_card_transactions,SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts),Show the number of all customers without an account. +customers_card_transactions,"SELECT customer_first_name , customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name , T1.customer_last_name FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id",Show the first names and last names of customers without any account. +customers_card_transactions,"SELECT customer_phone , customer_email FROM Customers WHERE customer_first_name = ""Aniyah"" AND customer_last_name = ""Feest""",What is the phone and email for customer with first name Aniyah and last name Feest? +customers_card_transactions,"SELECT T2.customer_first_name , T2.customer_last_name , T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.card_number = ""4560596484842""","What is the first name, last name, and phone of the customer with card 4560596484842." +customers_card_transactions,"SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = ""Art"" AND T2.customer_last_name = ""Turcotte""",How many cards does customer Art Turcotte have? +local_govt_in_alabama,SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage',what are the event details of the services that have the type code 'Marriage'? +local_govt_in_alabama,"SELECT T1.event_id , T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING count(*) > 1",What are the ids and details of events that have more than one participants? +local_govt_in_alabama,"SELECT T1.Participant_ID , T1.Participant_Type_Code , count(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID","How many events have each participants attended? List the participant id, type and the number." +local_govt_in_alabama,"SELECT Participant_ID , Participant_Type_Code , Participant_Details FROM Participants","What are all the the participant ids, type code and details?" +local_govt_in_alabama,SELECT count(*) FROM participants WHERE participant_type_code = 'Organizer',How many participants belong to the type 'Organizer'? +local_govt_in_alabama,SELECT service_type_code FROM services ORDER BY service_type_code,List the type of the services in alphabetical order. +local_govt_in_alabama,"SELECT service_id , event_details FROM EVENTS",List the service id and details for the events. +local_govt_in_alabama,SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%',How many events had participants whose details had the substring 'Dr.' +local_govt_in_alabama,SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1,What is the most common participant type? +local_govt_in_alabama,"SELECT T3.service_id , T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY count(*) ASC LIMIT 1",Which service id and type has the least number of participants? +local_govt_in_alabama,SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY count(*) DESC LIMIT 1,What is the id of the event with the most participants? +local_govt_in_alabama,SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn',Which events id does not have any participant with detail 'Kenyatta Kuhn'? +local_govt_in_alabama,SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail',Which services type had both successful and failure event details? +local_govt_in_alabama,SELECT count(*) FROM EVENTS WHERE event_id NOT IN (SELECT event_id FROM Participants_in_Events),How many events did not have any participants? +body_builder,SELECT count(*) FROM body_builder,How many body builders are there? +body_builder,SELECT Total FROM body_builder ORDER BY Total ASC,List the total scores of body builders in ascending order. +body_builder,"SELECT Snatch , Clean_Jerk FROM body_builder ORDER BY Snatch ASC",List the snatch score and clean jerk score of body builders in ascending order of snatch score. +body_builder,SELECT avg(Snatch) FROM body_builder,What is the average snatch score of body builders? +body_builder,SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1,What are the clean and jerk score of the body builder with the highest total score? +body_builder,SELECT Birth_Date FROM People ORDER BY Height ASC,What are the birthdays of people in ascending order of height? +body_builder,SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID,What are the names of body builders? +body_builder,SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300,What are the names of body builders whose total score is higher than 300? +body_builder,SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1,What is the name of the body builder with the greatest body weight? +body_builder,"SELECT T2.Birth_Date , T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1",What are the birth date and birth place of the body builder with the highest total points? +body_builder,SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315,What are the heights of body builders with total score smaller than 315? +body_builder,SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200,What is the average total score of body builders with height bigger than 200? +body_builder,SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC,What are the names of body builders in descending order of total scores? +body_builder,"SELECT Birth_Place, COUNT(*) FROM people GROUP BY Birth_Place",List each birth place along with the number of people from there. +body_builder,SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1,What is the most common birth place of people? +body_builder,SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2,What are the birth places that are shared by at least two people? +body_builder,"SELECT Height , Weight FROM people ORDER BY Height DESC",List the height and weight of people in descending order of height. +body_builder,SELECT * FROM body_builder,Show all information about each body builder. +body_builder,"SELECT Name , birth_place FROM people EXCEPT SELECT T1.Name , T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id",List the names and origins of people who are not body builders. +body_builder,SELECT count(DISTINCT Birth_Place) FROM people,How many distinct birth places are there? +body_builder,SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder),How many persons are not body builders? +body_builder,SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200;,List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. +body_builder,"SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE ""%January%"";","What are the total scores of the body builders whose birthday contains the string ""January"" ?" +pilot_record,SELECT count(*) FROM pilot,How many pilots are there? +pilot_record,SELECT Pilot_name FROM pilot ORDER BY Rank ASC,List the names of pilots in ascending order of rank. +pilot_record,"SELECT POSITION , Team FROM pilot",What are the positions and teams of pilots? +pilot_record,SELECT DISTINCT POSITION FROM pilot WHERE Age > 30,List the distinct positions of pilots older than 30. +pilot_record,"SELECT Pilot_name FROM pilot WHERE Team = ""Bradley"" OR Team = ""Fordham""","Show the names of pilots from team ""Bradley"" or ""Fordham""." +pilot_record,SELECT Join_Year FROM pilot ORDER BY Rank ASC LIMIT 1,What is the joined year of the pilot of the highest rank? +pilot_record,"SELECT Nationality , COUNT(*) FROM pilot GROUP BY Nationality",What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality. +pilot_record,SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1,Show the most common nationality of pilots. +pilot_record,SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005,Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000. +pilot_record,"SELECT T3.Pilot_name , T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID",Show the names of pilots and models of aircrafts they have flied with. +pilot_record,"SELECT T3.Pilot_name , T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank",Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot. +pilot_record,SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34,Show the fleet series of the aircrafts flied by pilots younger than 34 +pilot_record,"SELECT T2.Pilot_name , COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name",Show the names of pilots and the number of records they have. +pilot_record,"SELECT T2.Pilot_name , COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1",Show names of pilots that have more than one record. +bike_1,"SELECT start_station_name , end_station_name FROM trip ORDER BY id LIMIT 3",Give me the start station and end station for the trips with the three oldest ids. +bike_1,"SELECT avg(lat) , avg(long) FROM station WHERE city = ""San Jose""",What is the average latitude and longitude of stations located in San Jose city? +bike_1,SELECT id FROM trip ORDER BY duration LIMIT 1,What is the id of the trip that has the shortest duration? +bike_1,"SELECT sum(duration) , max(duration) FROM trip WHERE bike_id = 636",What is the total and maximum duration of trips with bike id 636? +bike_1,"SELECT zip_code , avg(mean_temperature_f) FROM weather WHERE date LIKE ""8/%"" GROUP BY zip_code","For each zip code, return the average mean temperature of August there." +bike_1,SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7,Return the unique name for stations that have ever had 7 bikes available. +bike_1,"SELECT start_station_name , start_station_id FROM trip WHERE start_date LIKE ""8/%"" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1",Which start station had the most trips starting from August? Give me the name and id of the station. +bike_1,SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id ORDER BY COUNT(*) DESC LIMIT 1,Which bike traveled the most often in zip code 94002? +bike_1,SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8,How many days had both mean humidity above 50 and mean visibility above 8? +bike_1,"SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration LIMIT 1","What is the latitude, longitude, city of the station from which the shortest trip started?" +bike_1,"SELECT id FROM station WHERE city = ""San Francisco"" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available) > 10",What are the ids of stations that are located in San Francisco and have average bike availability above 10. +bike_1,"SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available) > 14 UNION SELECT name , id FROM station WHERE installation_date LIKE ""12/%""",What are the names and ids of stations that had more than 14 bikes available on average or were installed in December? +bike_1,SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3,What is the 3 most common cloud cover rates in the region of zip code 94107? +bike_1,SELECT zip_code FROM weather GROUP BY zip_code ORDER BY avg(mean_sea_level_pressure_inches) LIMIT 1,What is the zip code in which the average mean sea level pressure is the lowest? +bike_1,"SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city = ""Palo Alto"")",What is the average bike availability in stations that are not located in Palo Alto? +bike_1,SELECT avg(long) FROM station WHERE id NOT IN (SELECT station_id FROM status GROUP BY station_id HAVING max(bikes_available) > 10),What is the average longitude of stations that never had bike availability more than 10? +bike_1,SELECT T1.id FROM trip AS T1 JOIN weather AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.zip_code HAVING avg(T2.mean_temperature_f) > 60,Give me ids for all the trip that took place in a zip code area with average mean temperature above 60. +bike_1,"SELECT zip_code , count(*) FROM weather WHERE max_wind_Speed_mph >= 25 GROUP BY zip_code","For each zip code, return how many times max wind speed reached 25?" +bike_1,"SELECT date , zip_code FROM weather WHERE min_dew_point_f < (SELECT min(min_dew_point_f) FROM weather WHERE zip_code = 94107)",On which day and in which zip code was the min dew point lower than any day in zip code 94107? +bike_1,SELECT T1.id FROM trip AS T1 JOIN station AS T2 ON T1.start_station_id = T2.id ORDER BY T2.dock_count DESC LIMIT 1,Which trip started from the station with the largest dock count? Give me the trip id. +bike_1,"SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city != ""San Francisco""",Count the number of trips that did not end in San Francisco city. +bike_1,"SELECT date FROM weather WHERE zip_code = 94107 AND EVENTS != ""Fog"" AND EVENTS != ""Rain""","In zip code 94107, on which day neither Fog nor Rain was observed?" +bike_1,SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available) < 7,What are the ids of stations that have latitude above 37.4 and never had bike availability below 7? +bike_1,"SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = ""San Jose""",What are names of stations that have average bike availability above 10 and are not located in San Jose city? +bike_1,"SELECT name , lat , city FROM station ORDER BY lat LIMIT 1","What are the name, latitude, and city of the station with the lowest latitude?" +bike_1,"SELECT date , mean_temperature_f , mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3","What are the date, mean temperature and mean humidity for the top 3 days with the largest max gust speeds?" +bike_1,"SELECT city , COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15",List the name and the number of stations for all the cities that have at least 15 stations. +bike_1,"SELECT start_station_id , start_station_name FROM trip GROUP BY start_station_id HAVING COUNT(*) >= 200",Find the ids and names of stations from which at least 200 trips started. +bike_1,SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles) < 10,Find the zip code in which the average mean visibility is lower than 10. +bike_1,SELECT city FROM station GROUP BY city ORDER BY max(lat) DESC,List all the cities in a decreasing order of each city's stations' highest latitude. +bike_1,"SELECT date , cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5",What are the dates that had the top 5 cloud cover rates? Also tell me the cloud cover rate. +bike_1,"SELECT id , duration FROM trip ORDER BY duration DESC LIMIT 3",What are the ids and durations of the trips with the top 3 durations? +bike_1,"SELECT T1.name , T1.long , avg(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id","For each station, return its longitude and the average duration of trips that started from the station." +bike_1,"SELECT T1.name , T1.lat , min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.end_station_id GROUP BY T2.end_station_id","For each station, find its latitude and the minimum duration of trips that ended at the station." +bike_1,SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70,Find all the zip codes in which the max dew point have never reached 70. +bike_1,SELECT id FROM trip WHERE duration >= (SELECT avg(duration) FROM trip WHERE zip_code = 94103),Find the id for the trips that lasted at least as long as the average duration of trips in zip code 94103. +bike_1,"SELECT date , max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f LIMIT 1",Find the day in which the difference between the max temperature and min temperature was the smallest. Also report the difference. +bike_1,"SELECT DISTINCT T1.id , T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12",What are the id and name of the stations that have ever had more than 12 bikes available? +bike_1,SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_humidity) < 70 INTERSECT SELECT zip_code FROM trip GROUP BY zip_code HAVING count(*) >= 100,Give me the zip code where the average mean humidity is below 70 and at least 100 trips took place. +bike_1,"SELECT name FROM station WHERE city = ""Palo Alto"" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*) > 100",What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times? +bike_1,"SELECT count(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = ""Mountain View"" AND T3.city = ""Palo Alto""",How many trips started from Mountain View city and ended at Palo Alto city? +riding_club,SELECT count(*) FROM player,How many players are there? +riding_club,SELECT Player_name FROM player ORDER BY Votes ASC,List the names of players in ascending order of votes. +riding_club,"SELECT Gender , Occupation FROM player",What are the gender and occupation of players? +riding_club,"SELECT Player_name , residence FROM player WHERE Occupation != ""Researcher""","List the name and residence for players whose occupation is not ""Researcher""." +riding_club,"SELECT Sponsor_name FROM player WHERE Residence = ""Brandon"" OR Residence = ""Birtle""","Show the names of sponsors of players whose residence is either ""Brandon"" or ""Birtle""." +riding_club,SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1,What is the name of the player with the largest number of votes? +riding_club,"SELECT Occupation , COUNT(*) FROM player GROUP BY Occupation",Show different occupations along with the number of players in each occupation. +riding_club,SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1,Please show the most common occupation of players. +riding_club,SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2,Show the residences that have at least two players. +riding_club,"SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID",Show the names of players and names of their coaches. +riding_club,SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1,Show the names of players coached by the rank 1 coach. +riding_club,"SELECT T3.Player_name , T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011",Show the names and genders of players with a coach starting after 2011. +riding_club,"SELECT T3.Player_name , T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC",Show the names of players and names of their coaches in descending order of the votes of players. +riding_club,SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM player_coach),List the names of players that do not have coaches. +riding_club,"SELECT Residence FROM player WHERE gender = ""M"" INTERSECT SELECT Residence FROM player WHERE gender = ""F""","Show the residences that have both a player of gender ""M"" and a player of gender ""F""." +riding_club,"SELECT T1.club_id , T1.club_name, count(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id","How many coaches does each club has? List the club id, name and the number of coaches." +railway,SELECT count(*) FROM railway,How many railways are there? +railway,SELECT Builder FROM railway ORDER BY Builder ASC,List the builders of railways in ascending alphabetical order. +railway,"SELECT Wheels , LOCATION FROM railway",List the wheels and locations of the railways. +railway,"SELECT max(LEVEL) FROM manager WHERE Country != ""Australia ""","What is the maximum level of managers in countries that are not ""Australia""?" +railway,SELECT avg(Age) FROM manager,What is the average age for all managers? +railway,SELECT Name FROM manager ORDER BY LEVEL ASC,What are the names of managers in ascending order of level? +railway,"SELECT Name , Arrival FROM train",What are the names and arrival times of trains? +railway,SELECT Name FROM manager ORDER BY Age DESC LIMIT 1,What is the name of the oldest manager? +railway,"SELECT T2.Name , T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID",Show the names of trains and locations of railways they are in. +railway,"SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = ""Andaman Exp""","Show the builder of railways associated with the trains named ""Andaman Exp""." +railway,"SELECT T2.Railway_ID , T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1",Show id and location of railways that are associated with more than one train. +railway,"SELECT T2.Railway_ID , T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1",Show the id and builder of the railway that are associated with the most trains. +railway,"SELECT Builder , COUNT(*) FROM railway GROUP BY Builder","Show different builders of railways, along with the corresponding number of railways using each builder." +railway,SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1,Show the most common builder of railways. +railway,"SELECT LOCATION , COUNT(*) FROM railway GROUP BY LOCATION",Show different locations of railways along with the corresponding number of railways at each location. +railway,SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1,Show the locations that have more than one railways. +railway,SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train),List the object number of railways that do not have any trains. +railway,SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46,Show the countries that have both managers of age above 50 and managers of age below 46. +railway,SELECT DISTINCT Country FROM manager,Show the distinct countries of managers. +railway,SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC,Show the working years of managers in descending order of their level. +climbing,SELECT count(*) FROM climber,How many climbers are there? +climbing,SELECT Name FROM climber ORDER BY Points DESC,List the names of climbers in descending order of points. +climbing,"SELECT Name FROM climber WHERE Country != ""Switzerland""",List the names of climbers whose country is not Switzerland. +climbing,"SELECT max(Points) FROM climber WHERE Country = ""United Kingdom""",What is the maximum point for climbers whose country is United Kingdom? +climbing,SELECT COUNT(DISTINCT Country) FROM climber,How many distinct countries are the climbers from? +climbing,SELECT Name FROM mountain ORDER BY Name ASC,What are the names of mountains in ascending alphabetical order? +climbing,SELECT Country FROM mountain WHERE Height > 5000,What are the countries of mountains with height bigger than 5000? +climbing,SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1,What is the name of the highest mountain? +climbing,SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3,List the distinct ranges of the mountains with the top 3 prominence. +climbing,"SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID",Show names of climbers and the names of mountains they climb. +climbing,"SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID",Show the names of climbers and the heights of mountains they climb. +climbing,SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1,Show the height of the mountain climbed by the climber with the maximum points. +climbing,"SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T1.Country = ""West Germany""","Show the distinct names of mountains climbed by climbers from country ""West Germany""." +climbing,"SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = ""Uganda""",Show the times used by climbers to climb mountains in Country Uganda. +climbing,"SELECT Country , COUNT(*) FROM climber GROUP BY Country",Please show the countries and the number of climbers from each country. +climbing,SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*) > 1,List the countries that have more than one mountain. +climbing,SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber),List the names of mountains that do not have any climber. +climbing,SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200,Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. +climbing,SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1,Show the range that has the most number of mountains. +device,SELECT count(*) FROM device,How many devices are there? +device,SELECT Carrier FROM device ORDER BY Carrier ASC,List the carriers of devices in ascending alphabetical order. +device,SELECT Carrier FROM device WHERE Software_Platform != 'Android',"What are the carriers of devices whose software platforms are not ""Android""?" +device,SELECT Shop_Name FROM shop ORDER BY Open_Year ASC,What are the names of shops in ascending order of open year? +device,SELECT avg(Quantity) FROM stock,What is the average quantity of stocks? +device,"SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC",What are the names and location of the shops in ascending alphabetical order of name. +device,SELECT count(DISTINCT Software_Platform) FROM device,How many different software platforms are there for devices? +device,"SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = ""Apple""","List the open date of open year of the shop named ""Apple""." +device,SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1,List the name of the shop with the latest open year. +device,"SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID",Show names of shops and the carriers of devices they have in stock. +device,SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1,Show names of shops that have more than one kind of device in stock. +device,SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1,Show the name of the shop that has the most kind of devices in stock. +device,SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1,Show the name of the shop that have the largest quantity of devices in stock. +device,"SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform",Please show different software platforms and the corresponding number of devices using each. +device,SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC,Please show the software platforms of devices in descending order of the count. +device,SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1,List the software platform shared by the greatest number of devices. +device,SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock),List the names of shops that have no devices in stock. +device,SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008,Show the locations shared by shops with open year later than 2012 and shops with open year before 2008. +device,SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock),List the carriers of devices that have no devices in stock. +musical,SELECT count(*) FROM actor,How many actors are there? +musical,SELECT Name FROM actor ORDER BY Name ASC,List the name of actors in ascending alphabetical order. +musical,"SELECT Character , Duration FROM actor",What are the characters and duration of actors? +musical,SELECT Name FROM actor WHERE Age != 20,List the name of actors whose age is not 20. +musical,SELECT Character FROM actor ORDER BY age DESC,What are the characters of actors in descending order of age? +musical,SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1,What is the duration of the oldest actor? +musical,"SELECT Name FROM musical WHERE Nominee = ""Bob Fosse""","What are the names of musicals with nominee ""Bob Fosse""?" +musical,"SELECT DISTINCT Nominee FROM musical WHERE Award != ""Tony Award""","What are the distinct nominees of the musicals with the award that is not ""Tony Award""?" +musical,"SELECT T1.Name , T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID",Show names of actors and names of musicals they are in. +musical,"SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID WHERE T2.Name = ""The Phantom of the Opera""","Show names of actors that have appeared in musical with name ""The Phantom of the Opera""." +musical,SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID ORDER BY T2.Year DESC,Show names of actors in descending order of the year their musical is awarded. +musical,"SELECT T2.Name , COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID",Show names of musicals and the number of actors who have appeared in the musicals. +musical,SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3,Show names of musicals which have at least three actors. +musical,"SELECT Nominee , COUNT(*) FROM musical GROUP BY Nominee",Show different nominees and the number of musicals they have been nominated. +musical,SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1,Please show the nominee who has been nominated the greatest number of times. +musical,SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1,List the most common result of the musicals. +musical,SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2,List the nominees that have been nominated more than two musicals. +musical,SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor),List the name of musicals that do not have actors. +musical,"SELECT Nominee FROM musical WHERE Award = ""Tony Award"" INTERSECT SELECT Nominee FROM musical WHERE Award = ""Drama Desk Award""","Show the nominees that have nominated musicals for both ""Tony Award"" and ""Drama Desk Award""."