text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the teams of the players with the top 5 largest ages.### Response: SELECT Team FROM player ORDER BY Age DESC LIMIT 5.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which film has the most copies in the inventory? List both title and id.### Response: SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total kills of the perpetrators with height more than 1.84.### Response: SELECT sum(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Heig...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the zip code of the address where the teacher with first name "Lyla" lives?### Response: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of professors in accounting department.### Response: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the title, credit, and department name of courses that have more than one prerequisites?### Response: SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the first names and last names of customers without any account.### Response: SELECT customer_first_name , customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name , T1.cust...
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 all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.### Response: SELECT Hardware_Model_name , Company_name FROM phone WHERE Accred...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which districts have at least two addresses?### Response: SELECT district FROM address GROUP BY district HAVING count(*) >= 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of track with most number of races.### Response: SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_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: 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 id and name of the staff who has been assigned for the shortest period.### Response: SELECT T1.staff_id , T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.s...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the email of the student with first name "Emma" and last name "Rohan"?### Response: SELECT email_address FROM Students WHERE first_name = "Emma" AND last_name = "Rohan".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the forename and surname of the driver who has the smallest laptime?### Response: SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid OR...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is average age of male for different job title?### Response: SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the top 5 genres by number of tracks. List genres name and total tracks.### Response: SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the first and last name, department, city, and state province for each employee.### Response: SELECT T1.first_name , T1.last_name , T2.department_name , T3.city , T3.state_province F...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the busiest source airport that runs most number of routes in China.### Response: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the average and minimum age of captains in different class?### Response: SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.### Response: SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?### Response: SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM re...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the title of the course that is offered by more than one department.### Response: SELECT title FROM course GROUP BY title HAVING count(*) > 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which store owns most items?### Response: SELECT store_id FROM inventory GROUP BY store_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 are the birth places that are shared by at least two people?### Response: SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the appelations that produce wines after the year of 2008 but not in Central Coast area.### Response: SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATI...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names and main services for train stations that have the top three total number of passengers.### Response: SELECT name , main_services FROM station ORDER BY total_passengers DESC LIMI...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and local authority of the station with has the highest average high temperature.### Response: SELECT t2.id , t2.local_authority FROM weekly_weather AS t1 JOIN station 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 first names and last names of male (sex is M) faculties who live in building NEB.### Response: SELECT Fname , Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.### Response: SELECT cName FROM College WHERE enr > 18000 ORDER BY cName.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which department has more than 1 head at a time? List the id, name and the number of heads.### Response: SELECT T1.department_id , T1.name , count(*) FROM management AS T2 JOIN department AS T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the student ID and middle name for all the students with at most two enrollments.### Response: SELECT T1.student_id , T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me the product type, name and price for all the products supplied by supplier id 3.### Response: SELECT T2.product_type_code , T2.product_name , T2.product_price FROM product_suppliers AS...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name for regions not affected.### Response: SELECT region_name FROM region WHERE region_id NOT IN (SELECT region_id FROM affected_region).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the addresses of the buildings that have apartments with more than 2 bathrooms.### Response: SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_i...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the emails of customers who has filed a complaints of the product with the most complaints.### Response: SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first and last names of all the female (sex is F) students who have president votes.### Response: SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1....
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 is the project id and detail for the project with at least two documents?### Response: SELECT T1.project_id , T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the types of competition that have at most five competitions of that type.### Response: SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*) <= 5.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total number of products that are in orders with status "Cancelled"?### Response: SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the visit date and details of the visitor whose detail is 'Vincent'?### Response: SELECT T2.Visit_Date , T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the product that was ordered the most often?### Response: SELECT product_id FROM order_items GROUP BY product_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: Find the name of customers who are living in Colorado?### Response: SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.### Response: SELECT T3.Pilot_name , T2.Fleet_Series FROM pilot_recor...
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: Show the names of journalists and the number of events they reported.### Response: SELECT T3.Name , COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journali...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the person who has friends with age above 40 but not under age 30?### Response: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend I...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names and number of works of all artists who have at least one English songs.### Response: SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.a...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which classroom has the most students?### Response: SELECT classroom FROM list GROUP BY classroom 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 ids of all distinct customers who made order after some orders that were Cancelled.### Response: SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT min(order_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all the faculty ranks and the number of students advised by each rank.### Response: SELECT T1.rank , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.r...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the storm that affected both Afghanistan and Albania regions.### Response: SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN stor...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the physician who was trained in the most expensive procedure?### Response: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What states have at least two representatives?### Response: SELECT State FROM representative GROUP BY State 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: What are the product id and product type of the cheapest product?### Response: SELECT product_id , product_type_code FROM products ORDER BY product_price LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of dorms that do not have any amenity### Response: SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the course that has the most student enrollment?### Response: SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GR...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all of the ids for left-footed players with a height between 180cm and 190cm.### Response: SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player...
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 names of musicals and the number of actors who have appeared in the musicals.### Response: SELECT T2.Name , COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of cities in the county that has the largest number of police officers.### Response: SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name of storms which don't have affected region in record.### Response: SELECT name FROM storm WHERE storm_id NOT IN (SELECT storm_id FROM affected_region).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of routes for each source airport and the airport name.### Response: SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?### Response: SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of journalists and the names of the events they reported in ascending order### Response: SELECT T3.Name , T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Ev...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of customers using the most popular payment method?### Response: SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY pa...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the customer that has been involved in the most policies.### Response: SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id G...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all city with a branch opened in 2001 and a branch with more than 100 membership.### Response: SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the phone number of the customer who has filed the most recent complaint?### Response: SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many restaurant is the Sandwich type restaurant?### Response: SELECT count(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of each course and the corresponding number of student enrollment?### Response: SELECT T1.course_name , COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.co...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations.### Response: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names of companies and that of employees in descending order of number of years working for that employee.### Response: SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?### Response: SELECT Adults FROM Reservations WHERE CheckIn = "2010-10-23" AND FirstName = "CONRAD" AND LastName = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which stadium name contains the substring "Bank"?### Response: SELECT name FROM stadium WHERE name LIKE "%Bank%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the customer name and date of the orders that have the status "Delivered".### Response: SELECT t1.customer_name , t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.custom...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.### Response: SELECT name , trade_name FROM medicine EXCEPT SELECT T1.name , T1.trade_name FROM...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of body builders whose total score is higher than 300?### Response: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total >...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show first name and id for all customers with at least 2 accounts.### Response: SELECT T2.customer_first_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2....
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name and country of origin of the artist who released a song that has "love" in its title?### Response: SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.ar...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).### Response: SELECT na...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the most common builder of railways.### Response: SELECT Builder FROM railway GROUP BY Builder 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 total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.### Response: SELECT sum(revenue) FROM manufacturers WHERE revenue > (SELECT min(...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many assets can each parts be used in? List the part name and the number.### Response: SELECT T1.part_name , count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GR...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each Orange county campus, report the number of degrees granted after 2000.### Response: SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the project details of the projects with the research outcome described with the substring 'Published'.### Response: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many courses are offered by the Computer Info. Systems department?### Response: SELECT count(*) FROM department AS T1 JOIN course AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the stadium which held the most events?### Response: SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY count(*) DE...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.### Response: SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are name and phone number of patients who had more than one appointment?### Response: SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.pat...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find distinct cities of address of students?### Response: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.pers...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id and name of the department store that has both marketing and managing department?### Response: SELECT T2.dept_store_id , T2.store_name FROM departments AS T1 JOIN department_stor...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the latitude, longitude, city of the station from which the shortest trip started?### Response: SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.sta...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: find the ids of reviewers who did not give 4 star.### Response: SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the most expensive hardware product.### Response: SELECT product_name FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the minimum and maximum vote percents of elections?### Response: SELECT min(Vote_Percent) , max(Vote_Percent) FROM election.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the age of the tallest person?### Response: SELECT Age FROM people ORDER BY Height DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the first name and last name for the customer with account name 900.### Response: SELECT T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.custo...