cnatale/presto-athena-txt-2-sql huggingface dataset:
What are the names of the states that have 2 to 4 employees living there?
Additional table information: table: driving_school
SQL: 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 first name and last name of all customers.
Additional table information: table: driving_school
SQL: SELECT first_name, last_name FROM Customers
What are the first and last names for all customers?
Additional table information: table: driving_school
SQL: SELECT first_name, last_name FROM Customers
List email address and birthday of customer whose first name as Carole.
Additional table information: table: driving_school
SQL: SELECT email_address, date_of_birth FROM Customers WHERE first_name = 'Carole'
What are the email addresses and date of births for all customers who have a first name of Carole?
Additional table information: table: driving_school
SQL: SELECT email_address, date_of_birth FROM Customers WHERE first_name = 'Carole'
List phone number and email address of customer with more than 2000 outstanding balance.
Additional table information: table: driving_school
SQL: SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000
What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000?
Additional table information: table: driving_school
SQL: SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000
What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?
Additional table information: table: driving_school
SQL: 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, phone number, and email address of the customer whose last name is Kohler or whose first name is Marina?
Additional table information: table: driving_school
SQL: SELECT customer_status_code, cell_mobile_phone_number, email_address FROM Customers WHERE first_name = 'Marina' OR last_name = 'Kohler'
When are the birthdays of customer who are classified as 'Good Customer' status?
Additional table information: table: driving_school
SQL: SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'
What is the date of birth of every customer whose status code is 'Good Customer'?
Additional table information: table: driving_school
SQL: SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'
When did customer with first name as Carole and last name as Bernhard became a customer?
Additional table information: table: driving_school
SQL: SELECT date_became_customer FROM Customers WHERE first_name = 'Carole' AND last_name = 'Bernhard'
When did Carole Bernhard first become a customer?
Additional table information: table: driving_school
SQL: SELECT date_became_customer FROM Customers WHERE first_name = 'Carole' AND last_name = 'Bernhard'
How many customers in total?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Customers
How many customers are there?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Customers
List all customer status codes and the number of customers having each status code.
Additional table information: table: driving_school
SQL: SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
For each customer status code, how many customers are classified that way?
Additional table information: table: driving_school
SQL: SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
Which customer status code has least number of customers?
Additional table information: table: driving_school
SQL: SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
What is the status code with the least number of customers?
Additional table information: table: driving_school
SQL: SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?
Additional table information: table: driving_school
SQL: 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 did the customer Ryan Goodwin complete?
Additional table information: table: driving_school
SQL: 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'
What is maximum, minimum and average amount of outstanding of customer?
Additional table information: table: driving_school
SQL: SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers
What is the maximum, minimum, and average amount of money outsanding for all customers?
Additional table information: table: driving_school
SQL: SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers
List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
Additional table information: table: driving_school
SQL: SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000
What are the first and last names of all customers with between 1000 and 3000 dollars outstanding?
Additional table information: table: driving_school
SQL: SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000
List first name and last name of customers lived in city Lockmanfurt.
Additional table information: table: driving_school
SQL: 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'
What are the first and last names of all customers who lived in Lockmanfurt?
Additional table information: table: driving_school
SQL: 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'
Which country does customer with first name as Carole and last name as Bernhard lived in?
Additional table information: table: driving_school
SQL: 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'
What is the country in which the customer Carole Bernhard lived?
Additional table information: table: driving_school
SQL: 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'
What is zip code of customer with first name as Carole and last name as Bernhard?
Additional table information: table: driving_school
SQL: 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 the zip code of the customer Carole Bernhard?
Additional table information: table: driving_school
SQL: 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'
Which city does has most number of customers?
Additional table information: table: driving_school
SQL: 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
What is the city with the most customers?
Additional table information: table: driving_school
SQL: 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
How much in total does customer with first name as Carole and last name as Bernhard paid?
Additional table information: table: driving_school
SQL: 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'
What is the total amount of moeny paid by the customer Carole Bernhard?
Additional table information: table: driving_school
SQL: 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'
List the number of customers that did not have any payment history.
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)
How many customers have no payment histories?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)
List first name and last name of customers that have more than 2 payments.
Additional table information: table: driving_school
SQL: 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
What are the first and last names of all customers with more than 2 payments?
Additional table information: table: driving_school
SQL: 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 all payment methods and number of payments using each payment methods.
Additional table information: table: driving_school
SQL: SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code
For each payment method, how many payments were made?
Additional table information: table: driving_school
SQL: SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code
How many lessons were in cancelled state?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = 'Cancelled'
How many lessons have been cancelled?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = 'Cancelled'
List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'.
Additional table information: table: driving_school
SQL: 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%'
What are the the lesson ids of all staff taught by Janessa Sawayn whose nickname has the letter s?
Additional table information: table: driving_school
SQL: 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%'
How many lessons taught by staff whose first name has letter 'a' in it?
Additional table information: table: driving_school
SQL: 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 were taught by a staff member whose first name has the letter 'a' in it?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE '%a%'
How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?
Additional table information: table: driving_school
SQL: 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'
What is the total time for all lessons taught by Janessa Sawayn?
Additional table information: table: driving_school
SQL: 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'
What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?
Additional table information: table: driving_school
SQL: 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 the average price for a lesson taught by Janessa Sawayn?
Additional table information: table: driving_school
SQL: 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'
How many lesson does customer with first name Ray took?
Additional table information: table: driving_school
SQL: 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 the customer with the first name Ray take?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Ray'
Which last names are both used by customers and by staff?
Additional table information: table: driving_school
SQL: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff
What are the last names that are used by customers and staff?
Additional table information: table: driving_school
SQL: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff
What is the first name of the staff who did not give any lesson?
Additional table information: table: driving_school
SQL: 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 is the first name of all employees who do not give any lessons?
Additional table information: table: driving_school
SQL: 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 is the id and detail of the vehicle used in lessons for most of the times?
Additional table information: table: driving_school
SQL: 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
How many faculty do we have?
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Faculty
What is the total number of faculty members?
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Faculty
What ranks do we have for faculty?
Additional table information: table: activity_1
SQL: SELECT DISTINCT rank FROM Faculty
Find the list of distinct ranks for faculty.
Additional table information: table: activity_1
SQL: SELECT DISTINCT rank FROM Faculty
Show all the distinct buildings that have faculty rooms.
Additional table information: table: activity_1
SQL: SELECT DISTINCT building FROM Faculty
What buildings have faculty offices?
Additional table information: table: activity_1
SQL: SELECT DISTINCT building FROM Faculty
Show the rank, first name, and last name for all the faculty.
Additional table information: table: activity_1
SQL: SELECT rank, Fname, Lname FROM Faculty
What are the rank, first name, and last name of the faculty members?
Additional table information: table: activity_1
SQL: SELECT rank, Fname, Lname FROM Faculty
Show the first name, last name, and phone number for all female faculty members.
Additional table information: table: activity_1
SQL: SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F'
What are the first name, last name, and phone number of all the female faculty members?
Additional table information: table: activity_1
SQL: SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F'
Show ids for all the male faculty.
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty WHERE Sex = 'M'
What are the faculty ids of all the male faculty members?
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty WHERE Sex = 'M'
How many female Professors do we have?
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = 'Professor'
Count the number of female Professors we have.
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = 'Professor'
Show the phone, room, and building for the faculty named Jerry Prince.
Additional table information: table: activity_1
SQL: SELECT phone, room, building FROM Faculty WHERE Fname = 'Jerry' AND Lname = 'Prince'
What are the phone, room, and building of the faculty member called Jerry Prince?
Additional table information: table: activity_1
SQL: SELECT phone, room, building FROM Faculty WHERE Fname = 'Jerry' AND Lname = 'Prince'
How many Professors are in building NEB?
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Faculty WHERE Rank = 'Professor' AND building = 'NEB'
Count the number of Professors who have office in building NEB.
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Faculty WHERE Rank = 'Professor' AND building = 'NEB'
Show the first name and last name for all the instructors.
Additional table information: table: activity_1
SQL: SELECT fname, lname FROM Faculty WHERE Rank = 'Instructor'
What are the first name and last name of all the instructors?
Additional table information: table: activity_1
SQL: SELECT fname, lname FROM Faculty WHERE Rank = 'Instructor'
Show all the buildings along with the number of faculty members the buildings have.
Additional table information: table: activity_1
SQL: SELECT building, COUNT(*) FROM Faculty GROUP BY building
How many faculty members does each building have? List the result with the name of the building.
Additional table information: table: activity_1
SQL: SELECT building, COUNT(*) FROM Faculty GROUP BY building
Which building has most faculty members?
Additional table information: table: activity_1
SQL: SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1
Find the building that has the largest number of faculty members.
Additional table information: table: activity_1
SQL: SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1
Show all the buildings that have at least 10 professors.
Additional table information: table: activity_1
SQL: SELECT building FROM Faculty WHERE rank = 'Professor' GROUP BY building HAVING COUNT(*) >= 10
In which buildings are there at least ten professors?
Additional table information: table: activity_1
SQL: SELECT building FROM Faculty WHERE rank = 'Professor' GROUP BY building HAVING COUNT(*) >= 10
For each faculty rank, show the number of faculty members who have it.
Additional table information: table: activity_1
SQL: SELECT rank, COUNT(*) FROM Faculty GROUP BY rank
How many faculty members do we have for each faculty rank?
Additional table information: table: activity_1
SQL: SELECT rank, COUNT(*) FROM Faculty GROUP BY rank
Show all the ranks and the number of male and female faculty for each rank.
Additional table information: table: activity_1
SQL: SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex
How many faculty members do we have for each rank and gender?
Additional table information: table: activity_1
SQL: SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex
Which rank has the smallest number of faculty members?
Additional table information: table: activity_1
SQL: SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
Find the faculty rank that has the least members.
Additional table information: table: activity_1
SQL: SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
Show the number of male and female assistant professors.
Additional table information: table: activity_1
SQL: SELECT sex, COUNT(*) FROM Faculty WHERE rank = 'AsstProf' GROUP BY sex
How many male and female assistant professors do we have?
Additional table information: table: activity_1
SQL: SELECT sex, COUNT(*) FROM Faculty WHERE rank = 'AsstProf' GROUP BY sex
What are the first name and last name of Linda Smith's advisor?
Additional table information: table: activity_1
SQL: 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'
Who is the advisor of Linda Smith? Give me the first name and last name.
Additional table information: table: activity_1
SQL: 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'
Show the ids of students whose advisors are professors.
Additional table information: table: activity_1
SQL: SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = 'Professor'
Which students have professors as their advisors? Find their student ids.
Additional table information: table: activity_1
SQL: SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = 'Professor'
Show first name and last name for all the students advised by Michael Goodrich.
Additional table information: table: activity_1
SQL: 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'
Which students are advised by Michael Goodrich? Give me their first and last names.
Additional table information: table: activity_1
SQL: 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 the faculty id of each faculty member, along with the number of students he or she advises.
Additional table information: table: activity_1
SQL: SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID
What are the faculty id and the number of students each faculty has?
Additional table information: table: activity_1
SQL: SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID
Show all the faculty ranks and the number of students advised by each rank.
Additional table information: table: activity_1
SQL: SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank
How many students are advised by each rank of faculty? List the rank and the number of students.
Additional table information: table: activity_1
SQL: SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank
What are the first and last name of the faculty who has the most students?
Additional table information: table: activity_1
SQL: 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
Give me the the first and last name of the faculty who advises the most students.
Additional table information: table: activity_1
SQL: 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
Show the ids for all the faculty members who have at least 2 students.
Additional table information: table: activity_1
SQL: SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2
Which faculty members advise two ore more students? Give me their faculty ids.
Additional table information: table: activity_1
SQL: SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2
Show ids for the faculty members who don't advise any student.
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
What are the ids of the faculty members who do not advise any student.
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
What activities do we have?
Additional table information: table: activity_1
SQL: SELECT activity_name FROM Activity
List all the activities we have.
Additional table information: table: activity_1
SQL: SELECT activity_name FROM Activity
How many activities do we have?
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Activity
Find the number of activities available.
Additional table information: table: activity_1
SQL: SELECT COUNT(*) FROM Activity
How many faculty members participate in an activity?
Additional table information: table: activity_1
SQL: SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in
Give me the number of faculty members who participate in an activity
Additional table information: table: activity_1
SQL: SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in
Show the ids of the faculty who don't participate in any activity.
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
Which faculty do not participate in any activity? Find their faculty ids.
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
Show the ids of all the faculty members who participate in an activity and advise a student.
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
What are ids of the faculty members who not only participate in an activity but also advise a student.
Additional table information: table: activity_1
SQL: SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
How many activities does Mark Giuliano participate in?
Additional table information: table: activity_1
SQL: 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'
Find the number of activities Mark Giuliano is involved in.
Additional table information: table: activity_1
SQL: 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'
Show the names of all the activities Mark Giuliano participates in.
Additional table information: table: activity_1
SQL: 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'
What are the names of the activities Mark Giuliano is involved in
Additional table information: table: activity_1
SQL: 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 first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in.
Additional table information: table: activity_1
SQL: SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID
What is the first and last name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in.
Additional table information: table: activity_1
SQL: SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID
Show all the activity names and the number of faculty involved in each activity.
Additional table information: table: activity_1
SQL: SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID
How many faculty members participate in each activity? Return the activity names and the number of faculty members.
Additional table information: table: activity_1
SQL: SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID
What is the first and last name of the faculty participating in the most activities?
Additional table information: table: activity_1
SQL: 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
Find the first and last name of the faculty who is involved in the largest number of activities.
Additional table information: table: activity_1
SQL: 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 name of the activity that has the most faculty members involved in?
Additional table information: table: activity_1
SQL: 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
Which activity has the most faculty members participating in? Find the activity name.
Additional table information: table: activity_1
SQL: 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
Show the ids of the students who don't participate in any activity.
Additional table information: table: activity_1
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
What are the ids of the students who are not involved in any activity
Additional table information: table: activity_1
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
Show the ids for all the students who participate in an activity and are under 20.
Additional table information: table: activity_1
SQL: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20
What are the ids of the students who are under 20 years old and are involved in at least one activity.
Additional table information: table: activity_1
SQL: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20
What is the first and last name of the student participating in the most activities?
Additional table information: table: activity_1
SQL: 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
Tell me the first and last name of the student who has the most activities.
Additional table information: table: activity_1
SQL: 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 name of the activity with the most students?
Additional table information: table: activity_1
SQL: 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
Find the name of the activity that has the largest number of student participants.
Additional table information: table: activity_1
SQL: 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
Find the first names of the faculty members who are playing Canoeing or Kayaking.
Additional table information: table: activity_1
SQL: SELECT DISTINCT T1.lname 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'
Which faculty members are playing either Canoeing or Kayaking? Tell me their first names.
Additional table information: table: activity_1
SQL: SELECT DISTINCT T1.lname 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.
Additional table information: table: activity_1
SQL: SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname 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'
What are the first names of the professors who do not play Canoeing or Kayaking as activities?
Additional table information: table: activity_1
SQL: SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname 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 participate in Canoeing and Kayaking.
Additional table information: table: activity_1
SQL: SELECT T1.lname 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.lname 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'
What are the first names of the faculty members playing both Canoeing and Kayaking?
Additional table information: table: activity_1
SQL: SELECT T1.lname 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.lname 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 ids of the students who participate in Canoeing and Kayaking.
Additional table information: table: activity_1
SQL: SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'
Which students participate in both Canoeing and Kayaking as their activities? Tell me their student ids.
Additional table information: table: activity_1
SQL: SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'
Find the name of the airport in the city of Goroka.
Additional table information: table: flight_4
SQL: SELECT name FROM airports WHERE city = 'Goroka'
What are the names of the airports in the city of Goroka?
Additional table information: table: flight_4
SQL: SELECT name FROM airports WHERE city = 'Goroka'
Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.
Additional table information: table: flight_4
SQL: SELECT name, city, country, elevation FROM airports WHERE city = 'New York'
What is the name, city, country, and elevation for every airport in the city of New York?
Additional table information: table: flight_4
SQL: SELECT name, city, country, elevation FROM airports WHERE city = 'New York'
How many airlines are there?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airlines
What is the total number of airlines?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airlines
How many airlines does Russia has?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airlines WHERE country = 'Russia'
What is the number of airlines based in Russia?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airlines WHERE country = 'Russia'
What is the maximum elevation of all airports in the country of Iceland?
Additional table information: table: flight_4
SQL: SELECT MAX(elevation) FROM airports WHERE country = 'Iceland'
What is the highest elevation of an airport in the country of Iceland?
Additional table information: table: flight_4
SQL: SELECT MAX(elevation) FROM airports WHERE country = 'Iceland'
Find the name of the airports located in Cuba or Argentina.
Additional table information: table: flight_4
SQL: SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
What are the names of all airports in Cuba or Argentina?
Additional table information: table: flight_4
SQL: SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina'
Find the country of the airlines whose name starts with 'Orbit'.
Additional table information: table: flight_4
SQL: SELECT country FROM airlines WHERE name LIKE 'Orbit%'
What are the countries of all airlines whose names start with Orbit?
Additional table information: table: flight_4
SQL: SELECT country FROM airlines WHERE name LIKE 'Orbit%'
Find the name of airports whose altitude is between -50 and 50.
Additional table information: table: flight_4
SQL: SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
What are the names of all airports whose elevation is between -50 and 50?
Additional table information: table: flight_4
SQL: SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50
Which country is the airport that has the highest altitude located in?
Additional table information: table: flight_4
SQL: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
What is the country of the airport with the highest elevation?
Additional table information: table: flight_4
SQL: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1
Find the number of airports whose name contain the word 'International'.
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airports WHERE name LIKE '%International%'
How many airports' names have the word Interanation in them?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airports WHERE name LIKE '%International%'
How many different cities do have some airport in the country of Greenland?
Additional table information: table: flight_4
SQL: SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland'
In how many cities are there airports in the country of Greenland?
Additional table information: table: flight_4
SQL: SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland'
Find the number of routes operated by American Airlines.
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
How many routes does American Airlines operate?
Additional table information: table: flight_4
SQL: 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 whose destination airports are in Canada.
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'
How many routes end in a Canadian airport?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'
Find the name, city, and country of the airport that has the lowest altitude.
Additional table information: table: flight_4
SQL: SELECT name, city, country FROM airports ORDER BY elevation NULLS FIRST LIMIT 1
What is the name, city, and country of the airport with the lowest altitude?
Additional table information: table: flight_4
SQL: SELECT name, city, country FROM airports ORDER BY elevation NULLS FIRST LIMIT 1
Find the name, city, and country of the airport that has the highest latitude.
Additional table information: table: flight_4
SQL: SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1
What is the name, city, and country of the airport with the highest elevation?
Additional table information: table: flight_4
SQL: SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1
Find the name and city of the airport which is the destination of the most number of routes.
Additional table information: table: flight_4
SQL: SELECT T1.name, T1.city, T2.dst_apid 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
What is the name and city of the airport that the most routes end at?
Additional table information: table: flight_4
SQL: SELECT T1.name, T1.city, T2.dst_apid 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 names of the top 10 airlines that operate the most number of routes.
Additional table information: table: flight_4
SQL: SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10
For the airline ids with the top 10 most routes operated, what are their names?
Additional table information: table: flight_4
SQL: SELECT T1.name, T2.alid 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 name and city of the airport which is the source for the most number of flight routes.
Additional table information: table: flight_4
SQL: SELECT T1.name, T1.city, T2.src_apid 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
What is the name and city of the airport from most of the routes start?
Additional table information: table: flight_4
SQL: SELECT T1.name, T1.city, T2.src_apid 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 number of different airports which are the destinations of the American Airlines.
Additional table information: table: flight_4
SQL: SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
What is the number of different different airports that are destinations for American Airlines?
Additional table information: table: flight_4
SQL: SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines'
Which countries has the most number of airlines?
Additional table information: table: flight_4
SQL: SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the country with the most number of home airlines?
Additional table information: table: flight_4
SQL: SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
Which countries has the most number of airlines whose active status is 'Y'?
Additional table information: table: flight_4
SQL: SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
What are the countries with the most airlines whose active status is Y?
Additional table information: table: flight_4
SQL: SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
List all countries and their number of airlines in the descending order of number of airlines.
Additional table information: table: flight_4
SQL: SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC
How many airlines operate out of each country in descending order?
Additional table information: table: flight_4
SQL: SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC
How many airports are there per country? Order the countries by decreasing number of airports.
Additional table information: table: flight_4
SQL: SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC
What is the number of airports per country, ordered from most to least?
Additional table information: table: flight_4
SQL: SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC
How many airports are there per city in the United States? Order the cities by decreasing number of airports.
Additional table information: table: flight_4
SQL: 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 US ordered from most to least?
Additional table information: table: flight_4
SQL: SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC
Return the cities with more than 3 airports in the United States.
Additional table information: table: flight_4
SQL: SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3
What is the number of cities in the United States with more than 3 airports?
Additional table information: table: flight_4
SQL: SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3
How many cities are there that have more than 3 airports?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3)
What is the count of cities with more than 3 airports?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3)
List the cities which have more than one airport and number of airports.
Additional table information: table: flight_4
SQL: SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1
What are the names of all cities with more than one airport and how many airports do they have?
Additional table information: table: flight_4
SQL: SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1
List the cities which have more than 2 airports sorted by the number of airports.
Additional table information: table: flight_4
SQL: SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) NULLS FIRST
What are the cities that have more than 2 airports sorted by number of airports?
Additional table information: table: flight_4
SQL: SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) NULLS FIRST
Find the number of routes for each source airport and the airport name.
Additional table information: table: flight_4
SQL: SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name
For each airport name, how many routes start at that airport?
Additional table information: table: flight_4
SQL: 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 and airport name for each source airport, order the results by decreasing number of routes.
Additional table information: table: flight_4
SQL: 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
For each  airport name, how many routes start at that airport, ordered from most to least?
Additional table information: table: flight_4
SQL: 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 average elevation of all airports for each country.
Additional table information: table: flight_4
SQL: SELECT AVG(elevation), country FROM airports GROUP BY country
For each country, what is the average elevation of that country's airports?
Additional table information: table: flight_4
SQL: SELECT AVG(elevation), country FROM airports GROUP BY country
Find the cities which have exactly two airports.
Additional table information: table: flight_4
SQL: SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2
What are the cities with exactly two airports?
Additional table information: table: flight_4
SQL: SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2
For each country and airline name, how many routes are there?
Additional table information: table: flight_4
SQL: 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
What is the total number of routes for each country and airline in that country?
Additional table information: table: flight_4
SQL: 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
Find the number of routes with destination airports in Italy.
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'
What is the number of routes whose destinations are Italian airports?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'