text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the color code and description of the product named "chervil"?### Response: SELECT t1.color_code , t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the instructor who advises of all students from History department?### Response: SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = '...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of rooms booked by some customers whose first name contains ROY.### Response: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname L...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the activity with the most students?### Response: SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY c...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the star rating descriptions of the hotels with price above 10000?### Response: SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_c...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which advisor has most number of students?### Response: SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of the three most recent festivals.### Response: SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names, color descriptions and product descriptions of products with category "Herbs".### Response: SELECT T1.product_name , T2.color_description , T1.product_description FROM products...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes.### Response: SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of customers who are not living in the state of California.### Response: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addr...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000.### Response: SELECT Product_Type_Code FROM Products WHERE Product_Price ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the weights of entrepreneurs in descending order of money requested?### Response: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of services that have been used for more than 2 times in first notification of loss.### Response: SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 O...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the transportation method most people choose to get to tourist attractions.### Response: SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LI...
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: How many bookings did each customer make? List the customer id, first name, and the count.### Response: SELECT T1.customer_id , T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many products have a price higher than the average?### Response: SELECT count(*) FROM products WHERE product_price > (SELECT avg(product_price) FROM products).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show storm name with at least two regions and 10 cities affected.### Response: SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVI...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the person who has no student friends.### Response: SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the average, minimum, and maximum age for different majors.### Response: SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.### Response: SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrie...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and id of the item with the highest average rating.### Response: 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(T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names and offices of all professors sorted by alphabetical order of their first name.### Response: SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 O...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the product with the highest height? Give me the catalog entry name.### Response: SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of the drama workshop groups with address in Feliciaberg city?### Response: SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of all instructors in the Art department who have taught some course and the course_id.### Response: SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students are not involved in any behavior incident?### Response: SELECT count(*) FROM STUDENTS WHERE student_id NOT IN ( SELECT student_id FROM Behavior_Incident ).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders.### Response: SELECT T1.first_name , T1.last_name , COUNT(*) FROM cu...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the titles and directors of the films were never presented in China?### Response: SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the last name of the staff who has handled the first ever complaint?### Response: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.da...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average duration of songs that have mp3 format and resolution below 800?### Response: SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which artist has the most albums?### Response: 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.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the first name and last name of Linda Smith's advisor?### Response: SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = "Lind...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and name of the most expensive base price room.### Response: SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the event venues and names that have the top 2 most number of people attended.### Response: SELECT venue , name FROM event ORDER BY Event_Attendance DESC LIMIT 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the average, maximum, minimum enrollment of all schools.### Response: SELECT avg(enrollment) , max(enrollment) , min(enrollment) FROM school.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names and last names of male (sex is M) faculties who live in building NEB.### Response: SELECT Fname , Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find courses that ran in Fall 2009 and in Spring 2010.### Response: SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semest...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the addresses and author IDs of the course authors that teach at least two courses.### Response: SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses A...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show id, first and last names for all customers with at least two cards.### Response: SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Customers_cards AS T1 JOIN Cus...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which payment method is used by most customers?### Response: SELECT payment_method FROM customers GROUP BY payment_method 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 name and gender type of the dorms whose capacity is greater than 300 or less than 100.### Response: SELECT dorm_name , gender FROM dorm WHERE student_capacity > 300 OR student_capaci...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: A list of the top 5 countries by number of invoices. List country name and number of invoices.### Response: SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY cou...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the genre name of the film HUNGER ROOF?### Response: 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...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the players whose names contain letter 'a'.### Response: SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names of all customers that live in Brazil and have an invoice.### Response: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.### Response: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show each author and the number of workshops they submitted to.### Response: SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID =...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average and total transaction amount?### Response: SELECT avg(transaction_amount) , sum(transaction_amount) FROM Financial_transactions.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the entry name of the most expensive catalog (in USD)?### Response: SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC 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: What are the names of the workshop groups that have bookings with status code "stop"?### Response: SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which company started the earliest the maintenance contract? Show the company name.### Response: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.co...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.### Response: SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names of musicals which have at least three actors.### Response: 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(*)...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of phones with carrier either "Sprint" or "TMobile".### Response: SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the locations of parties with hosts older than 50.### Response: 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....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the employee id and salary of all employees who report to Payam (first name).### Response: SELECT employee_id , salary FROM employees WHERE manager_id = (SELECT employee_id FROM emplo...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the date of the performance with the highest number of attendees?### Response: SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the instructor who advises of all students from History department?### Response: SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = '...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the most frequent status of bookings?### Response: SELECT Status_Code FROM BOOKINGS GROUP BY Status_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: Return all the committees that have delegates from Democratic party.### Response: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democra...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.### Response: SELECT title FROM film WHERE LENGTH > 100 OR rating ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of amenities for each of the dorms that can accommodate more than 100 students.### Response: SELECT count(*) , T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the date of the tallest perpetrator.### Response: 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.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all cities without a branch having more than 100 memberships.### Response: SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the email and phone number of the customers who have never filed a complaint before.### Response: SELECT email_address , phone_number FROM customers WHERE customer_id NOT IN (SELECT custom...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name and id of the team with the most victories in 2008 postseason?### Response: SELECT T2.name , T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and id of the item with the highest average rating.### Response: 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(T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last names of the members of the club "Bootup Baltimore".### Response: SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stui...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the date of enrollment of the course named "Spanish"?### Response: SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.### Response: SELECT DISTINCT cName FROM college WHERE enr > (SELECT min(enr) FROM colle...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are name and phone number of patients who had more than one appointment?### Response: SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.pat...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total and average amount of settlements.### Response: SELECT sum(settlement_amount) , avg(settlement_amount) FROM settlements.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names and phones of customers who do not have address information.### Response: SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM custo...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which policy type has the most records in the database?### Response: SELECT policy_type_code FROM available_policies GROUP BY policy_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 are names of stations that have average bike availability above 10 and are not located in San Jose city?### Response: SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.sta...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of the shop that have the largest quantity of devices in stock.### Response: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID O...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: 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.### Response: SELECT T1.fault_short_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names of all professors in the Accounting department who is teaching some course and the class room.### Response: SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the country of origin of the artist who is female and produced a song in Bangla?### Response: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are all info of students who registered courses but not attended courses?### Response: SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_cou...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all information on the airport that has the largest number of international passengers.### Response: SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names of musicals which have at least three actors.### Response: 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(*)...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: 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.### Response: SELECT T1.fname , T1.lname ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last name and hire date of the professor who is in office DRE 102.### Response: SELECT T1.emp_lname , T1.emp_hiredate FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_...
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 name includes the substring “dar”.### Response: SELECT name FROM instructor WHERE name LIKE '%dar%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the student who has the highest total credits in the History department.### Response: SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1.
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: List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.### Response: SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.peop...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the department which has the highest average salary of professors.### Response: SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Retrieve the country that has published the most papers.### Response: SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.pa...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id and name of the enzyme with most number of medicines that can interact as 'activator'?### Response: SELECT T1.id , T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all member names who are not in charge of any event.### Response: SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each customer who has at least two orders, find the customer name and number of orders made.### Response: SELECT T2.customer_name , count(*) FROM orders AS T1 JOIN customers AS T2 ON T1.cus...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of professors with a Ph.D. degree in each department.### Response: SELECT count(*) , dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the details of the lots which are not used in any transactions?### Response: SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: list the card number of all members whose hometown address includes word "Kentucky".### Response: SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?### Response: SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reporte...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the response received dates for the documents described as 'Regular' or granted with more than 100?### Response: SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Type...