sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Who had a time of 56.07? | SELECT name FROM table_name_21 WHERE time = 56.07 |
What is the highest average of the contestant from Texas with an evening gown larger than 8.875? | SELECT MAX(average) FROM table_name_57 WHERE state = "texas" AND evening_gown > 8.875 |
What is the average amount of items ordered in each order? | SELECT avg(order_quantity) FROM order_items |
What are the names of all instructors who advise students in the math depart sorted by total credits of the student. | SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred |
Who is the second with a lead of Sarah Macintyre (jr) Anne Laird (w)? | SELECT second FROM table_name_78 WHERE lead = "sarah macintyre (jr) anne laird (w)" |
How many events have each participants attended? List the participant id, type and the number. | SELECT T1.Participant_ID , T1.Participant_Type_Code , count(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID |
How many people ha Romanian as their mother tongue in 2006? | SELECT MAX(population__2006_) FROM table_name_12 WHERE mother_tongue = "romanian" |
What company collaborated in non-hodgkin lymphoma? | SELECT collaboration FROM table_name_63 WHERE indication = "non-hodgkin lymphoma" |
Can you show the number of different products that are produced by companies at different headquarter cities? | SELECT count ( DISTINCT T1.name ) , T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter |
What is the full name of each student who is not allergic to any type of food. | SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") |
Name the original air date for prod code 201 | SELECT original_air_dates FROM table_2322716_2 WHERE prod_code = 201 |
What is the total number of episodes where hugh laurie was the 3rd performer? | SELECT COUNT(episode) FROM table_name_70 WHERE performer_3 = "hugh laurie" |
What is the record for the team on January 19? | SELECT record FROM table_17288825_7 WHERE date = "January 19" |
how many storms caused damage to any regions? | select count ( * ) from storm |
Calculate the average of object samples for the image. | SELECT CAST(COUNT(OBJ_SAMPLE_ID) AS REAL) / COUNT(DISTINCT IMG_ID) FROM IMG_OBJ |
Who has friends that are older than the average age? Print their friends and their ages as well | SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person) |
What is the barony for the Ballintaggart townland? | SELECT barony FROM table_30120619_1 WHERE townland = "Ballintaggart" |
What is the lowest Hong Kong value with a 0 Brisbane value and a greater than 0 Kuala Lumpur value? | SELECT MIN(hong_kong) FROM table_name_52 WHERE brisbane = 0 AND kuala_lumpur > 0 |
List the clubs having "Davis Steven" as a member. | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Davis" AND t3.lname = "Steven" |
List down product names of free gifts. | SELECT Name FROM Products WHERE Price = 0 |
List the name of musicals that do not have actors. | SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor) |
Which venue has a scoreof 2–0? | SELECT venue FROM table_name_60 WHERE score = "2–0" |
What was the score when the series was 3-2? | SELECT score FROM table_name_7 WHERE series = "3-2" |
What is the highest crowd number of the game where the away team was south melbourne? | SELECT MAX(crowd) FROM table_name_71 WHERE away_team = "south melbourne" |
What number is the Monaco Grand Prix? | SELECT rd FROM table_1132568_3 WHERE grand_prix = "Monaco grand_prix" |
How many orders that Medsep Group had made? | SELECT SUM(CASE WHEN T1.`Customer Names` = 'Medsep Group' THEN 1 ELSE 0 END) FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID |
Show the name of technicians aged either 36 or 37 | SELECT Name FROM technician WHERE Age = 36 OR Age = 37 |
List down the enrolled schools and duration of student214. | SELECT school, month FROM enrolled WHERE name = 'student214' |
What is the ICAO for Asiana Airlines? | SELECT icao FROM table_name_8 WHERE airline = "asiana airlines" |
Name the matches for mark taylor category:articles with hcards | SELECT MAX(matches) FROM table_21486890_1 WHERE name = "Mark Taylor Category:Articles with hCards" |
Show distinct types of artworks that are nominated in festivals in 2007. | SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007 |
Dallas Burn's draft pick was which position? | SELECT position FROM table_26141160_2 WHERE team = "Dallas Burn" |
What are the notes for Happy Camp? | SELECT notes FROM table_name_79 WHERE title = "happy camp" |
Which department has the most number of night shifts? | SELECT T3.Name FROM Shift AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.ShiftId = T2.ShiftId INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID GROUP BY T2.DepartmentID ORDER BY COUNT(T1.Name = 'Night') DESC LIMIT 1 |
What is the average age of the students in this major? | select avg ( age ) from student where major = ( SELECT major FROM Student GROUP BY major ORDER BY count ( * ) DESC LIMIT 1 ) |
What is the average number of points when the ranking is 7th and the draw is less than 4? | SELECT AVG(points) FROM table_name_63 WHERE rank = "7th" AND draw < 4 |
Which away has apoel as the club? | SELECT away FROM table_name_41 WHERE club = "apoel" |
How many customers did not rent material at Mike's store? | SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.manager_staff_id = T3.staff_id WHERE T3.first_name != 'Mike' |
Which contact channel has been used by the customer with name "Tillman Ernser"? | SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser" |
What is Away Team, when Home Team is "Ipswich Town", and when Date is "6 February 1986"? | SELECT away_team FROM table_name_90 WHERE home_team = "ipswich town" AND date = "6 february 1986" |
What is the percentage of the cases involved more than 3 officers from year 2010 to 2015? | SELECT CAST(SUM(IIF(officer_count > 3, 1, 0)) AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE STRFTIME('%Y', date) BETWEEN '2010' AND '2015' |
What is the attendance when oadby town is away? | SELECT attendance FROM table_name_37 WHERE away_team = "oadby town" |
What is their name | First name or last name? | What is their customer id | SELECT t1.customer_id FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500 |
Which three cities have the largest regional population? | SELECT city FROM city ORDER BY regional_population DESC LIMIT 3 |
What is the number of states that has some colleges whose enrollment is smaller than the average enrollment? | SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college) |
Ok, what is the first and last name of the student who has president votes? | SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_Vote |
Show the people that have been comptroller the most times and the corresponding number of times. | SELECT Comptroller , COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1 |
How many departments are in each school? | SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code |
How many orders were from Hanna Moos company in 1999? | SELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1999' AND T1.CompanyName = 'Hanna Moos' |
Show all the cinema names and opening years in descending order of opening year. | SELECT name , openning_year FROM cinema ORDER BY openning_year DESC |
Which method has the summary "Write a command to the log"? | SELECT Name FROM Method WHERE Summary = 'Write a command to the log' |
Which NBA draft has a School of st. mary's high school? | SELECT nba_draft FROM table_name_91 WHERE school = "st. mary's high school" |
What is the name of the customer? | SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count ( * ) DESC LIMIT 1 |
Who is the owner of the business that has a high risk violation of 103109 and described as unclean or unsanitary food contact surfaces? | SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.violation_type_id = 103109 AND T1.description = 'Unclean or unsanitary food contact surfaces' |
What is the lowest value for int. caps? | SELECT MIN(int_caps) FROM table_29743928_5 |
What ship has a norway nationality? | SELECT ship FROM table_name_18 WHERE nationality = "norway" |
What are the dates that had the top 5 cloud cover rates? Also tell me the cloud cover rate. | SELECT date , cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5 |
List the names of people that are not poker players. | SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM poker_player) |
How many month names are there for the tenth numbered month? | SELECT COUNT(month_name) FROM table_28985631_1 WHERE numbered_month = "Tenth" |
List all role codes, role names, and role descriptions. | SELECT role_code , role_name , role_description FROM ROLES |
What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results? | SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) = 11 INTERSECT SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5 |
Name the constituency for 175130 | SELECT constituency FROM table_22754310_1 WHERE margin = 175130 |
Please give the full name of the customer who had made the biggest amount of payment in one single film rental. | SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.amount DESC LIMIT 1 |
What are the full names of the top 3 employees who handled the highest number of sales? | SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 3 |
What other buildings is JPMorgan Chase also located in? | SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id where T3.name = "JPMorgan Chase" and T2.name ! = "Torre KOI" |
What was the time for the country of kazakhstan? | SELECT time FROM table_name_13 WHERE country = "kazakhstan" |
What proportion of suppliers are from Asia? | SELECT CAST(SUM(IIF(T1.r_name = 'ASIA', 1, 0)) AS REAL) * 100 / COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey |
Can you list all the colleges and their enrollments? | SELECT cName, enr FROM college |
What is the average price of clothes? | SELECT avg(product_price) FROM products WHERE product_type_code = 'Clothes' |
Which class was on the Las Vegas Motor Speedway for 2 hours? | SELECT class FROM table_name_3 WHERE length = "2 hours" AND circuit = "las vegas motor speedway" |
VIE is the IATA for which city? | SELECT airport FROM table_name_80 WHERE iata = "vie" |
Tell me the sum of attendane for a result of w 12-3 and week more than 12 | SELECT SUM(attendance) FROM table_name_64 WHERE result = "w 12-3" AND week > 12 |
What are the top three total number of passengers? | SELECT total_passengers FROM station ORDER BY total_passengers DESC LIMIT 3 |
Find the student ID and login name of the student with the most course enrollments | SELECT T1.student_id , T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
What student won 3rd with Peter Agre as Chief Judge? | SELECT name FROM table_name_78 WHERE chief_judge = "peter agre" AND award = "3rd" |
How about the name of the director? | Do you mean the name of the director of Avatar? | yes | SELECT director FROM Movie WHERE title = "Avatar" |
Which part fault requires the most number of skills to fix? List part id and name. | SELECT T1.part_id , T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) DESC LIMIT 1 |
From 2003 to 2004, how many customers have paid more than three times? | SELECT COUNT(customernumber) FROM ( SELECT customernumber FROM payments WHERE STRFTIME('%Y', paymentDate) >= '2003' AND STRFTIME('%Y', paymentDate) <= '2004' GROUP BY customernumber HAVING COUNT(customernumber) > 3 ) T |
What are the maximum and minimum number of cows across all farms. | SELECT max(Cows) , min(Cows) FROM farm |
Which customer made the most orders? Find the customer name. | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 |
Show the names of all the buildings. | SELECT name FROM building |
What is the score in the final with runner-up as the outcome and hard (i) as the surface? | SELECT score_in_the_final FROM table_name_38 WHERE outcome = "runner-up" AND surface = "hard (i)" |
What is the type of the gps iif-10 satellite? | SELECT type FROM table_name_38 WHERE satellite = "gps iif-10" |
What away team did Carlton play? | SELECT away_team FROM table_name_77 WHERE home_team = "carlton" |
What is the most common participant type? | SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1 |
What is 2008, when 2009 is "A", and when Tournament is "Madrid Masters"? | SELECT 2008 FROM table_name_91 WHERE 2009 = "a" AND tournament = "madrid masters" |
For the Yelp businesses which received a "5" star review with "uber" number of votes for funny, which one is located in "Phoenix"? Give the business ID. | SELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Phoenix' AND T2.review_stars = 5 AND T2.review_votes_funny = 'Uber' |
How many entrepreneurs are there? | SELECT count(*) FROM entrepreneur |
Which settlement has a cyrillic and other name of војводинци (romanian: voivodinţ)? | SELECT settlement FROM table_2562572_46 WHERE cyrillic_name_other_names = "Војводинци (Romanian: Voivodinţ)" |
When they played Universidad de Chile, what was the score of the first leg? | SELECT COUNT(1 AS st_leg) FROM table_17282875_3 WHERE team__number2 = "Universidad de Chile" |
The book name "The Season: A Candid Look at Broadway" was published by which publisher? | SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Season: A Candid Look at Broadway' |
What is the away team for the game at Windy Hill? | SELECT away_team FROM table_name_72 WHERE venue = "windy hill" |
give the state county each belongs to | SELECT City_Town, State_County FROM Addresses |
Which Team/Chassis has a Year larger than 1987? | SELECT team_chassis FROM table_name_46 WHERE year > 1987 |
Which location names contain the word "film"? | SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE "%film%" |
How many businesses that are registered in the database can be attributed to 'Good for Kids'? | SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'Good for Kids' AND T2.attribute_value = 'true' |
what is the points against when the losing bonus is 0 and the club is banwen rfc? | SELECT points_against FROM table_name_32 WHERE losing_bonus = "0" AND club = "banwen rfc" |
What departments employ more than 100,000 employees? | select * from department where num_employees > 100000 |
Name all the tournaments that took place in Rhode Island. | SELECT tournament FROM table_11622840_1 WHERE location = "Rhode Island" |
List the air carrier's description of the flights with 0 departure delay. | SELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEP_DELAY = 0 GROUP BY T1.Description |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.