sentence
stringlengths
3
347
sql
stringlengths
18
804
List the name of all customers who had made orders online.
SELECT T FROM ( SELECT CASE WHEN T2.`Sales Channel` = 'Online' THEN T1.`Customer Names` ELSE NULL END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL
List all the addresses for the suppliers of the biggest parts.
SELECT T2.s_address FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ORDER BY T3.p_size DESC LIMIT 1
What club is associated with draft number 155?
SELECT nhl_team FROM table_2679061_8 WHERE pick__number = 155
What's the listed average of Cuts made that has a Top-5 of 3, and a Top-10 that's smaller than 5?
SELECT AVG(cuts_made) FROM table_name_17 WHERE top_5 = 3 AND top_10 < 5
Can you tell me the Entrant that has the Chassis of march 742, and the Year larger than 1974?
SELECT entrant FROM table_name_7 WHERE chassis = "march 742" AND year > 1974
When рука / ruka is the serbo-croatian what is the macedonian?
SELECT macedonian FROM table_26757_4 WHERE serbo_croatian = "рука / ruka"
How many characteristics does the product named "sesame" have?
SELECT count ( * ) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame"
Show these countries
SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING count ( * ) > = 3
What week was the Original artist, the police ?
SELECT week FROM table_name_5 WHERE original_artist = "the police"
what is the nickname of staff id 3
SELECT nickname FROM Staff WHERE staff_id = 3
List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.
SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1
How many viewers in millions watched the episode 23:55 minutes long?
SELECT viewers__in_millions_ FROM table_1849243_1 WHERE run_time = "23:55"
What is the Place of the Player with a Score of 68-73-66-74=281?
SELECT place FROM table_name_13 WHERE score = 68 - 73 - 66 - 74 = 281
What is ICAO, when Airport is "Sibulan Airport"?
SELECT icao FROM table_name_90 WHERE airport = "sibulan airport"
What shows for notes when rank is more than 4, and country is South Korea?
SELECT notes FROM table_name_31 WHERE rank > 4 AND country = "south korea"
Show the cinema name and location for cinemas with capacity above average.
SELECT name , LOCATION FROM cinema WHERE capacity > (SELECT avg(capacity) FROM cinema)
Which catalog value has a region of world?
SELECT catalog FROM table_name_34 WHERE region = "world"
What is minimum hours of the students playing in different position?
SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos
What are the keywords of the episode "Take My Life, Please"?
SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Take My Life, Please';
What are the names of the courses in alphabetical order?
SELECT course_name FROM courses ORDER BY course_name
Calculate the average male median age of all the residential areas in Windham county.
SELECT SUM(T2.male_median_age) / COUNT(T2.median_age) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WINDHAM'
What is the most expensive price paid by a customer for the book "Bite Me If You Can (Argeneau #6)"?
SELECT MAX(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'Bite Me If You Can (Argeneau #6)'
What is the Unit for the Aircraft F.e.2b, located in Logeast?
SELECT SUM(unit) FROM table_name_20 WHERE aircraft = "f.e.2b" AND location = "logeast"
What is the finish with 200 laps and a start of 3?
SELECT finish FROM table_name_91 WHERE laps = 200 AND start = "3"
What is the sum of year 1 and year 2 students?
SELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_1' OR yearsInProgram = 'Year_2'
List the title name, type, and price of the titles published by New Moon Books. Arrange the list in ascending order of price.
SELECT T1.title, T1.type, T1.price FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'New Moon Books' ORDER BY T1.price
Can you tell me the Player that has the Score larger than 67?
SELECT player FROM table_name_60 WHERE score > 67
how about in Edmonton?
SELECT count ( * ) FROM employees WHERE title = 'IT Staff' and city = 'Edmonton'
Which Score has a Couple of cristián & cheryl, and a Style of cha-cha-cha?
SELECT score FROM table_name_7 WHERE couple = "cristián & cheryl" AND style = "cha-cha-cha"
When has a Record of 9–1, and a Tournament Champion of duke?
SELECT year FROM table_name_50 WHERE record = "9–1" AND tournament_champion = "duke"
What is on the reverse side of the ₩500 coin?
SELECT reverse FROM table_298883_5 WHERE value = "₩500"
On what date was the Record of 43–35?
SELECT date FROM table_name_25 WHERE record = "43–35"
How many solution paths are there inside the 2nd most popular repository?
SELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT Watchers FROM Repo ORDER BY Watchers DESC LIMIT 1, 1 )
Who directed Episode 8?
SELECT directed_by FROM table_11075747_4 WHERE episode__number = 8
Who is the Producer/Director of Political Engagement?
SELECT producer_director FROM table_name_67 WHERE film = "political engagement"
What position is the player from the United States play for the Grizzlies from 2000-2001?
SELECT position FROM table_name_90 WHERE nationality = "united states" AND years_for_grizzlies = "2000-2001"
What were the outcomes of matches with bill tilden florence ballin as opponents?
SELECT outcome FROM table_2127933_3 WHERE opponents = "Bill Tilden Florence Ballin"
How many people from Canada are nominated for an award?
SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.birth_country = 'Canada'
On what date was the match played in Victoria Park?
SELECT date FROM table_name_78 WHERE venue = "victoria park"
how many overall championships does concordia university have
SELECT MIN(national_titles) FROM table_14115168_4 WHERE school = "Concordia University"
Who had a score of 70-73-69=212?
SELECT player FROM table_name_91 WHERE score = 70 - 73 - 69 = 212
Among the episodes with an award nominee or winner, which has the highest percent of 5 star votes?
SELECT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5 ORDER BY T2.percent DESC LIMIT 1;
What group has a Population of see hoy?
SELECT group FROM table_name_23 WHERE population = "see hoy"
Name the most attendance
SELECT MIN(attendance) FROM table_26401898_2
what is the order date of order id 1
SELECT order_date from Customer_Orders WHERE order_id = 1
what is the product name? | Do you mean the product name of the product which has the highest price? | yes
SELECT product_name from products order by product_price desc limit 1
Can you tell me the sum of Goals against that has the Goals for larger than 10, and the Position of 3, and the Wins smaller than 6?
SELECT SUM(goals_against) FROM table_name_14 WHERE goals_for > 10 AND position = 3 AND wins < 6
What is the total processed time of all solutions from the repository with the most forks?
SELECT SUM(T2.ProcessedTime) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = ( SELECT MAX(Forks) FROM Repo )
List the state names and the number of customers living in each state.
SELECT t2.state_province_county , count(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county
What is the percentage of the people who are under 35 and participated in the summer season?
SELECT CAST(COUNT(CASE WHEN T2.age < 35 THEN 1 END) AS REAL) * 100 / COUNT(T2.games_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer'
Name the injunctive for गर्यो garyo 'he did'
SELECT injunctive FROM table_16337329_5 WHERE past_habitual = "गर्यो garyo 'he did'"
What is the location of the Sea Pines Heritage Classic tournament?
SELECT location FROM table_name_68 WHERE tournament = "sea pines heritage classic"
Find all details for each swimmer.
SELECT * FROM swimmer
What's the blood type of the member from the vision factory agency?
SELECT blood_type FROM table_name_52 WHERE agency = "vision factory"
What is the latest year that has more than 5 points and a renault ef15 1.5 v6 t engine?
SELECT MAX(year) FROM table_name_20 WHERE engine = "renault ef15 1.5 v6 t" AND points > 5
Where does Carlton play?
SELECT venue FROM table_name_82 WHERE home_team = "carlton"
Calculate the total amount paid by Stephanie Mitchell for film rentals in June 2005.
SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'STEPHANIE' AND T2.last_name = 'MITCHELL' AND SUBSTR(T1.payment_date, 1, 7) = '2005-06'
How many of those are going to Honolulu?
SELECT count ( * ) FROM Flight WHERE origin = "Los Angeles" and destination = "Honolulu"
What is the make of the car that won the brazilian grand prix?
SELECT constructor FROM table_1139087_2 WHERE grand_prix = "Brazilian grand_prix"
What are the names of the suppliers whose products have the highest user satisfaction?
SELECT DISTINCT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products )
Can you show me a list of all of the technicians names the machines they are assigned to repair? | Did you want the names of technicians and the ids of machines they are assigned to repair? | Yes! Can you show me their names and their machine ids that they are assigned to repair?
SELECT T2.Name , T1.machine_id FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID
Name the national for rimutaka
SELECT national FROM table_20217811_1 WHERE electorate = "Rimutaka"
What is the elista with 1 played and 153⅓ baku?
SELECT elista FROM table_name_14 WHERE played = 1 AND baku = "153⅓"
What is the Age of f/c Posiiton?
SELECT year_born__age_ FROM table_name_85 WHERE position = "f/c"
What percent of the non volcanic islands in the Lesser Antilles group of islands have an area of no more than 300 square kilometers?
SELECT SUM(CASE WHEN Area <= 300 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM island WHERE Islands = 'Lesser Antilles' AND (Type != 'volcanic' OR Type IS NULL)
List the product name with more than 5 quantity in the shopping cart.
SELECT T1.Name FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 5
What is the customer ID of the customer with the most number of accounts?
SELECT T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count ( * ) DESC LIMIT 1
How many unique names in the list table have a classroom id of 108?
SELECT count ( distinct firstname ) from teachers where classroom = 108
Compare the numbers of postal points under Smith Adrian and Heck Joe.
SELECT CASE WHEN COUNT(CASE WHEN T1.first_name = 'Smith' AND T1.last_name = 'Adrian' THEN T2.zip_code ELSE NULL END) > COUNT(CASE WHEN T1.first_name = 'Heck' AND T1.last_name = 'Joe' THEN T2.zip_code ELSE NULL END) THEN 'Smith Adrian>Heck Joe' ELSE 'Smith Adrian<=Heck Joe' END AS COMPARE FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district
Which Opponent has the Event of Sengoku 1?
SELECT opponent FROM table_name_94 WHERE event = "sengoku 1"
What is the score on May 18?
SELECT score FROM table_name_75 WHERE date = "may 18"
What is the maximum number that a certain service is provided? List the service id, details and number.
SELECT T1.service_id , T1.service_details , count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1
Overall, do you have the best ranked composer? | I do not quite understand what you mean. Do you mean rank by milliseconds? | Yes please.
select composer from tracks order by milliseconds
Show the name of the shop that have the largest quantity of devices in stock.
SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1
Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type.
SELECT sum(Enrollment) , affiliation FROM university WHERE founded > 1850 GROUP BY affiliation
Which Week has an Air Date of august 30, 2008?
SELECT week FROM table_name_73 WHERE air_date = "august 30, 2008"
find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30.
SELECT t1.name , t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY count(*) DESC LIMIT 1
List down all of the sales IDs for sales handled by sales people with first name starting with alphabet "s".
SELECT T1.SalesID FROM Sales AS T1 INNER JOIN Employees AS T2 ON T1.SalesPersonID = T2.EmployeeID WHERE SUBSTR(T2.FirstName, 1, 1) = 's'
What is High Rebounds, when Game is greater than 33, and when Score is "W 132-101"?
SELECT high_rebounds FROM table_name_44 WHERE game > 33 AND score = "w 132-101"
Is mt lawley day or boarding?
SELECT day_boarding FROM table_name_84 WHERE location = "mt lawley"
On what date did Universitario win the Torneo Apertura round after 2003 at Estadio Alejandro Villanueva?
SELECT date FROM table_name_45 WHERE venue = "estadio alejandro villanueva" AND season > 2003 AND competition_round = "torneo apertura" AND winner = "universitario"
Attendance larger than 55,189 is which average game?
SELECT AVG(game) FROM table_name_25 WHERE attendance > 55 OFFSET 189
What are the lowest points when the language is Portuguese?
SELECT MIN(points) FROM table_name_87 WHERE language = "portuguese"
How many pages are there in the "Emil Kuehn" menu?
SELECT SUM(CASE WHEN T1.name = 'Emil Kuehn' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id
Which sales team id has the highest number of orders in 2018?
SELECT _SalesTeamID FROM `Sales Orders` WHERE OrderDate LIKE '%/%/18' GROUP BY _SalesTeamID ORDER BY COUNT(_SalesTeamID) DESC LIMIT 1
How many products do you have?
select count ( * ) from Products
How many tasks are there in total?
SELECT COUNT(*) FROM Tasks
What is Volume:Issue, when Artist is Elton John, and when Weeks on Top is 4?
SELECT volume AS :issue FROM table_name_86 WHERE artist = "elton john" AND weeks_on_top = 4
Show the position of players and the corresponding number of players.
SELECT POSITION , COUNT(*) FROM match_season GROUP BY POSITION
What is Date, when Location Attendance is "TD Banknorth Garden 18,624"?
SELECT date FROM table_name_29 WHERE location_attendance = "td banknorth garden 18,624"
what is the elevation of goroka airport
SELECT elevation FROM airports WHERE name = "Goroka Airport"
What chassis has patrick racing as an entrant, with a start greater than 6?
SELECT chassis FROM table_name_69 WHERE entrant = "patrick racing" AND start > 6
The record of 7-3 had the largest attendance of what?
SELECT MAX(attendance) FROM table_10361453_2 WHERE record = "7-3"
what is the tournament when the country is united states?
SELECT tournament FROM table_name_38 WHERE country = "united states"
What are the average hours played for each game type?
SELECT T2.GType, AVG ( T1.Hours_Played ) FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T2.GType
Where was the game played when the opponent was Oklahoma City, and what was the attendance?
SELECT location_attendance FROM table_name_9 WHERE team = "oklahoma city"
List the nominee, keywords and episode ID of the title "The Good, the Sad and the Drugly".
SELECT T3.person, T1.keyword, T1.episode_id FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id WHERE T2.title = 'The Good, the Sad and the Drugly' AND T3.result = 'Nominee';
Which Score has a Competition of uefa euro 2012 qualifying?
SELECT score FROM table_name_70 WHERE competition = "uefa euro 2012 qualifying"
What is the average salary of employees who have a commission percentage that is not null?
SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != "null" GROUP BY department_id
Show details of all investors that made transactions with sgare greater than 100?
SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100