text2SQL stringlengths 192 7.27k |
|---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of students who didn't take any course from Biology department.### Response: SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show party names and the number of events for each party.### Response: SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the transaction type code that occurs the fewest times.### Response: SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.### Response: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the id of students who attended statistics courses in the order of attendance date.### Response: SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_i... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which staff have contacted which engineers? List the staff name and the engineer first name and last name.### Response: SELECT T1.staff_name , T3.first_name , T3.last_name FROM Staff AS T1 JOI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show card type codes with at least 5 cards.### Response: SELECT card_type_code FROM Customers_cards GROUP BY card_type_code HAVING count(*) >= 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all cities where at least one customer lives in but no performer lives in.### Response: SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCE... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the dates of transactions with at least 100 share count or amount bigger than 100?### Response: SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_tran... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many tracks are in the AAC audio file media type?### Response: SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = "AAC audio file". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the subject ID, subject name, and the corresponding number of available courses for each subject.### Response: SELECT T1.subject_id , T2.subject_name , COUNT(*) FROM Courses AS T1 JOIN Su... |
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: What are the names of the directors who made exactly one movie?### Response: SELECT director FROM Movie GROUP BY director HAVING count(*) = 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and email of the user whose name contains the word ‘Swift’.### Response: SELECT name , email FROM user_profiles WHERE name LIKE '%Swift%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name and count of each product in all orders.### Response: SELECT T3.product_name , count(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the order dates of orders with price higher than 1000?### Response: SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the distinct positions of the players from a country whose capital is Dublin?### Response: SELECT DISTINCT T2.Position FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which contact channel has been used by the customer with name "Tillman Ernser"?### Response: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many enzymes do not have any interactions?### Response: SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction );. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of the party that has the most delegates.### Response: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIM... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the start dates and end dates of all the apartment bookings made by guests with gender code "Female".### Response: SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Booki... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: In which year did the least people enter hall of fame?### Response: SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC 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 teacher who teaches the largest number of students.### Response: SELECT T2.firstname , T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROU... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the patient who made the most recent appointment?### Response: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start 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 user who gives the most reviews.### Response: SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id 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 title of course that is provided by Statistics but not Psychology departments.### Response: SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHE... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the title of the course that was offered at building Chandler during the fall semester in the year of 2010?### Response: SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which campus has the most faculties in year 2003?### Response: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.### Response: SELECT T1.product_id FROM product_suppliers AS T1 JO... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the first 5 customers.### Response: SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which bike traveled the most often in zip code 94002?### Response: SELECT bike_id FROM trip WHERE zip_code = 94002 GROUP BY bike_id 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 issue dates of volumes associated with the artist aged 23 or younger?### Response: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.ag... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the first names and date of birth of professors teaching course ACCT-211?### Response: SELECT DISTINCT T1.EMP_FNAME , T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of users who have more than one tweet.### Response: SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of the building that has the most company offices.### Response: SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who is the oldest person whose job is student?### Response: SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' ). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of tracks whose genre is Rock?### Response: SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock";. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the phone, room, and building for the faculty named Jerry Prince.### Response: SELECT phone , room , building FROM Faculty WHERE Fname = "Jerry" AND Lname = "Prince". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of captains whose rank are either Midshipman or Lieutenant.### Response: SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many papers are published by the institution "Tokohu University"?### Response: SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000.### Response: SELECT Publisher FROM publication WHERE Price > 10000000... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of stadiums whose capacity is smaller than the average capacity.### Response: SELECT name FROM stadium WHERE capacity < (SELECT avg(capacity) FROM stadium). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the average room count of the apartments that have booking status code "Provisional".### Response: SELECT avg(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id =... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name, checking balance and savings balance of all accounts in the bank sorted by their total checking and savings balance in descending order.### Response: SELECT T2.balance , T3.balan... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all the document names which contains "CV".### Response: SELECT document_name FROM documents WHERE document_name LIKE "%CV%". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the entry names of catalog with the attribute possessed by most entries.### Response: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attribute... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which product has been ordered most number of times?### Response: SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id O... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name of students not enrolled in any course.### Response: SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of rooms that do not have any reservation.### Response: SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the age of student Linda Smith?### Response: SELECT Age 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: What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?### Response: SELECT count(*) , T1.year FROM postseason 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: What is the phone number of the customer who has filed the most recent complaint?### Response: SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the patient who made the most recent appointment?### Response: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?### Response: SELECT T1.task_details , T1.task_id , T2.project_id... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the description and code of the type of service that is performed the most often?### Response: SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN... |
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: What is the customer id, first and last name with most number of accounts.### Response: SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customer... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average and maximum hours for the students whose tryout decision is yes.### Response: SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.d... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the stadium that has the maximum capacity.### Response: SELECT name FROM stadium ORDER BY capacity 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 order which has the most items?### Response: SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY count(*)... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of furnitures whose prices are lower than the highest price.### Response: SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the names of songs for which format is mp3 and resolution is below 1000.### Response: SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average rating star for each reviewer?### Response: SELECT T2.name , avg(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which park had most attendances in 2008?### Response: SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: When was the school with the largest enrollment founded?### Response: SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many camera lenses are not used in taking any photos?### Response: SELECT count(*) FROM camera_lens WHERE id NOT IN ( SELECT camera_lens_id FROM photos ). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the lot details of lots associated with transactions with share count smaller than 50?### Response: SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which major has the most students?### Response: SELECT Major FROM STUDENT GROUP BY major 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 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: 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: Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.### Response: SELECT Date_Claim_Made , Date_Claim_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many countries do not have an roller coaster longer than 3000?### Response: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids and details of events that have more than one participants?### Response: SELECT T1.event_id , T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_I... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average rating stars and title for the oldest movie?### Response: SELECT avg(T1.stars) , T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT m... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of the county with the biggest population.### Response: SELECT County_name FROM county ORDER BY Population DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the customer id with most number of cards, and how many does he have?### Response: SELECT customer_id , count(*) FROM Customers_cards GROUP BY customer_id 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 each test result and its count in descending order of count.### Response: SELECT test_result , COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the mascots for schools with enrollments above the average?### Response: SELECT mascot FROM school WHERE enrollment > (SELECT avg(enrollment) FROM school). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the maximum, minimum, and average booked count for the products booked?### Response: SELECT max(booked_count) , min(booked_count) , avg(booked_count) FROM products_booked. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the start and end dates of behavior incidents of students with last name "Fahey".### Response: SELECT T1.date_incident_start , date_incident_end FROM Behavior_Incident AS T1 JOIN Students ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the most common type of ships.### Response: SELECT TYPE FROM ship GROUP BY 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 number of female students (with F sex) living in Smith Hall### Response: SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome.### Response: SELECT T2.customer_name , T2.payment_method FRO... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the countries that have never participated in any competition with Friendly type.### Response: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the visit date and details of the visitor whose detail is 'Vincent'?### Response: SELECT T2.Visit_Date , T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many cards does customer Art Turcotte have?### Response: SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the maximum and minimum number of transit passengers of all aiports.### Response: SELECT max(Transit_Passengers) , min(Transit_Passengers) FROM airport. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students does KAWA GORDON teaches?### Response: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "G... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of albums that are released by aritist whose name has 'Led'### Response: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the youngest editor?### Response: SELECT Name FROM editor ORDER BY Age ASC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the crime rate of counties with a city having white percentage more than 90.### Response: SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and age of the person who is a friend of both Dan and Alice.### Response: SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend ... |
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: What is the age of the tallest person?### Response: SELECT Age FROM people ORDER BY Height DESC LIMIT 1. |
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: Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.### Response: SELECT DISTINCT LOCATION FROM station WHERE number_of_p... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the department name and number of employees in each of the department.### Response: SELECT department_name , COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many professors who has a either Ph.D. or MA degree?### Response: SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of the physician who prescribed the highest dose?### Response: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the ids of all distinct customers who made order after some orders that were Cancelled.### Response: SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT min(order_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.