text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which flag is most widely used among all ships?### Response: SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which staff handled least number of payments? List the full name and the id.### Response: SELECT T1.first_name , T1.last_name , T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of customers who have more than one loan.### Response: 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(*) >...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the addresses of the buildings that have apartments with more than 2 bathrooms.### Response: SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the manager's first name, last name and id who won the most manager award?### Response: SELECT T1.name_first , T1.name_last , T2.player_id FROM player AS T1 JOIN manager_award AS T2 O...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name, latitude, and city of the station with the lowest latitude?### Response: SELECT name , lat , city FROM station ORDER BY lat LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the country that has the most perpetrators?### Response: SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Select the names of manufacturer whose products have an average price higher than or equal to $150.### Response: SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01?### Response: SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what is the name and position of the head whose department has least number of employees?### Response: SELECT T2.name , T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the order id and order details for the order more than two invoices.### Response: SELECT T2.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the most common participant type?### Response: SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the top 3 departments that provide the largest amount of courses?### Response: SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many female students (sex is F) whose age is below 25?### Response: SELECT count(*) FROM student WHERE sex = 'F' AND age < 25.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of 5 users followed by the largest number of other users.### Response: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the claim processing stage that most of the claims are on?### Response: SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.cla...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the host names for parties with number of hosts greater than 20.### Response: 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_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"?### Response: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the max and min grade point for all letter grade.### Response: SELECT max(gradepoint) , min(gradepoint) FROM GRADECONVERSION.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first name of each student enrolled in class ACCT-211?### Response: 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...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.### Response: SELECT name FROM manufacturers WHERE revenue < (SELECT min(revenue) FROM man...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show total hours per week and number of games played for student David Shieber.### Response: SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the schools that were either founded after 1850 or public.### Response: SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which college have both players with position midfielder and players with position defender?### Response: SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT Colleg...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the residences that have at least two players.### Response: SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are the top 3 highest support rates?### Response: SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of countries that have more than one roller coaster.### Response: SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name H...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: In 2014, what are the id and rank of the team that has the largest average number of attendance?### Response: SELECT T2.team_id , T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and city of the student address with the highest average monthly rental.### Response: SELECT T2.address_id , T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.### Response: SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of amenities of the dorm where the student with last name Smith is living in.### Response: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the id of students who registered courses or attended courses?### Response: SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of manufactures that are based in Tokyo or Beijing.### Response: SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which parts have more than 2 faults? Show the part name and id.### Response: 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.pa...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the title, credit, and department name of courses that have more than one prerequisites?### Response: SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students live in HKG or CHI?### Response: SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of the customer who has the most orders.### Response: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.custo...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all procedures which cost more than 1000 or which physician John Wen was trained in.### Response: SELECT name FROM procedures WHERE cost > 1000 UNION SELECT T3.name FROM physician AS T1 J...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many games has each stadium held?### Response: SELECT T1.id , count(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many engineers did each staff contact? List both the contact staff name and number of engineers contacted.### Response: SELECT T1.staff_name , count(*) FROM Staff AS T1 JOIN Engineer_Visits...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Where does the customer with the first name Linda live? And what is her email?### Response: SELECT T2.address , T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the customers first and last name of 10 least expensive invoices.### Response: SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please give me a list of cities whose regional population is over 8000000 or under 5000000.### Response: SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the top 3 apartment type codes sorted by the average number of rooms in descending order.### Response: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) D...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students have a food allergy?### Response: SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the stories of the building with the largest height.### Response: SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.### Response: SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.S...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which club has the most members majoring in "600"?### Response: 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.stui...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the minimum and maximum number of bathrooms of all the apartments?### Response: SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and position of physicians who prescribe some medication whose brand is X?### Response: SELECT DISTINCT T1.name , T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.empl...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names of technicians and series of machines they are assigned to repair.### Response: SELECT T3.Name , T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id =...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the distinct types of the companies that have operated any flights with velocity less than 200?### Response: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which 3 players won the most player awards? List their full name and id.### Response: SELECT T1.name_first , T1.name_last , T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the product names that are colored 'white' but do not have unit of measurement "Handful".### Response: SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.pro...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the distinct apartment numbers of the apartments that have bookings with status code "Confirmed".### Response: SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of students whose age is older than the average age for each gender.### Response: SELECT count(*) , sex FROM student WHERE age > (SELECT avg(age) FROM student) GROUP BY sex.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the degrees conferred in "San Francisco State University" in 2001.### Response: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Fra...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many courses are offered by the Computer Info. Systems department?### Response: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city does student Linda Smith live in?### Response: SELECT city_code FROM Student WHERE Fname = "Linda" AND Lname = "Smith";.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the cities which have more than one airport and number of airports.### Response: SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the role code with the largest number of employees?### Response: SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names and origins of people who are not body builders.### Response: SELECT Name , birth_place FROM people EXCEPT SELECT T1.Name , T1.birth_place FROM people AS T1 JOIN body_builder AS...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of authors from college "Florida" or "Temple"### Response: SELECT Author FROM submission WHERE College = "Florida" OR College = "Temple".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city lives most of staffs? List the city name and number of staffs.### Response: SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GRO...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of students for the cities where have more than one student.### Response: SELECT count(*) , city_code FROM student GROUP BY city_code HAVING count(*) > 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of all instructors whose salary is greater than the salary of all instructors in the Biology department.### Response: SELECT name FROM instructor WHERE salary > (SELECT max(sala...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?### Response: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.c...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the age of the friend of Zach with longest year relationship?### Response: SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?### Response: SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.custom...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the most common apartment type code.### Response: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?### Response: SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN org...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the states where have the colleges whose enrollments are less than the largest size.### Response: SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List title of albums have the number of tracks greater than 10.### Response: 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;...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the busiest source airport that runs most number of routes in China.### Response: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the longest song?### Response: SELECT f_id FROM files ORDER BY duration DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: 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?### Response: SELECT document_name , access_count ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all branch names with the number of members in each branch registered after 2015.### Response: SELECT T2.name , count(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branc...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of states that have some college students playing in the mid position but not in the goalie position.### Response: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the checking balance of the accounts whose savings balance is higher than the average savings balance.### Response: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid =...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What country does Roberto Almeida live?### Response: SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all student IDs who have at least two allergies.### Response: SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which address has both members younger than 30 and members older than 40?### Response: SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what is the salary and name of the employee who has the most number of aircraft certificates?### Response: SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of students who have taken the prerequisite course of the course with title International Finance.### Response: SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name of courses that have at least five enrollments?### Response: SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which colleges do the tryout players whose name starts with letter D go to?### Response: SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the maximum and average capacity among rooms in each building.### Response: SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the city and the number of branches opened before 2010 for each city.### Response: SELECT city , count(*) FROM branch WHERE open_year < 2010 GROUP BY city.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?### Response: SELECT first_name , last_name FROM employees WHERE sa...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the opening year in whcih at least two churches opened.### Response: SELECT open_date FROM church GROUP BY open_date HAVING count(*) >= 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the project with least number of documents?### Response: SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the color description of the product with name "catnip"?### Response: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.pr...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the school name and type for schools without a school bus.### Response: SELECT school , TYPE FROM school WHERE school_id NOT IN (SELECT school_id FROM school_bus).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the maximum total amount paid by a customer? List the customer id and amount.### Response: SELECT customer_id , sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_p...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: 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'### Response: SELECT DISTINCT T2.thing_id , T2.Type_of_Thi...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the founded year of the newest non public school.### Response: SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described### Response: SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains?### Response: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of colleges that have at least two players.### Response: SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city is the address of the store named "FJA Filming" located in?### Response: SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_N...