text2SQL stringlengths 192 7.27k |
|---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the 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: What is the first and last name of the faculty participating in the most activities?### Response: SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?### 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: 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: What is the average age of the members of the club "Bootup Baltimore"?### Response: SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the wines that have prices higher than 50 and made of Red color grapes?### Response: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the department id and the total salary for those departments which contains at least two employees.### Response: SELECT department_id , SUM(salary) FROM employees GROUP BY department_id... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the name and location of the cinema with the largest capacity?### Response: SELECT name , LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of customers who use Credit Card payment method and have more than 2 orders.### Response: SELECT T1.customer_name 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: List the names of departments where some physicians are primarily affiliated with.### Response: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.dep... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the first name and last name employee helps the customer with first name Leonie?### Response: SELECT T2.FirstName , T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the city_code of the city that the most students live in?### Response: SELECT city_code FROM STUDENT GROUP BY city_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 are the names of representatives in descending order of votes?### Response: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORD... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the role of the employee named Koby?### Response: SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby";. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the tryout players who are from the college with largest size.### Response: SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the last name of female (sex is F) students in the descending order of age.### Response: SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which major has most number of students?### Response: SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids and names of the architects who built at least 3 bridges ?### Response: SELECT T1.id , T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.i... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id, name and IATA code of the airport that had most number of flights?### Response: SELECT T1.id , T1.name , T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.### Response: SELECT T1.company_id , T1.company_name FRO... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many games are free of injury accidents?### Response: SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident ). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city is the headquarter of the store named "Blackville" in?### Response: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN distric... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average age of students who live in the city with code "NYC" and have secretary votes in the spring election cycle.### Response: SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD... |
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: What is the oldest log id and its corresponding problem id?### Response: SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of the top 10 airlines that operate the most number of routes.### Response: SELECT T1.name , T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is Astrid Gruber's email and phone number?### Response: SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?### Response: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campu... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the role name and role description for employee called Ebba?### Response: SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_cod... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which allergy type has least number of allergies?### Response: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1. |
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: Show the locations of schools that have more than 1 player.### Response: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUN... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the position of players with average number of points scored by players of that position bigger than 20.### Response: SELECT POSITION FROM player GROUP BY name HAVING avg(Points) >= 20. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of male (sex is 'M') students who have some food type allery.### Response: SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show party names and the number of events for each party.### Response: SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which events have the number of notes between one and three? List the event id and the property id.### Response: SELECT T1.Customer_Event_ID , T1.property_id FROM Customer_Events AS T1 JOIN Cu... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many accounts have a savings balance above the average savings balance?### Response: SELECT count(*) FROM savings WHERE balance > (SELECT avg(balance) FROM savings). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the transaction type descriptions and dates if the share count is smaller than 10.### Response: SELECT T1.transaction_type_description , T2.date_of_transaction FROM Ref_Transaction_Types A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the customer last name, id and phone number with most number of orders?### Response: SELECT T2.customer_last_name , T1.customer_id , T2.phone_number FROM Orders AS T1 JOIN Customers AS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the maximum duration and resolution of songs grouped and ordered by languages?### Response: SELECT max(T1.duration) , max(T2.resolution) , T2.languages FROM files AS T1 JOIN song AS T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the entrepreneur with the greatest weight?### Response: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of customers whose name contains "Diana".### Response: SELECT customer_details FROM customers WHERE customer_details LIKE "%Diana%". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of department where has the smallest number of professors?### Response: SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the ids and names of members who are under age 30 or with black membership card.### Response: SELECT name , member_id FROM member WHERE Membership_card = 'Black' OR age < 30. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which district has the largest population?### Response: SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the coupon amount of the coupons owned by both good and bad customers?### Response: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupo... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total saving balance for each account name.### Response: SELECT sum(T2.balance) , T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the ids for all the faculty members who have at least 2 students.### Response: SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING coun... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the wrestler with the fewest days held?### Response: SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city has the most customers living in?### Response: SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.addres... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and salary of instructors who are advisors of the students from the Math department.### Response: SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id =... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the distinct name of customers whose order status is Pending, in the order of customer id.### Response: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON... |
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 made the order with the largest quantity?### Response: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.cust... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name.### Response: SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Return the text of tweets about the topic 'intern'.### Response: SELECT text FROM tweets WHERE text LIKE '%intern%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.### Response: SELECT * FROM employees WHER... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the number of rooms for different block code?### Response: SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockc... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average and minimum price of the rooms in different decor.### Response: SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor;. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many events had participants whose details had the substring 'Dr.'### Response: SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Particip... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average age of students living in each dorm and the name of dorm.### Response: SELECT avg(T1.age) , T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN do... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average access count of documents with the least popular structure.### Response: SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: When did customer with first name as Carole and last name as Bernhard became a customer?### Response: SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bern... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the movie produced after 2000 and directed by James Cameron?### Response: SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the common login name of course authors and students.### Response: SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?### Response: SELECT count(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of the tourist attractions Vincent and Marcelle visit?### Response: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attractio... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.### Response: SELECT Investor FROM entrepreneur WHERE Money_Requested... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the id, genre and artist name of English songs ordered by rating.### Response: SELECT f_id , genre_is , artist_name FROM song WHERE languages = "english" ORDER BY rating. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.### Response: SELECT Nationality FROM journalist WHERE Years_work... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the list of attribute data types possessed by more than 3 attribute definitions.### Response: SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the distinct apartment numbers of the apartments that have bookings with status code "Confirmed".### Response: SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names of all directors whose movies are rated by Sarah Martinez.### Response: SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance.### Response: SELECT T1.name , T2.balance + T3.balance FROM a... |
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 browser that is compatible with the most web accelerators?### Response: SELECT T1.id , T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the description and code of the attraction type most tourist attractions belong to.### Response: SELECT T1.Attraction_Type_Description , T2.Attraction_Type_Code FROM Ref_Attraction_Types A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the first and last name for those employees who works either in department 70 or 90?### Response: SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the cities which were once a host city after 2010?### Response: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.### Response: SELECT fname , lname FROM student WHERE city_code != 'H... |
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.### Response: SELECT T1.Product_Name FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.P... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many female students (sex is F) whose age is below 25?### Response: SELECT count(*) FROM student WHERE sex = 'F' AND age < 25. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the card type code with most number of cards?### Response: SELECT card_type_code FROM Customers_cards GROUP BY card_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: Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.### Response: SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show all locations which don't have a train station with at least 15 platforms.### Response: SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name of students who are living in the dorm that has most number of amenities.### Response: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the ids of the top three products that were purchased in the largest amount?### Response: SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3. |
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), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is "PUR"?### Response: SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTI... |
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 which did not hire any staff for a researcher role.### Response: SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Pr... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many services has each resident requested? List the resident id, details, and the count in descending order of the count.### Response: SELECT T1.resident_id , T1.other_details , count(*) F... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: 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: Return the maximum and minimum population among all counties.### Response: SELECT max(Population) , min(Population) FROM county. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of persons who are friends with Bob.### Response: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many songs have 4 minute duration?### Response: SELECT count(*) FROM files WHERE duration LIKE "4:%". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the issue dates of volumes associated with the artist "Gorgoroth"?### Response: SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the semester and year which has the least number of student taking any class.### Response: SELECT semester , YEAR FROM takes GROUP BY semester , YEAR ORDER BY count(*) LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city does student Linda Smith live in?### Response: SELECT city_code FROM Student WHERE Fname = "Linda" AND Lname = "Smith";. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the wines that have prices higher than 50 and made of Red color grapes?### Response: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the status of the city that has hosted the greatest number of competitions.### Response: SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of medication used on the patient who stays in room 111?### Response: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name and gender of the student who has allergy to milk but not cat.### Response: SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.