text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the id, the account name, and other account details for all accounts by the customer with first name 'Meaghan'.### Response: SELECT T1.account_id , T1.date_account_opened , T1.account_nam...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the prices of the products named "Dining" or "Trading Policy".### Response: SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of states that have more than 2 parks.### Response: SELECT state FROM park GROUP BY state HAVING count(*) > 2;.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many people whose age is greater 30 and job is engineer?### Response: SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show each apartment type code, and the maximum and minimum number of rooms for each type.### Response: SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_typ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the distinct fate of missions that involve ships with nationality "United States"### Response: SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is minimum hours of the students playing in different position?### Response: SELECT min(T2.HS) , T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the institution type with the largest number of institutions.### Response: SELECT TYPE FROM institution 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 id and surname of the driver who participated the most number of races?### Response: SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all information on the airport that has the largest number of international passengers.### Response: SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show company name and main industry without a gas station.### Response: SELECT company , main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of companies in the banking or retailing industry?### Response: SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the max, average and min training hours of all players.### Response: SELECT avg(HS) , max(HS) , min(HS) FROM Player.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the number of all customers without an account.### Response: SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the total number of rooms of all apartments with facility code "Gym".### Response: SELECT sum(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of artists who are Male and are from UK?### Response: SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the last names of the author of the paper titled "Binders Unbound"?### Response: SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the number of transactions with transaction type code "SALE" for different investors if it is larger than 0.### Response: SELECT investor_id , COUNT(*) FROM TRANSACTIONS WHERE transaction_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who is the youngest male?### Response: SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' ).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all locations and the total number of platforms and passengers for all train stations in each location.### Response: SELECT LOCATION , sum(number_of_platforms) , sum(total_passengers) FRO...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.### Response: SELECT T3.name FROM assignedto AS T1 JOIN projects AS T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display those departments where more than ten employees work who got a commission percentage.### Response: SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct)...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the items that did not receive any review.### Response: SELECT title FROM item WHERE i_id NOT IN (SELECT i_id FROM review).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of tourist attraction that Alison visited but Rosalind did not visit?### Response: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.To...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?### Response: SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of students who participate in the tryout for each college ordered by descending count.### Response: SELECT count(*) , cName FROM tryout GROUP BY cName ORDER BY count(*) DESC.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of members who did not attend any performance.### Response: SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the most common genre in all tracks?### Response: SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIM...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the response received dates for the documents described as 'Regular' or granted with more than 100?### Response: SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Type...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the student who most recently registered course 301?### Response: SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the checking balance and saving balance in the Brown’s account.### Response: SELECT T2.balance , T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.### Response: SELE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all employees in the circulation history of the document with id 1. List the employee's name.### Response: SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulat...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the nationality of the journalist with the largest number of years working?### Response: SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show ids for all employees who don't have a certificate.### Response: SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of instructors who didn't teach any courses?### Response: SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of buildings except for those having an institution founded in 2003.### Response: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and salary of the instructors who are advisors of any student from History department?### Response: SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the state and country of all cities with post code starting with 4.### Response: SELECT state_province_county , country FROM addresses WHERE zip_postcode LIKE "4%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the headquarter of the company with the largest sales?### Response: SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the employee ids for all employees with role name "Human Resource" or "Manager".### Response: SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WH...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and address of the department that has the highest number of students.### Response: SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the maximum, minimum and average market share of the listed browsers?### Response: SELECT max(market_share) , min(market_share) , avg(market_share) FROM browser.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many architects haven't built a mill before year 1850?### Response: SELECT count(*) FROM architect WHERE id NOT IN ( SELECT architect_id FROM mill WHERE built_year < 1850 );.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.### Response: SELECT organisation_details FROM Organisations AS T1 JOIN organisation_T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the student ID and login name of the student with the most course enrollments### Response: SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find how many school locations have the word 'NY'.### Response: SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the highest and lowest prices of products, grouped by and alphabetically ordered by product type?### Response: SELECT max(product_price) , min(product_price) , product_type_code FROM ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show id, first name and last name for all customers and the number of accounts.### Response: SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name , count(*) FROM Accounts AS...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id, name and nationality of the architect who built most mills?### Response: SELECT T1.id , T1.name , T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the person who has exactly one friend.### Response: SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many department stores does the store chain South have?### Response: SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_stor...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: which country did participated in the most number of Tournament competitions?### Response: SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the booking status code of the apartment with apartment number "Suite 634"?### Response: SELECT T1.booking_status_code 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: What is the title and director for the movie with highest worldwide gross in the year 2000 or before?### Response: SELECT title , director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwi...
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 staff members who reported problems from the product "rem" but not "aut"?### Response: SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JO...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of people whose age is greater than all engineers.### Response: SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer').
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the country of the airlines whose name starts with 'Orbit'.### Response: SELECT country FROM airlines WHERE name LIKE 'Orbit%'.
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 Dan or Alice.### Response: SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.frie...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.### Response: SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of journalists from "England" or "Wales".### Response: SELECT Name FROM journalist WHERE Nationality = "England" OR Nationality = "Wales".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which distinct source system code includes the substring 'en'?### Response: SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and flag of ships that are not steered by any captain with Midshipman rank.### Response: SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the nations that have more than two ships.### Response: SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the minimum salary for the departments whose average salary is above the average payment of all instructors.### Response: SELECT min(salary) , dept_name FROM instructor GROUP BY dept_name ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the color of the grape whose wine products has the highest average price?### Response: SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is employee Nancy Edwards's phone number?### Response: SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the statement id and the statement detail for the statement with most number of accounts.### Response: SELECT T1.statement_id , T2.statement_details FROM Accounts AS T1 JOIN Statements AS ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names and ids of tourist attractions that are visited at least two times.### Response: SELECT T1.Name , T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the name and id of the furniture with the highest market rate.### Response: SELECT name , furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.### Response: SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of rooms for different block code?### Response: SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockc...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the most popular full name of the actors?### Response: SELECT first_name , last_name FROM actor GROUP BY first_name , last_name ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of users who do not have a first notification of loss record.### Response: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notif...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.### Response: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which organizations are not a parent organization of others? List the organization id.### Response: SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizati...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the location code with the most documents?### Response: SELECT location_code FROM Document_locations GROUP BY location_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 maximum price and score of wines in each year?### Response: SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the cities which have more than one airport and number of airports.### Response: SELECT city , count(*) FROM airports GROUP BY city HAVING count(*) > 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id and family name of the driver who has the longest laptime?### Response: SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER ...
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: Find the name and checking balance of the account with the lowest savings balance.### Response: SELECT T1.name , T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JO...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of all the customers and staff members.### Response: SELECT customer_details FROM customers UNION SELECT staff_details FROM staff.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List three countries which are the origins of the least players.### Response: SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) ASC LIMIT 3;.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and partition id for users who tweeted less than twice.### Response: SELECT T1.name , T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.ui...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many times does ROY SWEAZY has reserved a room.### Response: SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY";.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of routes whose destination airports are in Canada.### Response: SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada'.
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: Show the station name with greatest number of trains.### Response: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY c...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names of technicians in ascending order of quality rank of the machine they are assigned.### Response: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all player names who have an overall rating higher than the average.### Response: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.play...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of employees with role name Editor.### Response: SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Editor".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names of the faculty members who participate in Canoeing and Kayaking.### Response: SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the ids and names of festivals that have at least two nominations for artworks.### Response: SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the candidates whose oppose percentage is the lowest for each sex.### Response: SELECT t1.name , t1.sex , min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and price of the product that has been ordered the greatest number of times.### Response: SELECT t1.product_name , t1.product_price FROM products AS t1 JOIN regular_order_product...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show id, first and last names for all customers with at least two cards.### Response: SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Customers_cards AS T1 JOIN Cus...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of all left-footed players who have overall rating between 85 and 90.### Response: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the employee first names and ids of employees who serve at least 10 customers.### Response: SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.Suppo...