sentence
stringlengths
3
347
sql
stringlengths
18
804
What is the Segment A for when Segment C is s Sailboard?
SELECT segment_a FROM table_15187735_6 WHERE segment_c = "s Sailboard"
What Number has a Language listed as other?
SELECT number FROM table_name_33 WHERE language = "other"
Hmm, I also want to know their record times and the related events.
SELECT t1.time, t2.event_id FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id
What was built in 1857?
SELECT name FROM table_name_89 WHERE year_built = 1857
Who vacated his post when his successor was formally installed on May 11, 1966?
SELECT vacator FROM table_1847180_3 WHERE date_of_successors_formal_installation = "May 11, 1966"
List the area code of the city with the highest Hispanic population.
SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.hispanic_population = ( SELECT MAX(hispanic_population) FROM zip_data )
List the school districts that have bought resources from Barnes and Noble.
SELECT T2.school_district FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Barnes and Noble'
Show the names of editors that are on at least two journal committees.
SELECT T1.Name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Name HAVING COUNT(*) >= 2
What type of store is most popular in the South?
SELECT DISTINCT CASE WHEN MAX(T2.Population) THEN T2.Type END FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode
What are the names of conductors as well as the corresonding orchestras that they have conducted?
SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID
Who is the voice actor for the villain of the movie "Alice in Wonderland"?
SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T1.character LIKE '%' OR T2.villian OR '%' AND T2.movie_title = 'Alice in Wonderland'
What is the building id of apartment Apt 585?
SELECT building_id FROM Apartments WHERE apt_number = "Apt. 585"
Which 1st leg has a Team 1 of drita?
SELECT 1 AS st_leg FROM table_name_3 WHERE team_1 = "drita"
Great - can you list all apartments with more than one bathroom and more than three bedrooms?
SELECT * FROM Apartments where bathroom_count > 1 and bedroom_count > 3
How about project Ast3, how many scientists?
SELECT count ( * ) FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project where T1.Code = "Ast3"
Can you tell me the Entrant that has the Laps of 17?
SELECT entrant FROM table_name_77 WHERE laps = 17
What proportion of sales orders are made from the United Kingdom?
SELECT CAST(SUM(CASE WHEN T2.Name = 'United Kingdom' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.SalesOrderID) FROM SalesOrderHeader AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID
Among the female customers with an level of education of 3 and below, list their income.
SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND SEX = 'Female' )
What were the starting odds for the opening odds of 2-1?
SELECT starting_odds FROM table_22517564_3 WHERE opening_odds = "2-1"
Who was the visiting team at the Cavaliers game that had a score of 121–85?
SELECT visitor FROM table_name_29 WHERE score = "121–85"
Calculate the ratio of disabled students who have never been absent from school.
SELECT 100 * SUM(IIF(T2.month = 0, 1, 0)) AS num FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name
What are the names of all students who successfully tried out for the position of striker?
SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'
What is the title of the episode that was directed by Roy Dupuis?
SELECT title FROM table_name_38 WHERE directed_by = "roy dupuis"
Find the number of dorms and total capacity for each gender.
SELECT count(*) , sum(student_capacity) , gender FROM dorm GROUP BY gender
What was the result of the 4:27 fight?
SELECT res FROM table_name_51 WHERE time = "4:27"
What was the attendance when St Kilda played as the home team?
SELECT COUNT(crowd) FROM table_name_66 WHERE home_team = "st kilda"
Show me the country with people younger than 30,
SELECT distinct country FROM people WHERE age<30
What did Geelong score as the away team?
SELECT away_team AS score FROM table_name_91 WHERE away_team = "geelong"
What number is Fall 06 from the state with 79 or less in Fall 08, 36 or greater in Fall 07 and greater than 74 in Fall 05?
SELECT AVG(fall_06) FROM table_name_92 WHERE fall_08 < 79 AND fall_07 > 36 AND fall_05 > 74
How many teams did the heaviest player drafted by Arizona Coyotes have played for?
SELECT COUNT(T2.TEAM) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN weight_info AS T3 ON T1.weight = T3.weight_id WHERE T1.overallby = 'Arizona Coyotes' ORDER BY T3.weight_in_lbs DESC LIMIT 1
Show which policy type has the most records in the database?
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count ( * ) DESC LIMIT 1
how many countries are in Asia?
SELECT COUNT(*) FROM country WHERE continent = "Asia"
Describe the full names and graduated universities of the professors who advised Olia Rabier.
SELECT T1.first_name, T1.last_name, T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Olia' AND T3.l_name = 'Rabier'
I want to know the average Gold for total smaller 12 and bronze less than 1 and wushu with silver more than 3
SELECT AVG(gold) FROM table_name_2 WHERE total < 12 AND bronze < 1 AND sport = "wushu" AND silver > 3
How many Drawn have a Position of 7, and Points larger than 18?
SELECT COUNT(drawn) FROM table_name_70 WHERE position = 7 AND points > 18
How many professors do have a Ph.D. degree?
SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.'
When the standard speed (6th gear) is 114, what is the minimum rpm?
SELECT MIN(rpm) FROM table_19704392_1 WHERE standard_speed__6th_gear_ = "114"
Please show the most common age of editors.
SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1
What is the id of the repository with the highest number of solution path?
SELECT RepoId FROM solution GROUP BY RepoId ORDER BY COUNT(Path) DESC LIMIT 1
what is average of training hours?
SELECT avg ( HS ) FROM player
How many polls show different percentages for Tom Emmer and 38% for Matt Entenza?
SELECT COUNT(tom_emmer__r_) FROM table_20032301_3 WHERE matt_entenza__dfl_ = "38%"
How many are the Race 2 points when Race 1 was 12?
SELECT race_2_pts_ FROM table_23293785_3 WHERE race_1_pts_ = 12
Name the number of ends lost for 6 stolen ends
SELECT COUNT(Ends) AS lost FROM table_26745426_2 WHERE stolen_ends = 6
Sure thing! Whats the typical selling price of cumin?
SELECT typical_selling_price FROM Products WHERE product_name = "cumin"
Of the products that has a reorder inventory point of no more than 600, how many manufactured in-house products that takes 1 day to manufacture with BOM Level 4 are there?
SELECT COUNT(T1.ProductID) FROM Product AS T1 INNER JOIN BillOfMaterials AS T2 ON T1.ProductID = T2.ProductAssemblyID WHERE T1.MakeFlag = 1 AND T1.DaysToManufacture = 1 AND T2.BOMLevel = 4 AND T1.ReorderPoint <= 600
List the name and the number of stations for all the cities that have at least 15 stations.
SELECT city , COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15
Return the number of United Airlines flights leaving from AHD Airport.
SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.SourceAirport = "AHD"
Which driver for Bob Holden Motors has fewer than 36 points and placed 7 in race 1?
SELECT driver FROM table_name_80 WHERE points < 36 AND team = "bob holden motors" AND race_1 = "7"
In which city are the most customers living in?
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.address_id = t3.address_id GROUP BY t3.city ORDER BY count ( * ) DESC LIMIT 1
How many points total are there later than 2003?
SELECT SUM(points) FROM table_name_99 WHERE year > 2003
What is the customer last name, id and phone number with most number of orders?
SELECT T2.customer_last_name, T1.customer_id, T2.phone_number FROM Orders 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 cytoplasms result in a blue nucleus?
SELECT COUNT(cytoplasm) FROM table_13570_1 WHERE nucleus = "Blue"
What are the remarks for 8 October 2008?
SELECT remarks FROM table_2015453_1 WHERE date = "8 October 2008"
What shows for the League when the FA Cup is 6 (20)?
SELECT league_a FROM table_name_47 WHERE fa_cup = "6 (20)"
What is the indicator code for Mobile Cellular Subscriptions of Brazil?
SELECT DISTINCT IndicatorCode FROM Indicators WHERE CountryName = 'Brazil' AND IndicatorName = 'Mobile cellular subscriptions'
What is the name of the root beer brand that has the longest history?
SELECT BrandName FROM rootbeerbrand WHERE FirstBrewedYear = ( SELECT MIN(FirstBrewedYear) FROM rootbeerbrand )
What's the name of Linroy Bottoson's victim?
SELECT victim_s_ FROM table_23546266_1 WHERE executed_person = "Linroy Bottoson"
what's Roof dorm id?
select dormid from has_amenity where amenid = ( SELECT T1.amenid FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY count ( * ) DESC LIMIT 1 )
Where did the Gould Rex Mays Classic 150 occur?
SELECT city_location FROM table_name_38 WHERE race_name = "gould rex mays classic 150"
Name the production code for number in season being 21
SELECT production_code FROM table_22948559_1 WHERE no_in_season = "21"
How many ranks have a Bronze smaller than 8, and a Total smaller than 7, and a Gold smaller than 1?
SELECT COUNT(rank) FROM table_name_1 WHERE bronze < 8 AND total < 7 AND gold < 1
What is the average quantities ordered with payment method code "MasterCard" on invoices?
SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard"
Among the Olympic games held in Los Angeles, what is the name of the Olympic game that has the most number of competitors?
SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Los Angeles' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1
What is the state of the college OU?
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T1.cName = 'OU'
Which resource type is commonly bought by the Los Angeles Unified School District?
SELECT T1.project_resource_type FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_district = 'Los Angeles Unif Sch Dist' GROUP BY T2.school_district ORDER BY COUNT(T1.project_resource_type) DESC LIMIT 1
What are their ids?
SELECT DISTINCT RID FROM Rating WHERE stars < 4
Please indicate the total price of order key 32.
SELECT o_totalprice FROM orders WHERE o_orderkey = 32
List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
SELECT name , LOCATION FROM station ORDER BY Annual_entry_exit , Annual_interchanges
What is the percentage of words in the Catalan language that have a repetition of more than 16,000 times?
SELECT CAST(COUNT(CASE WHEN occurrences > 16000 THEN lid ELSE NULL END) AS REAL) * 100 / COUNT(lid) FROM langs_words
What's the quantity preserved when the fleet number was 700?
SELECT quantity_preserved FROM table_name_57 WHERE fleet_number_s_ = "700"
Who was in local affairs in 2012-2013?
SELECT local_affairs FROM table_name_9 WHERE year = "2012-2013"
Name the loss with record of 71-33
SELECT loss FROM table_name_4 WHERE record = "71-33"
Name the Prominence of the Mountain Peak of matchless mountain pb?
SELECT prominence FROM table_name_81 WHERE mountain_peak = "matchless mountain pb"
What are the committee names for the counties with population between 50000-100000?
SELECT T2.Committee FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000 AND T1.Population > 50000
Show the average amount of transactions for different lots.
SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id
What are the ids of all employees that don't have certificates?
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
what locations of the party have the most hosts?
SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1
What country was the Pegasus, build by Royal Dockyard, from?
SELECT country FROM table_name_41 WHERE builder = "royal dockyard" AND ship = "pegasus"
What is the lowest pick number?
SELECT MIN(pick__number) FROM table_14655757_1
And what is helen rank
SELECT T2.rank FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id where T1.name = 'Helen'
Calculate the average number of female students who are disabled and who joined Foreign Legion organization.
SELECT CAST(SUM(IIF(T3.name IS NULL, 1, 0)) AS REAL) / COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name WHERE T2.organ = 'foreign_legion'
List all the cities where Zachery Hicks transported goods.
SELECT DISTINCT T3.city_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks'
How many traditional Chinese for the translation of "Crossing the River"?
SELECT COUNT(traditional_chinese) FROM table_1805919_1 WHERE english_translation = "Crossing the River"
What is week 6 when week 7, week 4, and week 3 are evicted and week 2 29.35?
SELECT week_6 FROM table_name_22 WHERE week_7 = "evicted" AND week_4 = "evicted" AND week_3 = "evicted" AND week_2 = "29.35"
Which height is associated with Franklin High School?
SELECT height FROM table_name_40 WHERE school = "franklin high school"
Which Player has a Score of 74-67-74-71=286?
SELECT player FROM table_name_86 WHERE score = 74 - 67 - 74 - 71 = 286
When Peter Sagan won the youth classification and Thomas Rabou won the most corageous, who won the sprint classification?
SELECT sprint_classification FROM table_25055040_22 WHERE youth_classification = "Peter Sagan" AND most_courageous = "Thomas Rabou"
On what date was Tie #13 played?
SELECT date FROM table_name_93 WHERE tie_no = "13"
Find the number of professors in accounting department.
SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting"
Find the number of routes for each source airport and the airport name.
SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name
Tell me the number of orders with "Second time" as order detail.
SELECT count(*) FROM customer_orders WHERE order_details = "Second time"
Where was the venue that had 274 runs?
SELECT venue FROM table_name_29 WHERE runs = "274"
What is the D 50 when the D 43 is r 43?
SELECT d_50 FROM table_name_77 WHERE d_43 = "r 43"
What metal has one rupee as the denomination?
SELECT metal FROM table_name_83 WHERE denomination = "one rupee"
Date of wed. nov. 13 had how many number of games?
SELECT COUNT(game) FROM table_name_1 WHERE date = "wed. nov. 13"
What is the name of the airport in Mount Hagen city?
SELECT name from airports where city = 'Mount Hagen'
Can you tell me the Name that has the Height of 6-5, and the Year of junior?
SELECT name FROM table_name_55 WHERE height = "6-5" AND year = "junior"
How many weddings are there in year 2016?
SELECT count(*) FROM wedding WHERE YEAR = 2016
What is the Time/ Behind, when Jockey is "Jose Lezcano"?
SELECT time__behind FROM table_name_44 WHERE jockey = "jose lezcano"
Which grade is studying in room 105?
SELECT DISTINCT grade FROM list WHERE classroom = 105