text2SQL stringlengths 192 7.27k |
|---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the booking start and end dates of the apartments with more than 2 bedrooms?### Response: SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartm... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?### Response: SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicin... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many exhibitions have a attendance more than 100 or have a ticket price below 10?### Response: SELECT count(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.e... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the details of the shops that can be accessed by walk?### Response: SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHE... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all game names played by at least 1000 hours.### Response: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING sum(hours_played) ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.### Response: SELECT T2.name FROM membership_register_branch AS T1 JOIN bra... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and id of the top 3 expensive rooms.### Response: SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: find the name of driver who is driving the school bus with the longest working history.### Response: SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER... |
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: Show the names of mountains with height more than 5000 or prominence more than 1000.### Response: SELECT Name FROM mountain WHERE Height > 5000 OR Prominence > 1000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200.### Response: SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELE... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name, age, and job title of persons who are friends with Alice for the longest years.### Response: SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.nam... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all students taught by OTHA MOYER. Output the first and last names of the students.### Response: SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the account id with most number of transactions.### Response: SELECT account_id FROM Financial_transactions GROUP BY account_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: What is zip code of customer with first name as Carole and last name as Bernhard?### Response: SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.add... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the maximum and minimum sales of the companies whose industries are not "Banking".### Response: SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != "Banking... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which major has least number of students? List the major and the number of students.### Response: SELECT Major , count(*) FROM Student GROUP BY Major ORDER BY count(Major) ASC LIMIT 1;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and capacity of the dorm with least number of amenities.### Response: SELECT T1.dorm_name , T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid J... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the characteristic name used by most number of the products?### Response: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.pro... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the most common country across members.### Response: SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of the physician who prescribed the highest dose?### Response: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the employee name ( first name and last name ) and hire date for all employees in the same department as Clara.### Response: SELECT first_name , last_name , hire_date FROM employees WH... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of instructors who are advisors of the students from the Math department, and sort the results by students' total credit.### Response: SELECT T2.name FROM advisor AS T1 JOIN instru... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the top 3 artists who have the largest number of songs works whose language is Bangla.### Response: SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_n... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.### Response: SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Dep... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and address of the customers who have both New and Pending orders.### Response: SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'?### Response: SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the organisation ids and details of the organisations which are involved in### Response: SELECT T2.organisation_id , T2.organisation_details FROM Grants AS T1 JOIN Organisations AS T2 ON T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the maximum and total number of followers of all users.### Response: SELECT max(followers) , sum(followers) FROM user_profiles. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the time of elimination of the wrestlers with largest days held.### Response: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days... |
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 the name of the department that has no students minored in?### Response: SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the most recent movie?### Response: SELECT title FROM Movie WHERE YEAR = (SELECT max(YEAR) FROM Movie). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find names of the document without any images.### Response: SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_co... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the market shares and names of furnitures which no any company is producing in our records.### Response: SELECT Market_Rate , name FROM furniture WHERE Furniture_ID NOT IN (SELECT Furnitur... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many events did not have any participants?### Response: SELECT count(*) FROM EVENTS WHERE event_id NOT IN (SELECT event_id FROM Participants_in_Events). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.### Response: SELECT T1.grant_start_date FROM Grants AS T1 JOIN Docume... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: In which year were most departments established?### Response: SELECT creation FROM department GROUP BY creation ORDER BY count(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the 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: 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: What is the name of the artist who joined latest?### Response: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id of courses which are registered or attended by student whose id is 121?### Response: SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.### Response: SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WH... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names for all aircrafts of which John Williams has certificates.### Response: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid =... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are the names and classes of the ships that do not have any captain yet?### Response: SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the countries that have managers of age above 50 or below 46.### Response: SELECT Country FROM manager WHERE Age > 50 OR Age < 46. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each building, show the name of the building and the number of institutions in it.### Response: SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the id and address of the shops which have a happy hour in May?### Response: SELECT t1.address , t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id = t2.shop_id WHERE MON... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which document type is described with the prefix 'Initial'?### Response: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the distinct leader names of colleges associated with members from country "Canada".### Response: SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the most common type code across products.### Response: SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and number of shops for the company that produces the most expensive furniture.### Response: SELECT t1.manufacturer_id , t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manuf... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the race class with at least two races.### Response: SELECT CLASS FROM race GROUP BY CLASS HAVING count(*) >= 2. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many trains have 'Express' in their names?### Response: SELECT count(*) FROM train WHERE name LIKE "%Express%". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the songs that have result "nominated" at music festivals.### Response: SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = "... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?### Response: SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN m... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names, color descriptions and product descriptions of products with category "Herbs".### Response: SELECT T1.product_name , T2.color_description , T1.product_description FROM products... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total amount claimed in the most recently created document.### Response: SELECT sum(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of clubs that have players with position "Right Wing".### Response: SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show publishers with a book published in 1989 and a book in 1990.### Response: SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.### Response: SELECT T1.fname , T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of ships that are not involved in any mission### Response: SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id of routes whose source and destination airports are in the United States.### Response: SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United S... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many distinct locations have the things with service detail 'Unsatisfied' been located in?### Response: SELECT count(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Thin... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which months have more than 2 happy hours?### Response: SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*) > 2. |
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: Return the unique name for stations that have ever had 7 bikes available.### Response: SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_avai... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students are enrolled in the class taught by some professor from the accounting department?### Response: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id of the order which is shipped most recently.### Response: SELECT order_id FROM shipments WHERE shipment_date = (SELECT max(shipment_date) FROM shipments). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the hometowns shared by people older than 23 and younger than 20.### Response: SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many settlements does each claim correspond to? List the claim id and the number of settlements.### Response: SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.cl... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are the event details of the services that have the type code 'Marriage'?### Response: SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the full name (first and last name), and salary of those employees who working in any department located in London.### Response: SELECT first_name , last_name , salary FROM employees A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the project detail for the project with document "King Book"?### Response: SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me the start station and end station for the trips with the three oldest id.### Response: SELECT start_station_name , end_station_name FROM trip ORDER BY id LIMIT 3. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is title of album which track Balls to the Wall belongs to?### Response: SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall";. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of catalog entries with level number 8.### Response: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which contact channel has been used by the customer with name "Tillman Ernser"?### Response: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the ids of the problems from the product "voluptatem" that are reported after 1995?### Response: SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all the stores in the district with the most population.### Response: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (S... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name and office of the professor who is in the history department and has a Ph.D. degree.### Response: SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names for artists without any exhibition.### Response: SELECT name FROM artist WHERE artist_id NOT IN (SELECT artist_id FROM exhibition). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the sale details and dates of transactions with amount smaller than 3000?### Response: SELECT T1.sales_details , T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.s... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last names of faculties in building Barton in alphabetic order.### Response: SELECT Lname FROM FACULTY WHERE Building = "Barton" ORDER BY Lname. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Eduardo Martins is a customer at which company?### Response: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show student ids who don't have any sports.### Response: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the customers who have at most two orders.### Response: SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the object number of railways that do not have any trains.### Response: SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all headquarters with both a company in banking industry and a company in Oil and gas.### Response: SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headq... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first name and job id for all employees in the Finance department?### Response: SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.### Response: SELECT T1.claim_id , T1.date_claim_made , T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of patients who are not using the medication of Procrastin-X.### Response: SELECT count(*) FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the game name that has most number of hours played.### Response: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.### Response: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the "active to date" of the latest contact channel used by "Tillman Ernser"?### Response: SELECT max(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.cu... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average number of followers for the users who had some tweets.### Response: SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of schools with the top 3 largest size?### Response: SELECT cName FROM college ORDER BY enr DESC LIMIT 3. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is detail of the student who most recently registered course?### Response: SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.studen... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the train whose route runs through greatest number of stations.### Response: SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER... |
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. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.