text2SQL
stringlengths
192
7.27k
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me the maximum low temperature and average precipitation at the Amersham station.### Response: SELECT max(t1.low_temperature) , avg(t1.precipitation) FROM weekly_weather AS t1 JOIN station...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many lesson does customer with first name Ray took?### Response: SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total and maximum duration of trips with bike id 636?### Response: SELECT sum(duration) , max(duration) FROM trip WHERE bike_id = 636.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the rooms of faculties with rank professor who live in building NEB.### Response: SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of each user and number of tweets tweeted by each of them.### Response: SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What document types have more than 2 corresponding documents?### Response: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names of technicians and the number of machines they are assigned to repair.### Response: SELECT T2.Name , COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the items that did not receive any review.### Response: SELECT title FROM item WHERE i_id NOT IN (SELECT i_id FROM review).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Are the customers holding coupons with amount 500 bad or good?### Response: SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE...
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: List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.### Response: SELECT document_type_code , document_name , document...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: find the program owners that have some programs in both morning and night time.### Response: SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee.### Response: SELECT T2.first_name , T2.last_name , count(T1.repo...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.### Response: SELECT count(*) , T1.claim_id FROM Claims AS T1 JOIN Settl...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which classes have more than two captains?### Response: SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of clubs that do not have any players.### Response: SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?### Response: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.c...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which three cities have the largest regional population?### Response: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show ids for all transactions whose amounts are greater than the average.### Response: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amou...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of wines that are more expensive then all wines made in the year 2006?### Response: SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find id of the candidate who most recently accessed the course?### Response: SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many tracks belong to rock genre?### Response: SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the distinct names of all songs that have a higher resolution than some songs in English.### Response: SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT min(resolution) FROM ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which game type has most number of games?### Response: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the average and maximum damage for all storms with max speed higher than 1000.### Response: SELECT avg(damage_millions_USD) , max(damage_millions_USD) FROM storm WHERE max_speed > 1000.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the region name with at least two storms.### Response: SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING count(*...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List all the username and passwords of users with the most popular role.### Response: SELECT user_name , password FROM users GROUP BY role_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: What is the campus fee of "San Francisco State University" in year 2000?### Response: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San ...
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 people who payed more than the rooms' base prices.### Response: SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.Roo...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the department name and number of employees in each of the department.### Response: SELECT T2.department_name , COUNT(*) 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: What are the names and ids of customers whose address contains TN?### Response: SELECT customer_name , customer_id FROM customers WHERE customer_address LIKE "%TN%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the most common publication date.### Response: SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which film has the most number of actors or actresses? List the film name, film id and description.### Response: SELECT T2.title , T2.film_id , T2.description FROM film_actor AS T1 JOIN film A...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of members whose country is "United States" or "Canada".### Response: SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the total number of rooms of the apartments in the building with short name "Columbus Square".### Response: SELECT sum(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the payment method of the customer that has purchased the least quantity of items?### Response: SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the customer that has purchased the most items?### Response: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the first names and last names of the students that minor in the department with DNO 140.### Response: SELECT T2.Fname , T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name of student who is taking classes from accounting and Computer Info. Systems departments### Response: SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num =...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who has a friend that is from new york city?### Response: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the first name, last name and id of the player with the most all star game experiences? Also list the count.### Response: SELECT T1.name_first , T1.name_last , T1.player_id , count(*...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of amenity that is most common in all dorms.### Response: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the flight number of flights with three lowest distances.### Response: SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3.
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: Find the title of all the albums of the artist "AC/DC".### Response: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "AC/DC".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many degrees were conferred in "San Jose State University" in 2000?### Response: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose St...
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...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the students who have more than one advisor?### Response: SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the most common type of artworks.### Response: SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the all the distinct names of the products with the characteristic name 'warm'.### Response: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.pro...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the dates of transactions with at least 100 share count or amount bigger than 100?### Response: SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_tran...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which document has the most draft copies? List its document id and number of draft copies.### Response: SELECT document_id , count(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY co...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city does staff with first name as Janessa and last name as Sawayn live?### Response: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.f...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of people that are on affirmative side of debates with number of audience bigger than 200.### Response: SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the id and name of customers whose address contains WY state and do not use credit card for payment.### Response: SELECT customer_id , customer_name FROM customers WHERE customer_address L...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the theme for exhibitions with both records of an attendance below 100 and above 500.### Response: SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the building full names that contain the word "court"?### Response: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%".
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the most common occupation of players.### Response: SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which type of policy is most frequently used? Give me the policy type code.### Response: SELECT policy_type_code FROM policies GROUP BY policy_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: What is the campus fee of "San Francisco State University" in year 1996?### Response: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Fra...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each product which has problems, what are the number of problems and the product id?### Response: SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the locations that are shared by more than two wrestlers.### Response: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the document name and the document date for all documents on project with details 'Graph Database project'.### Response: SELECT document_name , document_date FROM Documents AS T1 JOIN proj...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids, names and genders of the architects who built two bridges or one mill?### Response: SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2....
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 are located in San Francisco and have average bike availability above 10.### Response: SELECT id FROM station WHERE city = "San Francisco" INTERSECT SELECT st...
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 dorms that do not have amenity TV Lounge.### Response: SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JO...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the order id and order details for the order more than two invoices.### Response: SELECT T2.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the busiest destination 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.dst_apid WHERE T1.country = '...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all the locations where some cinemas were opened in both year 2010 and year 2011.### Response: SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name, location and seating for the most recently opened track?### Response: SELECT name , LOCATION , seating FROM track ORDER BY year_opened DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Please show the themes of competitions with host cities having populations larger than 1000.### Response: SELECT T2.Theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_ci...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many accelerators are not compatible with the browsers listed ?### Response: SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_b...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many products have a price higher than the average?### Response: SELECT count(*) FROM products WHERE product_price > (SELECT avg(product_price) FROM products).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?### Response: SELECT document_name , access_count ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.### Response: SELECT departure_date , arrival_date FROM Flight WHERE origin = "Los Angeles" AND destin...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the movie titles and average rating of the movies with the lowest average rating?### Response: SELECT T2.title , avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID G...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which head's name has the substring 'Ha'? List the id and name.### Response: SELECT head_id , name FROM head WHERE name LIKE '%Ha%'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the studios which average gross is above 4500000.### Response: SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the distinct names of mountains climbed by climbers from country "West Germany".### Response: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountai...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total population of the districts where the area is bigger than the average city area.### Response: SELECT sum(city_population) FROM district WHERE city_area > (SELECT avg(city_area) ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the home city with the most number of drivers.### Response: SELECT home_city FROM driver GROUP BY home_city ORDER BY count(*) DESC LIMIT 1.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the 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: How many products were not included in any order?### Response: SELECT count(*) FROM products WHERE product_id NOT IN ( SELECT product_id FROM Order_items ).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of party with most number of members?### Response: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY count(*) ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the completion dates of all the tests that have result "Fail"?### Response: SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registr...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names of shops that have more than one kind of device in stock.### Response: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COU...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the start date and end date of the booking that has booked the product named 'Book collection A'?### Response: SELECT T3.booking_start_date , T3.booking_end_date FROM Products_for_hir...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what is the full name and id of the college with the largest number of baseball players?### Response: SELECT T1.name_full , T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.coll...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all product names and the number of customers having an order on each product.### Response: SELECT T2.product_name , count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id =...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many courses that do not have prerequisite?### Response: SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq).
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many airports haven't the pilot 'Thompson' driven an aircraft?### Response: SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' );.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students enrolled in class ACCT-211?### Response: SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: find the full name of employees who report to Nancy Edwards?### Response: SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_na...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of products that are in at least two events in ascending alphabetical order of product name.### Response: SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: what are the name of players who get more than the average points.### Response: SELECT name FROM player WHERE points > (SELECT avg(points) FROM player).
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 advising more than one student.### Response: SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) >...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the number of male and female assistant professors.### Response: SELECT sex , count(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex.
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the ids of the problems that are reported by the staff whose last name is Bosco.### Response: SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff...
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the student id of the oldest student.### Response: SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student).