text2SQL stringlengths 192 7.27k |
|---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?### Response: SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br... |
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: What is the payment method code used by the most orders?### Response: SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last and first name of students who are playing Football or Lacrosse.### Response: SELECT T2.lname , T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the students who are in the position of striker and got a yes tryout decision.### Response: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.de... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids and details of events that have more than one participants?### Response: SELECT T1.event_id , T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_I... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and city of the airport which is the destination of the most number of routes.### Response: SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.api... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the dates of enrollment and completion of the student with personal name "Karson".### Response: SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the most common headquarter for companies.### Response: SELECT Headquarters FROM company GROUP BY Headquarters 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 accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.### Response: SELECT name , operating_system FROM web_client_accelerator EXCEP... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of wines that are more expensive then all wines made in the year 2006?### Response: SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006). |
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 most once.### Response: SELECT T1.Name , T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Touris... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of account that has the lowest total checking and saving balance.### Response: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all characteristics of product named "sesame" with type code "Grade".### Response: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who are the top 3 players in terms of overall rating?### Response: SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY... |
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: How many tourists did not make any visit?### Response: SELECT count(*) FROM Visitors WHERE Tourist_ID NOT IN ( SELECT Tourist_ID FROM Visits ). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the category descriptions of the products whose descriptions include letter 't'.### Response: SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total amount of money spent by Lucas Mancini?### Response: SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the number of invoices from the US, grouped by state.### Response: SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the school name and driver name for all school buses.### Response: SELECT T2.school , T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average rating star for each movie that received at least 2 ratings.### Response: SELECT mID , avg(stars) FROM Rating GROUP BY mID HAVING count(*) >= 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List each donator name and the amount of endowment in descending order of the amount of endowment.### Response: SELECT donator_name , sum(amount) FROM endowment GROUP BY donator_name ORDER BY s... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all flight numbers with aircraft Airbus A340-300.### Response: SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who has friends that are younger than the average age?### Response: SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) F... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many lesson does customer with first name Ray took?### Response: SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.### Response: SELECT lname , sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find number of products which Sony does not make.### Response: SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manu... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?### Response: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < (SELECT m... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many artists are above age 46 and joined after 1990?### Response: SELECT count(*) FROM artist WHERE age > 46 AND year_join > 1990. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names and ids of stations that had more than 14 bikes available on average or were installed in December?### Response: SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 O... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which last names are both used by customers and by staff?### Response: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of trains for each station, as well as the station network name and services.### Response: SELECT count(*) , t1.network_name , t1.services FROM station AS t1 JOIN route AS t2 O... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of all modern rooms with a base price below $160 and two beds.### Response: SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern';. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Select the name and price of the cheapest product.### Response: SELECT name , price FROM Products ORDER BY price ASC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the building full names that contain the word "court"?### Response: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%". |
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.### Response: SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phon... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many enzymes do not have any interactions?### Response: SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction );. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the residences that have at least two players.### Response: SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many products are never booked with amount higher than 200?### Response: SELECT count(*) FROM Products_for_hire WHERE product_id NOT IN ( SELECT product_id FROM products_booked WHERE booked_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which game type has least number of games?### Response: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the product with the highest height? Give me the catalog entry name.### Response: SELECT catalog_entry_name FROM catalog_contents ORDER BY height 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 professors with a Ph.D. degree in each department.### Response: SELECT count(*) , dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the youngest captain?### Response: SELECT name FROM captain ORDER BY age LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.### Response: SELECT lname FROM student WHERE sex = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the authors who do not have submission to any workshop.### Response: SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average and minimum age of all artists from United States.### Response: SELECT avg(age) , min(age) FROM artist WHERE country = 'United States'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.### Response: SELECT DISTINCT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009.### Response: SELECT avg(ticket_price) , min(ticket_price) , max(ticket_price) FROM exhibition WH... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?### Response: SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand =... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the emails of parties with the most popular party form.### Response: SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SEL... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the name and gender of the staff who was assigned in 2016.### Response: SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the race held most recently?### Response: SELECT name FROM races ORDER BY date DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the cell mobile number of the candidates whose assessment code is "Fail"?### Response: SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of perpetrators whose country is not "China"?### Response: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country != "China"... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.### Response: SELECT rank , company , market_value FROM company... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the problem log that is created most recently?### Response: SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the title of course that is provided by Statistics but not Psychology departments.### Response: SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHE... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the residences that have both a player of gender "M" and a player of gender "F".### Response: SELECT Residence FROM player WHERE gender = "M" INTERSECT SELECT Residence FROM player WHERE ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of the shop that has the most kind of devices in stock.### Response: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find Alice's friends of friends.### Response: SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN Perso... |
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: What is the total number of people who has no friend living in the city of Austin.### Response: SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE c... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names and offices of all professors sorted by alphabetical order of their first name.### Response: SELECT T2.emp_fname , T1.prof_office FROM professor AS T1 JOIN employee AS T2 O... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many distinct delegates are from counties with population larger than 50000?### Response: SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.Dist... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: When was the school with the largest enrollment founded?### Response: SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the first and last name of the students who do not have any food type allergy.### Response: SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which part has the least chargeable amount? List the part id and amount.### Response: SELECT part_id , chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who are the friends of Bob?### Response: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the total scores of the body builders whose birthday contains the string "January" ?### Response: SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the total number of Domestic Passengers of airports that contain the word "London".### Response: SELECT sum(Domestic_Passengers) FROM airport WHERE Airport_Name LIKE "%London%". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of customers who do not have an saving account.### Response: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the dates on which more than one revisions were made.### Response: SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*) > 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many artists are above age 46 and joined after 1990?### Response: SELECT count(*) FROM artist WHERE age > 46 AND year_join > 1990. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the the grape whose white color grapes are used to produce wines with scores higher than 90.### Response: SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many airports haven't the pilot 'Thompson' driven an aircraft?### Response: SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' );. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the distinct names of all songs that have a higher resolution than some songs in English.### Response: SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT min(resolution) FROM ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of checking accounts for each account name.### Response: SELECT count(*) , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the saving balance of the account with the highest checking balance.### Response: SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each state, find the total account balance of customers whose credit score is above 100.### Response: SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the categories of the music festivals with count more than 1.### Response: SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the ages of gymnasts in descending order of total points.### Response: SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC. |
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: List the names of the customers who have once bought product "food".### Response: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name and id of the team offering the lowest average salary?### Response: SELECT T1.name , T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_i... |
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: Find the department name of the instructor whose name contains 'Soisalon'.### Response: SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which engineer has visited the most times? Show the engineer id, first name and last name.### Response: SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JO... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the states which do not have any employee in their record.### Response: SELECT state_province_county FROM addresses WHERE address_id NOT IN (SELECT employee_address_id FROM Employees). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the ships that have more than one captain.### Response: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of department that offers the class whose description has the word "Statistics".### Response: SELECT T2.dept_name FROM course AS T1 JOIN department AS T2 ON T1.dept_code = T2.dep... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total number of students and total number of instructors for each department.### Response: SELECT count(DISTINCT T2.id) , count(DISTINCT T3.id) , T3.dept_name FROM department AS T1 JO... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all the locations where no cinema has capacity over 800.### Response: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all open years when at least two shops are opened.### Response: SELECT open_year FROM branch GROUP BY open_year HAVING count(*) >= 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?### Response: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of complaints with Product Failure type for each complaint status.### Response: SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = "Product Fa... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the ids of the investors who have at least two transactions.### Response: SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the marketing region that the store Rob Dinning belongs to?### Response: SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of editors that are on at least two journal committees.### Response: SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Nam... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which catalog publisher has published the most catalogs?### Response: SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.