question
stringlengths
63
269
answer
stringlengths
18
557
What is the average and maximum damage in millions for storms that had a max speed over 1000? Additional table information: table: storm_record
SELECT AVG(damage_millions_USD), MAX(damage_millions_USD) FROM storm WHERE max_speed > 1000
Find the average order quantity per order. Additional table information: table: customers_and_addresses
SELECT AVG(order_quantity) FROM order_items
Return the names of cities, ordered alphabetically. Additional table information: table: county_public_safety
SELECT Name FROM city ORDER BY Name ASC NULLS FIRST
List the distinct positions of pilots older than 30. Additional table information: table: pilot_record
SELECT DISTINCT POSITION FROM pilot WHERE Age > 30
Find the personal name, family name, and author ID of the course author that teaches the most courses. Additional table information: table: 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 average access counts of documents with functional area 'Acknowledgement'. Additional table information: table: 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'
Which patients made more than one appointment? Tell me the name and phone number of these patients. Additional table information: table: 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
How many departments are in each school? Additional table information: table: college_1
SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code
How old is the doctor named Zach? Additional table information: table: network_2
SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'
Give the names and locations of all wrestlers. Additional table information: table: wrestler
SELECT Name, LOCATION FROM wrestler
What is the total revenue of companies started by founder? Additional table information: table: manufactory_1
SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder
What is the average enrollment of schools? Additional table information: table: school_player
SELECT AVG(Enrollment) FROM school
What is the id, name and IATA code of the airport that had most number of flights? Additional table information: table: 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 T2.id ORDER BY COUNT(*) DESC LIMIT 1
What are the subject ID, subject name, and the number of available courses for each subject? Additional table information: table: 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
What are the names and addressed of customers who have both New and Pending orders? Additional table information: table: 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'
What are all distinct country for artists? Additional table information: table: theme_gallery
SELECT DISTINCT country FROM artist
What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges? Additional table information: table: soccer_2
SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
How many courses does the student with id 171 actually attend? Additional table information: table: 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
What are the publishers who have published a book in both 1989 and 1990? Additional table information: table: culture_company
SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990
What nurses are on call with block floor 1 and block code 1? Tell me their names. Additional table information: table: hospital_1
SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1