text2SQL stringlengths 192 7.27k |
|---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show id and location of railways that are associated with more than one train.### Response: SELECT T2.Railway_ID , T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railwa... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and nationality of the swimmer who has won (i.e., has a result of "win") more than 1 time.### Response: SELECT t1.name , t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name of students living in city PHL whose age is between 20 and 25.### Response: SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the headquarters that have at least two companies.### Response: SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2. |
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: which gender got the highest average uncertain ratio.### Response: SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_ra... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.### Response: SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average height and weight for all males (sex is M).### Response: SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which building does the instructor who teaches the most number of courses live in?### Response: SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the payment method of the customer that has purchased the least quantity of items?### Response: SELECT t1.payment_method FROM customers AS t1 JOIN customer_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: How many products were not included in any order?### Response: SELECT count(*) FROM products WHERE product_id NOT IN ( SELECT product_id FROM Order_items ). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?### Response: SELECT customer_status_code , cell_mobile_phone_number ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?### Response: SELECT T1.forename , T1.surname , T1.driverid FROM driver... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which state has the most customers?### Response: SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the average, maximum, and minimum number of floors for all buildings?### Response: SELECT avg(floors) , max(floors) , min(floors) FROM building. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the most common birth place of people?### Response: SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.### Response: SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TY... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of countries that have more than one roller coaster.### Response: SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name H... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name and open year for the branch with most number of memberships registered in 2016?### Response: SELECT T2.name , T2.open_year FROM membership_register_branch AS T1 JOIN branch AS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the title and maximum price of each film?### Response: SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which room has cheapest base price? List the room's name and the base price.### Response: SELECT roomName , basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.### Response: SELECT RESULT , COUNT(*) FROM music_festival GROUP BY RESULT... |
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: How many players born in USA are right-handed batters? That is, have the batter value 'R'.### Response: SELECT count(*) FROM player WHERE birth_country = 'USA' AND bats = 'R';. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many female students have milk or egg allergies?### Response: SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of member in charge of greatest number of events?### Response: SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP B... |
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 cities in all markets.### Response: SELECT max(Number_cities) , min(Number_cities) FROM market. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which country and state does staff with first name as Janessa and last name as Sawayn lived?### Response: SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all students taught by MARROTTE KIRK. Output first and last names of students.### Response: SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.cla... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many products have the characteristic named "hot"?### Response: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the customer who has the most policies listed?### Response: SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GR... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of members of club "Pen and Paper Gaming".### Response: SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What parties have at least three representatives?### Response: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the ids of all products that were ordered more than three times or supplied more than 80000.### Response: SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*) > 3 UNIO... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which college have both players with position midfielder and players with position defender?### Response: SELECT College FROM match_season WHERE POSITION = "Midfielder" INTERSECT SELECT Colleg... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first name and the last name of the customer who made the earliest rental?### Response: SELECT T1.first_name , T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me the times and numbers of all trains that go to Chennai, ordered by time.### Response: SELECT TIME , train_number FROM train WHERE destination = 'Chennai' ORDER BY TIME. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show total hours per week and number of games played for students under 20.### Response: SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.... |
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 are playing Canoeing or Kayaking.### Response: SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.f... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the appelations that produce wines after the year of 2008 but not in Central Coast area.### Response: SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the employee id of the head whose department has the least number of employees?### Response: SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the max and min grade point for all letter grade.### Response: SELECT max(gradepoint) , min(gradepoint) FROM GRADECONVERSION. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the life spans of representatives from New York state or Indiana state?### Response: SELECT Lifespan FROM representative WHERE State = "New York" OR State = "Indiana". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the title of films that do not have any market estimation.### Response: SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the apartment number with the largest number of bedrooms.### Response: SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display all the information of those employees who did not have any job in the past.### Response: SELECT * FROM employees WHERE employee_id NOT IN (SELECT employee_id FROM job_history). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of scientists involved for the projects that require more than 300 hours.### Response: SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.proj... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all city with a branch opened in 2001 and a branch with more than 100 membership.### Response: SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the description of the color for most products?### Response: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_de... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.### Response: SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and age of all males in order of their age.### Response: SELECT name FROM Person WHERE gender = 'male' ORDER BY age. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the apartment type codes and apartment numbers in the buildings managed by "Kyle".### Response: SELECT T2.apt_type_code , T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2... |
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 all the students of age 18 who have vice president votes.### Response: SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the product type whose average price is higher than the average price of all products.### Response: SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_pric... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name and country for the artist with most number of exhibitions?### Response: SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GRO... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all of the player ids with a height of at least 180cm and an overall rating higher than 85.### Response: SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_i... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the maximum, minimum and average number of used kb in screen mode.### Response: SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode;. |
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 "laurel" have?### Response: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACT... |
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... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the average share count of transactions each each investor, ordered by average share count.### Response: SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the role code with the least employees.### Response: SELECT role_code FROM Employees GROUP BY role_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: What is the name of the song that was released in the most recent year?### Response: SELECT song_name , releasedate FROM song ORDER BY releasedate 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 and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.### Response: SELECT first_name , l... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first and last name of the professor in biology department?### Response: SELECT T3.EMP_FNAME , T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_co... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and active date of the customer that use email as the contact channel.### Response: SELECT t1.customer_name , t2.active_from_date FROM customers AS t1 JOIN customer_contact_channe... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many games were played in city Atlanta in 2000?### Response: SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.### Response: SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the title, phone and hire date of Nancy Edwards?### Response: SELECT title , phone , hire_date 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: What is the most common company type, and how many are there?### Response: SELECT TYPE , count(*) FROM operate_company 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 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: Show all locations and the number of gas stations in each location ordered by the count.### Response: SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?### Response: SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT co... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many drivers are from Hartford city or younger than 40?### Response: SELECT count(*) FROM driver WHERE home_city = 'Hartford' OR age < 40. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.### Response: SELECT min(membership_amount) , max(membership_amount) FROM branch WHERE o... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50.### Response: SELECT email FROM em... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names for all females from Canada having a wedding in year 2016.### Response: SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of storms which don't have affected region in record.### Response: SELECT name FROM storm WHERE storm_id NOT IN (SELECT storm_id FROM affected_region). |
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: List the official names of cities that have not held any competition.### Response: SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are all the policy types of the customer that has the most policies listed?### Response: SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.custome... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which gender makes up the majority of the staff?### Response: SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.### Response: SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the types of documents with more than 4 documents.### Response: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the membership level with most number of members.### Response: SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY count(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the ids for projects with at least 2 documents.### Response: SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of staff who has been assigned multiple jobs.### Response: SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id GROUP BY T2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.### Response: SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names for all employees with salary more than the average.### Response: SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.### Response: SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of universities that have over a 20000 enrollment size for each affiliation type.### Response: SELECT count(*) , affiliation FROM university WHERE enrollment > 20000 GROUP BY ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of festivals that have nominated artworks of type "Program Talent Show".### Response: SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artw... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of scientists involved for each project name.### Response: SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are the average and maximum attendances of all events?### Response: SELECT avg(Event_Attendance) , max(Event_Attendance) FROM event. |
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: Find the name of the ship that is steered by the youngest captain.### Response: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age 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 of the customer who has the most orders?### Response: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.custom... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the card type codes and the number of transactions.### Response: SELECT T2.card_type_code , count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many products have the characteristic named "hot"?### Response: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the code and description of the least frequent detention type ?### Response: SELECT T1.detention_type_code , T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the location of the perpetrator with the largest kills.### Response: SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.