text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which destination has least number of flights?### Response: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1.
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 is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?### Response: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS...
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 home games each stadium held?### Response: SELECT max(home_games) , min(home_games) , avg(home_games) FROM stadium.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show details of all investors if they make any transaction with share count greater than 100.### Response: SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the most common location of performances.### Response: SELECT LOCATION FROM performance GROUP BY LOCATION 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 all invoice dates corresponding to customers with first name Astrid and last name Gruber.### Response: SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.C...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names of teachers whose email address contains the word "man".### Response: SELECT first_name FROM Teachers WHERE email_address LIKE '%man%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all track names that have had no races.### Response: SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many faculty lines are there in the university that conferred the least number of degrees in year 2001?### Response: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of people, and dates and venues of debates they are on the affirmative side.### Response: SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.De...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of pilots and the number of records they have.### Response: SELECT T2.Pilot_name , COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pi...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total access count of all documents in the most popular document type.### Response: SELECT sum(access_count) FROM documents GROUP BY document_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: 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 enrollment and primary_conference of the oldest college.### Response: SELECT enrollment , primary_conference FROM university ORDER BY founded LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and account balance of the customers who have loans with a total amount of more than 5000.### Response: SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the dates of the latest logon of the students with family name "Jaskolski" or "Langosh"?### Response: SELECT date_of_latest_logon FROM Students WHERE family_name = "Jaskolski" OR fami...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the average, maximum and total revenues of all companies?### Response: SELECT avg(revenue) , max(revenue) , sum(revenue) FROM manufacturers.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the ids of the employees who does not work in those departments where some employees works whose manager id within the range 100 and 200.### Response: SELECT * FROM employees WHERE departme...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the top 3 wineries with the greatest number of wines made of white color grapes.### Response: SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which role is most common for the staff?### Response: SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of departments that are located in Houston.### Response: SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houst...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the ids for all the faculty members who have at least 2 students.### Response: SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING coun...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the department that has the largest number of students enrolled?### Response: SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN c...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average age and experience working length of journalists working on different role type.### Response: SELECT avg(t1.age) , avg(Years_working) , t2.work_type FROM journalist AS t1 JOIN...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the customers who have order status both "On Road" and "Shipped".### Response: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average ROM size of phones produced by the company named "Nokia Corporation"?### Response: SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the ids of the students who participate in Canoeing and Kayaking.### Response: SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many characteristics does the product named "sesame" have?### Response: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.pro...
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 has the largest number of followers.### Response: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1.
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: How many documents can one grant have at most? List the grant id and number.### Response: SELECT grant_id , count(*) FROM Documents GROUP BY grant_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 first name of student who is taking classes from accounting and Computer Info. Systems departments### Response: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num =...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find names of all students who took some course and got A or C.### Response: SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average points of players from club with name "AIB".### Response: SELECT avg(T2.Points) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "AIB".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the organisation type description of the organisation detailed as 'quo'.### Response: SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.or...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the game name that has most number of hours played.### Response: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of the school with the smallest enrollment.### Response: SELECT school_name FROM school ORDER BY enrollment LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List countries that have more than one swimmer.### Response: SELECT nationality , count(*) FROM swimmer GROUP BY nationality HAVING count(*) > 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the dates of assessment notes for students with first name "Fanny".### Response: SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id W...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which accelerator name contains substring "Opera"?### Response: SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the personal name, family name, and author ID of the course author that teaches the most courses.### Response: SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is "the date in location from" and "the date in location to" for the document with name "Robin CV"?### Response: SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locat...
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 at least two products.### Response: SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*) >= 2.
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: What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code.### Response: SELECT T1.cmi_cross_ref_id , T1.source_sys...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last names of all the teachers that teach GELL TAMI.### Response: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "GELL" A...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name and phone for customers with a mailshot with outcome code 'No Response'.### Response: SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T...
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: How many clubs does the student named "Eric Tai" belong to?### Response: SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the details of all the distinct customers who have orders with status "On Road".### Response: SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names of students whose first names contain letter "a".### Response: SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the heights of body builders with total score smaller than 315?### Response: SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids of the movies that are not reviewed by Brittany Harris.### Response: SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many donors have endowment for school named "Glenn"?### Response: SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.scho...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the minimum amount of transactions whose type code is "PUR" and whose share count is bigger than 50.### Response: SELECT min(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all every engineer's first name, last name, details and coresponding skill description.### Response: SELECT T1.first_name , T1.last_name , T1.other_details , T3.skill_description FROM Ma...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the party of the representative that has the smallest number of votes.### Response: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Represent...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which major has between 2 and 30 number of students? List major and the number of students.### Response: SELECT Major , count(*) FROM Student GROUP BY Major HAVING count(Major) BETWEEN 2 AND 30...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the file size and format for all songs that have resolution lower than 800.### Response: SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id W...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total population of the top 3 districts with the largest area.### Response: SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name, address, number of students in the departments that have the top 3 highest number of students.### Response: SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 J...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the 3 highest salaries of the players in 2001?### Response: SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3;.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the booking start and end dates of the apartments with more than 2 bedrooms?### Response: SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartm...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the student ID and personal name of the student with at least two enrollments.### Response: SELECT T1.student_id , T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the title of all the albums of the artist "AC/DC".### Response: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please list the name and id of all artists that have at least 3 albums in alphabetical order.### Response: SELECT T2.Name , T1.ArtistId FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all the policy type codes associated with the customer "Dayana Robel"### Response: SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHER...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find name of the services that has never been used.### Response: SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id =...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me a list of id and status of orders which belong to the customer named "Jeramie".### Response: SELECT T2.order_id , T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of reviewers who had given higher than 3 star ratings.### Response: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of schools that have more than one donator with donation amount above 8.5.### Response: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.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: List the names of gymnasts in ascending order by their heights.### Response: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which classroom has the most students?### Response: SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many policies are listed for the customer named "Dayana Robel"?### Response: SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?### Response: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.### Response: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amen...
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 students whose age is younger than the average age.### Response: SELECT fname , lname FROM student WHERE age < (SELECT avg(age) FROM student).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the project details of the projects which did not hire any staff for a researcher role.### Response: SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Pr...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average number of followers for the users who do not have any tweet.### Response: SELECT avg(followers) FROM user_profiles WHERE UID NOT IN (SELECT UID FROM tweets).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.### Response: SELECT T1.name , T3.balance + T2.balance FR...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.### Response: SELECT...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students are enrolled in the class taught by some professor from the accounting department?### Response: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display job title and average salary of employees.### Response: SELECT job_title , AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the issue date of the volume with the minimum weeks on top?### Response: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the country of origin for the artist who made the least number of songs?### Response: SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.ar...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?### Response: SELECT T1.name FROM browser 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: Find the names of the campus which has more faculties in 2002 than every campus in Orange county.### Response: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHER...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.### Response: SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id and last name of the driver who participated in the most races after 2010?### Response: SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the pair of male and female names in all weddings after year 2014### Response: SELECT T2.name , T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show publishers that have more than one publication.### Response: SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*) > 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the company of the tallest entrepreneur.### Response: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many events had participants whose details had the substring 'Dr.'### Response: SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Particip...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: show the train name and station name for each train.### Response: SELECT T2.name , T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show ids of students who play video game and play sports.### Response: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the names of singers who are from UK and released an English song.### Response: SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOI...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which start station had the most trips starting from August? Give me the name and id of the station.### Response: SELECT start_station_name , start_station_id FROM trip WHERE start_date LIKE "8...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the product type codes which have at least two products.### Response: SELECT product_type_code FROM products GROUP BY product_type_code HAVING count(*) >= 2.