sentence
stringlengths
3
347
sql
stringlengths
18
804
How many players were drafted by the Philadelphia Flyers?
SELECT COUNT(nationality) FROM table_2679061_11 WHERE nhl_team = "Philadelphia Flyers"
Find the last name of the first ever contact person of the organization with the highest UK Vat number.
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1
Which Surface is on 23 january 2011?
SELECT surface FROM table_name_79 WHERE date = "23 january 2011"
Show gas station id, location, and manager_name for all gas stations ordered by open year.
SELECT station_id , LOCATION , manager_name FROM gas_station ORDER BY open_year
Which region is identified as 38xa-3 in the catalog?
SELECT region FROM table_name_7 WHERE catalog = "38xa-3"
Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.
SELECT LOCATION FROM track WHERE seating > 90000 INTERSECT SELECT LOCATION FROM track WHERE seating < 70000
What label is in CD format in Australia?
SELECT label FROM table_name_14 WHERE format = "cd" AND region = "australia"
How many albums does Billy Cobham has?
SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";
What is Ring Name, when Current Rank is E0 Maegashira 9 West?
SELECT ring_name FROM table_name_48 WHERE current_rank = "e0 maegashira 9 west"
List all the customers in increasing order of IDs.
SELECT customer_id , customer_name FROM customers ORDER BY customer_id ASC
What is the total to par with a total of 163?
SELECT COUNT(to_par) FROM table_name_16 WHERE total = 163
Find the last names of faculties in building Barton in alphabetic order.
SELECT Lname FROM FACULTY WHERE Building = "Barton" ORDER BY Lname
What engine does Steve Chassey drive with a march chassis?
SELECT engine FROM table_name_49 WHERE chassis = "march" AND drivers = "steve chassey"
In English speaking countries, provide the difference between the number of countries with republic and constitutional monarchy as its government form.
SELECT COUNT(T1.GovernmentForm = 'Republic') - COUNT(T1.GovernmentForm = 'ConstitutionalMonarchy') FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English'
What is the name of the oldest manager?
SELECT Name FROM manager ORDER BY Age DESC LIMIT 1
What is the latitude and longitude of the school where the teacher who wrote "Smile for the Camera!!!" teaches?
SELECT T1.school_latitude, T1.school_longitude FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title = 'Smile for the Camera!!!'
What is the product price of men suits?
select Product_Price from Products where Product_Name = "Men suits"
Find the name and address of the customers who have both New and Pending orders.
SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "New" INTERSECT SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "Pending"
Which Year has a Returned On of march 10, 2013?
SELECT AVG(year) FROM table_name_92 WHERE returned_on = "march 10, 2013"
What is To par, when Score is "70-68-68-71=277"?
SELECT to_par FROM table_name_18 WHERE score = 70 - 68 - 68 - 71 = 277
Who is the gagarin cup winner when avangard omsk is the gagarin cup finalist?
SELECT gagarin_cup_winner FROM table_name_17 WHERE gagarin_cup_finalist = "avangard omsk"
Which Gold Coast has Melbourne yes, and Auckland yes?
SELECT gold_coast FROM table_name_8 WHERE melbourne = "yes" AND auckland = "yes"
Name the population 2010 census for population 2000 census of 920599
SELECT population__2010_census_ FROM table_14986292_1 WHERE population_2000_census = 920599
Show me the full name for the employees that get more salary then employee 163?
SELECT first_name , last_name FROM employees WHERE salary > ( SELECT salary FROM employees WHERE employee_id = 163 )
What is the most amount of stumpings any player had?
SELECT MAX(stumpings) FROM table_27771406_1
What is the name of the product the work order "2540" was making?
SELECT T2.Name FROM WorkOrder AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WorkOrderID = 2540
How many ballot measures had a percentage yes of 52.11%?
SELECT COUNT(passed) FROM table_256286_39 WHERE _percentage_yes = "52.11%"
which department id has the least amount of staff?
SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count ( * ) LIMIT 1
List down the countries that are located in Asia.
SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'
How many customers have an account?
SELECT count(DISTINCT customer_id) FROM Accounts
Who is the owner?
SELECT owner FROM program ORDER BY launch DESC LIMIT 1
What is the catalogue for Harbor Lights as a title?
SELECT catalogue FROM table_name_59 WHERE song_title = "harbor lights"
For the group with 1.92% population in 1981, what was their percentage of the population in 1971?
SELECT population__percentage_1971 FROM table_name_62 WHERE population__percentage_1981 = "1.92%"
Show names for all aircraft with at least two flights.
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2
What is the Open Year of the Riverside Park?
SELECT T1.year FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T2.park_name = "Riverside Park"
How many shooter games are there?
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Shooter'
What is the average age for all managers?
SELECT avg(Age) FROM manager
What are the names of the songs without a lead vocal?
SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "lead"
What about films of the genre Action?
SELECT count ( * ) FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.name = "Foreign" and T3.special_features = "Action"
List the phone numbers of customers whose order priority is urgent.
SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderpriority = '1-URGENT'
Among the cities with a population between 140000 and 150000, list the country that has life expectancy greater than 80% life expectancy of all countries.
SELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Population BETWEEN 140000 AND 150000 GROUP BY T2.Name, LifeExpectancy HAVING LifeExpectancy < ( SELECT AVG(LifeExpectancy) FROM Country ) * 0.8
For each shop, return the number of employees working there and the name of the shop.
SELECT count(*) , t2.name FROM hiring AS t1 JOIN shop AS t2 ON t1.shop_id = t2.shop_id GROUP BY t2.name
What bran is the callsign dytc-fm?
SELECT branding FROM table_2610582_7 WHERE callsign = "DYTC-FM"
Which rank has a total smaller than 1?
SELECT AVG(rank) FROM table_name_23 WHERE total < 1
What is the price for the product with the id "912"?
SELECT ListPrice FROM ProductListPriceHistory WHERE ProductID = 912
What is the founding date if the letters are κψκ?
SELECT founding_date FROM table_2538117_7 WHERE letters = "ΚΨΚ"
what is the number of wins the team Boston Red Stockings got in the postseasons each year in history?
SELECT count ( * ) , T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
When did svishtov , bulgaria disband?
SELECT date_disband FROM table_242785_1 WHERE main_legionary_base = "Svishtov , Bulgaria"
What Brazil scorers have a 2-1 Score?
SELECT brazil_scorers FROM table_name_35 WHERE score = "2-1"
What rank did Myleene Klass finish?
SELECT finished FROM table_name_77 WHERE celebrity = "myleene klass"
List the names and phone numbers of all the distinct suppliers who supply red jeans.
SELECT DISTINCT T1.supplier_name , T1.supplier_phone FROM suppliers AS T1 JOIN product_suppliers AS T2 ON T1.supplier_id = T2.supplier_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_name = "red jeans"
What is the week 5 after Dani Dior as week 1?
SELECT week_5 FROM table_name_36 WHERE week_1 = "dani dior"
What was the size of the crowd when Essendon was the away team?
SELECT crowd FROM table_name_40 WHERE away_team = "essendon"
What is the lowest played 2 number with less than 83 losses and less than 65 draws with Chernomorets Novorossiysk in season 8?
SELECT MIN(played_2) FROM table_name_65 WHERE lost > 83 AND seasons = 8 AND club_1 = "chernomorets novorossiysk" AND drawn < 65
How many chapters include the character name "First Witch"?
SELECT COUNT(T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'First Witch'
How many rooms are there?
SELECT count(*) FROM Rooms;
who is the oldest head
SELECT * FROM head order by age desc limit 1
What is average salary of the players in the team named 'Boston Red Stockings' ?
SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'
Which is the email of the party that has used the services the most number of times?
SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY count(*) DESC LIMIT 1
What is the to par of the player from the United States with a t6 place and a score of 70-73-68-73=284?
SELECT to_par FROM table_name_22 WHERE country = "united states" AND place = "t6" AND score = 70 - 73 - 68 - 73 = 284
Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
What was the latitude that had a UTC time of 18:19:36?
SELECT latitude FROM table_24518475_1 WHERE time__utc_ = "18:19:36"
Can you also show me the last names of any male students (sex is M) who are below the age of 20?
SELECT Lname FROM student WHERE sex = 'M' AND age < 20
how many times is the transfer fee £2,500,000?
SELECT COUNT(goals) FROM table_name_62 WHERE transfer_fee = "£2,500,000"
List all the object classes of the images that have a (5,5) coordinate.
SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 5 AND T1.Y = 5
How many people are in the crowd in south melbourne?
SELECT COUNT(crowd) FROM table_name_66 WHERE home_team = "south melbourne"
How many draws did Durham have?
SELECT draws FROM table_name_72 WHERE team = "durham"
How many against on the date of 08/06/1985?
SELECT SUM(against) FROM table_name_64 WHERE date = "08/06/1985"
Which customers do not have any policies? Find the details of these customers.
SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id = T2.customer_id
What date was georgie stoop emily webley-smith the opponent?
SELECT date FROM table_name_33 WHERE opponents = "georgie stoop emily webley-smith"
What are the names and headquarters of all manufacturers, ordered by revenue descending?
SELECT name , headquarter FROM manufacturers ORDER BY revenue DESC
Which staff handled least number of payments? List the full name and the id.
SELECT T1.first_name , T1.last_name , T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY count(*) ASC LIMIT 1
Which player plays for Illinois?
SELECT player FROM table_name_1 WHERE school_club_team_country = "illinois"
List the categories of inactive businesses in AZ.
SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'FALSE' AND T1.state LIKE 'AZ'
What is the first and last name of all employees who live in the city Damianfort?
SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort";
What years were the inactive Idaho chapter active?
SELECT charter_range FROM table_name_99 WHERE status = "inactive" AND state = "idaho"
What season has a runner-up of waseda, and a title of 47th?
SELECT season FROM table_name_25 WHERE runner_up = "waseda" AND title = "47th"
How much Rank has a Bronze of 21, and a Silver larger than 10?
SELECT COUNT(rank) FROM table_name_41 WHERE bronze = 21 AND silver > 10
How many representatives are republicans?
SELECT count ( * ) from representative where party = "Republican"
What is the highest point highest point of Per Mars in the draft year?
SELECT T1.P FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Per Mars' ORDER BY T1.P DESC LIMIT 1
What did the phase 2b status target?
SELECT indication FROM table_name_50 WHERE status = "phase 2b"
List the name of all tracks in the playlists of Movies.
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies";
Where in New York can you locate the brewery that makes the bitterest beer? List both the brewery's name and the name of the city.
SELECT T2.name, T2.city FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.state = 'NY' ORDER BY T1.ibu DESC LIMIT 1
What are the names of wines, sorted by price ascending?
SELECT DISTINCT Name FROM WINE ORDER BY price
What is Points For, when Losing Bonus is "2", when Lost is "8", and when Club is "Rhyl And District RFC"?
SELECT points_for FROM table_name_88 WHERE losing_bonus = "2" AND lost = "8" AND club = "rhyl and district rfc"
the names of models that launched between 2002 and 2004.
SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004;
What about those with at least 3 documents?
SELECT project_id FROM Documents GROUP BY project_id HAVING count ( * ) > = 3
Which team after 2008, with less than 2 podium finished and more than 0 FLAPS, had the lowest numberof races?
SELECT MIN(races) FROM table_name_67 WHERE podiums < 2 AND flaps > 0 AND season > 2008
What proportion of Sub-Saharan Africa's countries have lower middle incomes?
SELECT SUM(CASE WHEN IncomeGroup = 'Lower middle income' THEN 1 ELSE 0 END) * 100.0 / COUNT(CountryCode) persentage FROM Country WHERE Region = 'Sub-Saharan Africa'
Find the different first names and cities of the students who have allergy to milk or cat.
SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"
Excellent. What is their average score?
SELECT avg ( score ) FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White"
What opponent has a record of 6-9?
SELECT opponent FROM table_name_27 WHERE record = "6-9"
What are the names of the winner and loser who played in the longest match?
SELECT winner_name , loser_name FROM matches ORDER BY minutes DESC LIMIT 1
What are the names of movies whose created year is after all movies directed by Steven Spielberg?
SELECT title FROM Movie WHERE YEAR > (SELECT max(YEAR) FROM Movie WHERE director = "Steven Spielberg")
Who was the Runner-up for the merrill lynch/golf digest commemorative pro-am tournament?
SELECT runner_s__up FROM table_name_21 WHERE tournament = "merrill lynch/golf digest commemorative pro-am"
for milan and the iata of lin what is the airport?
SELECT airport FROM table_name_95 WHERE city = "milan" AND iata = "lin"
What is the lowest series episode with a production code of 406?
SELECT MIN(series_episode) FROM table_23513241_5 WHERE prod_code = 406
What are the titles of all movies that have between 3 and 5 stars?
SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5
What are the different names, locations, and products of the enzymes that are capable inhibitor interactions?
SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
Who's the player eliminated on episode 8 of Fresh Meat?
SELECT player FROM table_name_59 WHERE original_season = "fresh meat" AND eliminated = "episode 8"