text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the channels that are broadcast in the morning.### Response: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the department id and the total salary for those departments which contains at least two employees.### Response: SELECT department_id , SUM(salary) FROM employees GROUP BY department_id...
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 female friends of Alice.### Response: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.### Response: SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" U...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the full name of employee who supported the most number of customers.### Response: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which team had the least number of attendances in home games in 1980?### Response: SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of rooms with more than 50 capacity for each building.### Response: SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of medication used on the patient who stays in room 111?### Response: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many courses do the student whose id is 171 attend?### Response: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all locations where a gas station for company with market value greater than 100 is located.### Response: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many games in 1885 postseason resulted in ties (that is, the value of "ties" is '1')?### Response: SELECT count(*) FROM postseason WHERE YEAR = 1885 AND ties = 1;.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the most common major among female (sex is F) students?### Response: SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.### Response: SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the largest payment amount?### Response: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of employees with three lowest salaries.### Response: SELECT name FROM Employee ORDER BY salary ASC LIMIT 3.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average sales of the journals that have an editor whose work type is 'Photo'?### Response: SELECT avg(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which cmi cross reference id is not related to any parking taxes?### Response: SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the customers who have an deputy policy.### Response: SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers 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: Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.### Response: SELECT Employees.employee_name , count(*) FROM Empl...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of the party that has at least two records.### Response: SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Retrieve the title of the paper that has the largest number of authors.### Response: SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all church names except for those that had a wedding in year 2015.### Response: SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.chu...
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: Show the account name and other account detail for all accounts by the customer with first name Meaghan and last name Keeling.### Response: SELECT T1.account_name , T1.other_account_details FRO...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome.### Response: SELECT T2.customer_name , T2.payment_method FRO...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is id of the city that hosted events in the most recent year?### Response: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many services has each resident requested? List the resident id, details, and the count in descending order of the count.### Response: SELECT T1.resident_id , T1.other_details , count(*) F...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the number of audience in year 2008 or 2010.### Response: SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the ids and names of stations from which at least 200 trips started.### Response: SELECT start_station_id , start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 20...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and last name of the student that has the most behavior incidents?### Response: SELECT T1.student_id , T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of stadiums that the most swimmers have been to.### Response: SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the starting years shared by technicians from team "CLE" and "CWS".### Response: SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the average latitude and longitude of stations located in San Jose city?### Response: SELECT avg(lat) , avg(long) FROM station WHERE city = "San Jose".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find id of the candidate whose email is stanley.monahan@example.org?### Response: SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of districts where have both city mall and village store type stores.### Response: SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names and scores of wines that are made of white color grapes?### Response: SELECT T2.Name , T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each phone, show its names and total number of stocks.### Response: SELECT T2.Name , sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_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 largest and smallest customer codes?### Response: SELECT max(customer_code) , min(customer_code) FROM Customers.
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: Find the number of routes from the United States to Canada.### Response: SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SEL...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students attend course English?### Response: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all the catalog publishers whose name contains "Murray"### Response: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of all songs that have a lower rating than some song of blues genre?### Response: SELECT song_name FROM song WHERE rating < (SELECT max(rating) FROM song WHERE genre_is = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many albums does Billy Cobham has?### Response: SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the unit of measurement and product category code of product named "chervil".### Response: SELECT t2.unit_of_measure , t2.product_category_code FROM products AS t1 JOIN ref_product_categor...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of characteristics that the product "flax" has.### Response: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARAC...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many Annual Meeting events happened in the United Kingdom region?### Response: SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many engineer visits are required at most for a single fault log? List the number and the log entry id.### Response: SELECT count(*) , T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engine...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the document with the most number of sections?### Response: SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id.### Response: SELECT T1.source_system_code , T2.council_tax_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.### Response: SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which district has the least area?### Response: SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many different roles are there in the club "Bootup Baltimore"?### Response: SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.c...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the official names of cities with population bigger than 1500 or smaller than 500.### Response: SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total number of purchases for members with level 6?### Response: SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of products that are not in any event.### Response: SELECT Product_Name FROM Products WHERE Product_ID NOT IN (SELECT Product_ID FROM Products_in_Events).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total amount of loans offered by each bank branch.### Response: SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many countries do not have an roller coaster longer than 3000?### Response: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH > 3000...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: 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: Show institution names along with the number of proteins for each institution.### Response: SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T...
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 saving balance.### Response: SELECT T2.balance , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOI...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids of stations that have latitude above 37.4 and never had bike availability below 7?### Response: SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GR...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many female people are older than 30 in our record?### Response: SELECT count(*) FROM people WHERE is_male = 'F' AND age > 30.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of route that has the highest number of deliveries.### Response: SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show student ids who are female and play football.### Response: SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = "Football".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of tracks which are in Movies playlist but not in music playlist.### Response: SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists A...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of the drivers without a school bus.### Response: SELECT name FROM driver WHERE driver_id NOT IN (SELECT driver_id FROM school_bus).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.### Response: SELECT title FROM film WHERE LENGTH > 100 OR rating ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what is id of students who registered some courses but the least number of courses in these students?### Response: SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER B...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?### Response: SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 O...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List name of all tracks in Balls to the Wall.### Response: SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall";.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the players and years played for players from team "Columbus Crew".### Response: SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the id and zip code of the address with the highest monthly rental?### Response: SELECT T2.address_id , T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are the names of the channels that broadcast in both morning and night?### Response: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the id and name of the stations that have ever had more than 12 bikes available?### Response: SELECT DISTINCT T1.id , T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.stati...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all storm names affecting region "Denmark".### Response: SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display those employees who contain a letter z to their first name and also display their last name, city.### Response: SELECT T1.first_name , T1.last_name , T3.city FROM employees AS T1 JOIN ...
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 cows across all farms.### Response: SELECT max(Cows) , min(Cows) FROM farm.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the countries that have never participated in any competition with Friendly type.### Response: SELECT country FROM competition EXCEPT SELECT country FROM competition WHERE competition_type ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: 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 state which has the most number of customers.### Response: SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) 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 swimmer who has at least 2 records.### Response: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING count(*) >= 2...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For directors who had more than one movie, return the titles and produced years of all movies directed by them.### Response: SELECT T1.title , T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.di...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the transaction type descriptions and dates if the share count is smaller than 10.### Response: SELECT T1.transaction_type_description , T2.date_of_transaction FROM Ref_Transaction_Types A...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance.### Response: SELECT T1.name FROM accounts AS T1...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what is the name and age of the youngest winning pilot?### Response: SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the storm name and max speed which affected the greatest number of regions?### Response: SELECT T1.name , T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.### Response: SELECT Employees.employee_name , count(*) FROM Empl...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms.### Response: SELECT apt_type_code , bathroom_count , bedr...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which products has been complained by the customer who has filed least amount of complaints?### Response: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size.### Response: SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the claim processing stage that most of the claims are on?### Response: SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.cla...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the placement date of the order whose invoice number is 10?### Response: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the products that are not using the most frequently-used max page size.### Response: SELECT product FROM product WHERE product != (SELECT max_page_size FROM product GROUP BY max...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of the company that produced more than one phone model.### Response: SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*) > 1;.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the city and name of bank branches that provide business loans.### Response: SELECT T1.bname , T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the themes of parties and the names of the party hosts.### Response: SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Retrieve the country that has published the most papers.### Response: SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.pa...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of all stores in Khanewal District.### Response: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_...