text2SQL stringlengths 192 7.27k |
|---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name and phone number of all suppliers in the alphabetical order of their addresses.### Response: SELECT T1.supplier_name , T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_address... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the channel code and contact number of the customer contact channel that was active for the longest time?### Response: SELECT channel_code , contact_number FROM customer_contact_channel... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each station, return its longitude and the average duration of trips that started from the station.### Response: SELECT T1.name , T1.long , avg(T2.duration) FROM station AS T1 JOIN trip AS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all publishers which do not have a book in 1989.### Response: SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the clubs having "Davis Steven" as a member.### Response: SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the products that are not using the most frequently-used max page size.### Response: SELECT product FROM product WHERE product != (SELECT max_page_size FROM product GROUP BY max... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids and names of the medicine that can interact with two or more enzymes?### Response: SELECT T1.id , T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medic... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id of users who are followed by Mary or Susan.### Response: SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Mary" OR T1.name = "Susan". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the nurse has the most appointments?### Response: SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY cou... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name and typical buying and selling prices of the products that have color described as "yellow"?### Response: SELECT t1.product_name , t1.typical_buying_price , t1.typical_sellin... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which fault log included the most number of faulty parts? List the fault log id, description and record time.### Response: SELECT T1.fault_log_entry_id , T1.fault_description , T1.fault_log_en... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the first names and last names of all the guests that have apartment bookings with status code "Confirmed".### Response: SELECT T2.guest_first_name , T2.guest_last_name FROM Apartment_Book... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of tracks which are in both Movies and music playlists.### Response: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2... |
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: List categories that have at least two books after year 1989.### Response: SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING count(*) >= 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many credit cards does customer Blanche Huels have?### Response: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the maximum scores of the team Boston Red Stockings when the team won in postseason?### Response: SELECT max(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which game type has most number of games?### Response: SELECT gtype FROM Video_games GROUP BY gtype 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 hardware model name and company name for the phone whose screen mode type is "Graphics."### Response: SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the swimmers who have no record.### Response: SELECT name FROM swimmer WHERE id NOT IN (SELECT swimmer_id FROM record). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of aircrafts and that did not win any match.### Response: SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many registed students do each course have? List course name and the number of their registered students?### Response: SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_cour... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the ship type that are used by both ships with Panama and Malta flags.### Response: SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of parties that have both delegates on "Appropriations" committee and### Response: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Co... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the artists who are from Bangladesh and have never received rating higher than 7.### Response: SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SEL... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"?### Response: SELECT t3.title FROM authors AS t1 JOIN authorship A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and location of circuits that belong to France or Belgium?### Response: SELECT circuitid , LOCATION FROM circuits WHERE country = "France" OR country = "Belgium". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and local authority of the station whose maximum precipitation is higher than 50.### Response: SELECT t2.id , t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.s... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the facility codes of apartments with more than 4 bedrooms.### Response: SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.be... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of races held after 12:00:00 or before 09:00:00?### Response: SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id of the courses that do not have any prerequisite?### Response: SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the distinct ages of the heads who are acting?### Response: SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes'... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the id and details of the customers who have at least 3 events?### Response: SELECT T1.customer_id , T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the customer first, last name and id with least number of accounts.### Response: SELECT T2.customer_first_name , T2.customer_last_name , T1.customer_id FROM Accounts AS T1 JOIN Custome... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the locations that have more than one movie theater with capacity above 300.### Response: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which paper's title contains the word "Database"?### Response: SELECT title FROM papers WHERE title LIKE "%Database%". |
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 goalie and mid positions.### Response: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.... |
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: List the names of representatives that have not participated in elections listed here.### Response: SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which document type is described with the prefix 'Initial'?### Response: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first name of the staff who did not give any lesson?### Response: SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.s... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the countries that have managers of age above 50 or below 46.### Response: SELECT Country FROM manager WHERE Age > 50 OR Age < 46. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name and phone of the customer without any mailshot.### Response: SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_custom... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average gpa of the students enrolled in the course with code ACCT-211?### Response: SELECT avg(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLAS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of employees of each gender whose salary is lower than 50000.### Response: SELECT count(*) , sex FROM employee WHERE salary < 50000 GROUP BY sex. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which campus was opened between 1935 and 1939?### Response: SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me the zip code where the average mean humidity is below 70 and at least 100 trips took place.### Response: SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_humidity) < 70 I... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: which countries have more than 2 airports?### Response: SELECT country FROM airport GROUP BY country HAVING count(*) > 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the id and first name of the student whose addresses have the highest average monthly rental?### Response: SELECT T1.student_id , T2.first_name FROM Student_Addresses AS T1 JOIN Studen... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.### Response: SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.### Response: SELECT T1.engineer_id , T1.first_name , T1... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of clubs that do not have any players.### Response: SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of journalists that have reported more than one event.### Response: SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many apartments do not have any facility?### Response: SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.### Response: SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total and minimum enrollment of all schools?### Response: SELECT sum(enrollment) , min(enrollment) FROM university. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the most common type of competition.### Response: SELECT Competition_type FROM competition GROUP BY Competition_type 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 first and last name of the author(s) who wrote the paper "Nameless, Painless".### Response: SELECT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.auth... |
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 enrollment dates of all the tests that have result "Pass"?### Response: SELECT T1.date_of_enrolment FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registra... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of the city with the top 5 white percentages.### Response: SELECT Name FROM city ORDER BY White DESC LIMIT 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the nominees that have been nominated more than two musicals.### Response: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.### Response: SELECT DISTINCT T3.name , T2.title ,... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which address do not have any member with the black membership card?### Response: SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card = 'Black'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which kind of part has the least number of faults? List the part name.### Response: SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many companies operates airlines in each airport?### Response: SELECT T3.id , count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airpo... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which kind of policy type was chosen by the most customers?### Response: SELECT Policy_Type_Code FROM Customer_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 is the zip code of staff with first name as Janessa and last name as Sawayn lived?### Response: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_addr... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the actual delivery dates of orders with quantity 1?### Response: SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the branch name and city without any registered members.### Response: SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of all tracks in the playlists of Movies.### Response: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlis... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"?### Response: SELECT T1.teacher_id , T2.last_name FROM Detention AS T1 JOIN Teachers AS T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the event that happened in the most recent year?### Response: SELECT name FROM event ORDER BY YEAR DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the unique names of races that held after 2000 and the circuits were in Spain?### Response: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid W... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.### Response: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.custom... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the most popular payment method?### Response: SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_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 the average amount purchased and value purchased for the supplier who supplies the most products.### Response: SELECT avg(total_amount_purchased) , avg(total_value_purchased) FROM Prod... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?### Response: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Invest... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id of suppliers whose average amount purchased for each product is above 50000 or below 30000.### Response: SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING avg(tot... |
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 Feb is higher than that in Jun or cities that were once host cities?### Response: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_i... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of journalists and the names of the events they reported in ascending order### Response: SELECT T3.Name , T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Ev... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all company names with a book published by Alyson.### Response: SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publis... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which cities have 2 to 4 parks?### Response: SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the first names of the professors who do not teach a class.### Response: SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which school has the smallest amount of professors?### Response: SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER B... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all the characteristic names and data types of product "cumin".### Response: SELECT t3.characteristic_name , t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first, last name, gpa of the youngest one among students whose GPA is above 3?### Response: SELECT stu_fname , stu_lname , stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the result description of the project whose detail is 'sint'?### Response: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Retrieve the average age of members of the club "Tennis Club".### Response: SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and hours of the students whose tryout decision is yes.### Response: SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show distinct types of artworks that are nominated in festivals in 2007.### Response: SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN fes... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which authors belong to the institution "Google"? Show the first names and last names.### Response: SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which department has the largest number of employees?### Response: SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the album names, ids and the number of tracks for each album.### Response: SELECT T1.Title , T2.AlbumID , COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the customer name and date of the orders that have the status "Delivered".### Response: SELECT t1.customer_name , t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.custom... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and city of the airport which is the source for the most number of flight routes.### Response: SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average ram mib size of the chip models that are never used by any phone.### Response: SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many accounts does the customer with first name Art and last name Turcotte have?### Response: SELECT count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WH... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the distinct hometowns of gymnasts with total points more than 57.5?### Response: SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHER... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all the buildings that have at least 10 professors.### Response: SELECT building FROM Faculty WHERE rank = "Professor" GROUP BY building HAVING count(*) >= 10. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.