sentence
stringlengths
3
347
sql
stringlengths
18
804
How many assets can each parts be used in? List the part name and the number.
SELECT T1.part_name , count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name
Provide the fine paid and the complete address of the establishment with inspection ID 48216.
SELECT DISTINCT T3.fine, T1.state, T1.city, T1.address FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T2.inspection_id = 48216
Please show the names of aircrafts associated with airport with name "London Gatwick".
SELECT T1.Aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T3.Airport_Name = "London Gatwick"
Please provide the titles of any two papers that are either preprinted or unpublished along with the full name of the journal to which those papers belong.
SELECT T1.Title, T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Year < 1 LIMIT 2
Which Length has a Year of 2000?
SELECT length FROM table_name_13 WHERE year = 2000
Please list the movies directed by Wolfgang Reitherman that can be watched by the general audience.
SELECT T1.movie_title FROM `movies_total_gross` AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.MPAA_rating = 'G' AND T2.director = 'Wolfgang Reitherman'
and Janessa? | Do you mean the last name of the staff whose first name is Janessa? | Yes
SELECT last_name from staff where first_name = 'Janessa'
What is the title, phone and hire date of Nancy Edwards?
SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"
Please list the names of taverns that paid a $100 fine upon inspection.
SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T1.facility_type = 'Tavern' AND T3.fine = 100
What is the total rank with more than 2 silver and total larger than 10?
SELECT SUM(rank) FROM table_name_55 WHERE silver = 2 AND total > 10
Which colleges were those positions for?
SELECT cName FROM tryout where pPos ! = "goalie"
How about the road game scores for Clemson?
SELECT t2.All_Road FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'
Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.
SELECT avg(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = "F" AND T2.Election_Cycle = "Spring"
List the document type code for the document with the id 2.
SELECT document_type_code FROM Documents WHERE document_id = 2;
Which home team had an away team of the Brisbane Lions?
SELECT home_team FROM table_name_36 WHERE away_team = "brisbane lions"
Tell me the payment method used by the customer who ordered the least amount of goods in total.
SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) LIMIT 1
What country is Relax-Gam from?
SELECT country FROM table_name_83 WHERE team = "relax-gam"
How many more units of item no.16 were sold on the day with the highest max temperature in 2012 in store no.5 than in store no.10?
SELECT ( SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 5 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 ) - ( SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 6 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 )
Which countries has the most number of airlines whose active status is 'Y'?
SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Which Surname has Bats of r, and a Position of p, and a DOB of 20 may 1989?
SELECT surname FROM table_name_73 WHERE bats = "r" AND position = "p" AND dob = "20 may 1989"
What was Alexander Wurz's highest laps when he has a grid less than 14 and a time/retired of +1 lap.
SELECT MAX(laps) FROM table_name_52 WHERE time_retired = "+1 lap" AND driver = "alexander wurz" AND grid < 14
Show the title and publication dates of books.
SELECT T1.Title , T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID
What is the sum of averages with a long value of 32?
SELECT SUM(avg) FROM table_name_70 WHERE long = 32
Find the number of universities that have over a 20000 enrollment size for each affiliation type.
SELECT count(*) , affiliation FROM university WHERE enrollment > 20000 GROUP BY affiliation
Find the name of account that has the lowest total checking and saving balance.
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance LIMIT 1
Find the type code of the most frequently used policy.
SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1
Indicate the care plan needed for the patient living at 179 Sydni Roads, Taunton, MA 02780 US.
SELECT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.address = '179 Sydni Roads Taunton MA 02780 US'
What player has a penalty of holding on the DET team?
SELECT player FROM table_name_35 WHERE penalty = "holding" AND team = "det"
What is the film title and inventory id of the item in the inventory which was rented most frequently?
SELECT T1.title , T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1
What is the score of game 25?
SELECT score FROM table_name_37 WHERE game = 25
How many flights do we have?
SELECT COUNT(*) FROM FLIGHTS
Who was at Home when the Score was 13-19?
SELECT home FROM table_name_83 WHERE score = "13-19"
For the county where DeSantis Ron is from, what is the average female median age?
SELECT SUM(T4.female_median_age) / COUNT(T1.county) FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id INNER JOIN zip_data AS T4 ON T1.zip_code = T4.zip_code WHERE T3.first_name = 'DeSantis' AND T3.last_name = 'Ron'
Name both the alias and the bad alias of zip code 38015.
SELECT T1.alias, T2.bad_alias FROM alias AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 38015
Count the number of book clubs.
SELECT count(*) FROM book_club
What is the position of the player with more than 11 assists and 219 rebounds?
SELECT pos FROM table_name_85 WHERE asts > 11 AND rebs = 219
How much more total box office gross did the Walt Disney Company have in revenue in 1998 than in 1997?
SELECT SUM(CASE WHEN `Year` = 1998 THEN Total ELSE 0 END) - SUM(CASE WHEN `Year` = 1997 THEN Total ELSE 0 END) FROM revenue
What is the average bike availability in stations that are not located in Palo Alto?
SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city = "Palo Alto")
What country had the play Cyclops?
SELECT country FROM table_name_15 WHERE play = "cyclops"
What are the names of the procedures that cost more than 1000 and are procedures John Wen was trained in?
SELECT name FROM procedures WHERE cost > 1000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = "John Wen"
What is the average total number of passengers of airports that are associated with aircraft "Robinson R-22"?
SELECT avg(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = "Robinson R-22"
In the countries for which the latest trade data are from 2013, what was the GDP growth in 2014? List them in the ascending order of GDP.
SELECT DISTINCT T1.CountryCode, T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.LatestTradeData = 2013 AND T2.IndicatorName LIKE 'GDP growth (annual %)' AND T2.year = 2014 AND T2.Value > 0 ORDER BY T2.Value ASC
Please list the dates on which the sale of item no.5 in store no.3 exceeded 100 and the average wind speed exceeded 10.
SELECT T1.`date` FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.item_nbr = 5 AND T1.units > 100 AND T3.avgspeed > 10
Name the least week for opponent of washington redskins
SELECT MIN(week) FROM table_name_87 WHERE opponent = "washington redskins"
What are the general and specific descriptions of the most common crime incidents that happened in an aircraft?
SELECT T2.primary_description, T2.secondary_description FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.location_description = 'AIRCRAFT' GROUP BY T1.iucr_no ORDER BY COUNT(T1.iucr_no) DESC LIMIT 1
Show the home city with the most number of drivers.
SELECT home_city FROM driver GROUP BY home_city ORDER BY count(*) DESC LIMIT 1
In which year was the movie "La Antena" released?
SELECT movie_release_year FROM movies WHERE movie_title = 'La Antena'
What is the lowest year for the game called The Elder Scrolls v: Skyrim?
SELECT MIN(year) FROM table_name_99 WHERE game = "the elder scrolls v: skyrim"
How many male clients born in the year 1977 were given priority 0 in their complaints?
SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Male' AND T2.priority = 0 AND T1.year = 1997
What is the total number of Silver medals for the Nation with less than 1 Bronze?
SELECT COUNT(silver) FROM table_name_84 WHERE bronze < 1
What is the last name for that student?
SELECT last_name FROM Students WHERE first_name = "Emma"
type the attendance for playing with tampa bay buccaneers?
SELECT attendance FROM table_14656147_2 WHERE opponent = "Tampa Bay Buccaneers"
What record has Glenn Robinson (16) as the leading scorer?
SELECT record FROM table_name_83 WHERE leading_scorer = "glenn robinson (16)"
What was the lowest attendance for a game played @ Nashville Predators?
SELECT MIN(attendance) FROM table_name_85 WHERE opponent = "@ nashville predators"
State name of disabled students who have the longest duration of absense from school.
SELECT T1.name FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name ORDER BY T2.month DESC LIMIT 1
what is the store Rob Dinning's marketing code?
SELECT marketing_region_code from stores where store_name = "Rob Dinning"
What is the gender of artists with at least one English song?
select T1.gender from artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english' group by T1.artist_name having count ( * ) > = 1
What is the average amount of earnings for years under 2004 and money list rankings of 6?
SELECT AVG(earnings__) AS $_ FROM table_name_88 WHERE money_list_rank = "6" AND year < 2004
Find the number of students whose age is older than the average age for each gender.
SELECT count(*) , sex FROM student WHERE age > (SELECT avg(age) FROM student) GROUP BY sex
Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.
SELECT title , film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING count(*) < 3
What is the total number of Total Congregations, when % LDS is 0.54%, and when Population is greater than 105,275?
SELECT COUNT(total_congregations) FROM table_name_85 WHERE _percentage_lds = "0.54%" AND population > 105 OFFSET 275
Find the number of students who have the word "son" in their personal names.
SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
Among the users that permit the company to send regular emails to them, how many of them had made a transaction with a Visa card in July, 2014?
SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.SubscribedToEmailList = 'TRUE' AND T2.CreditCardType = 'Visa' AND STRFTIME('%Y-%m', T2.TransactionDate) = '2014-07'
What is the total number of Losses, when Position is greater than 8, when Goals For is greater than 34, when Points is "25", and when Draws is less than 5?
SELECT COUNT(losses) FROM table_name_13 WHERE position > 8 AND goals_for > 34 AND points = 25 AND draws < 5
What is the away team score at victoria park?
SELECT away_team AS score FROM table_name_49 WHERE venue = "victoria park"
Who was the writer who wrote the episode that was aired on September 11, 1972?
SELECT writer_s_ FROM table_25800134_17 WHERE airdate = "September 11, 1972"
List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15.
SELECT DISTINCT T2.Hardware_Model_name, T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15
When did the Summer Olympics occur in Tokyo?
SELECT summer_olympics FROM table_name_3 WHERE city = "tokyo"
What is the name of the winner who has won the most matches, and how many rank points does this player have?
SELECT winner_name , winner_rank_points FROM matches GROUP BY winner_name ORDER BY count(*) DESC LIMIT 1
What is the largest capacity for a stadium?
SELECT MAX(capacity) FROM table_25129482_1
What are the full names and hire dates for employees in the same department as someone with the first name Clara?
SELECT first_name , last_name , hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE first_name = "Clara")
what is the maximum vote percent of elections?
SELECT max ( Vote_Percent ) FROM election
What venue was the game played in when the away team was fitzroy?
SELECT venue FROM table_name_42 WHERE away_team = "fitzroy"
Rood & Taylor of o, and a Buechel & Manhart spelling (pronunciation) of o had what university of Minnesota?
SELECT university_of_minnesota FROM table_name_63 WHERE rood_ & _taylor = "o" AND buechel_ & _manhart_spelling__pronunciation_ = "o"
What is the 2004 that has a of grand slam tournaments in2006 ?
SELECT 2004 FROM table_name_82 WHERE 2006 = "grand slam tournaments"
What is the pinyin for the Chinese title 直感一笔?
SELECT pinyin FROM table_name_78 WHERE chinese_title = "直感一笔"
What are the average and minimum price (in Euro) of all products?
SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents
Who hosted the visiting team Baltimore Ravens?
SELECT host_team FROM table_name_24 WHERE visiting_team = "baltimore ravens"
On what surface was the opponent Michael Berrer?
SELECT surface FROM table_name_15 WHERE opponent = "michael berrer"
What is the 3rd place team for the year of 1955?
SELECT 3 AS rd_place_team FROM table_18618672_2 WHERE year = 1955
What is the total crowd count for the venue Princes Park?
SELECT SUM(crowd) FROM table_name_23 WHERE venue = "princes park"
Return the rank for which there are the fewest captains.
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
What is the highest number in series with director as Phil Abraham?
SELECT MAX(no_in_series) FROM table_26736040_1 WHERE directed_by = "Phil Abraham"
In what Years was the Player in MF Position?
SELECT years FROM table_name_71 WHERE position = "mf"
How many n are listed for berbers from siwa?
SELECT COUnT AS n FROM table_21481509_4 WHERE population = "Berbers from Siwa"
When did Hollywood Records release a digital download?
SELECT date FROM table_name_87 WHERE label = "hollywood records" AND format = "digital download"
What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 races?
SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 8 UNION SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5
What years was the jersey number(s) smaller than 3?
SELECT years FROM table_name_1 WHERE jersey_number_s_ < 3
who is the constructor when the grid is more than 10 and the time/retired is +1 lap?
SELECT constructor FROM table_name_59 WHERE grid > 10 AND time_retired = "+1 lap"
What is the genre of the song Tumi robe nirobe?
SELECT genre_is FROM song WHERE song_name = "Tumi robe nirobe"
List the name character awarded for the Outstanding Voice-Over Performance award in 2009.
SELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009 AND T1.award = 'Outstanding Voice-Over Performance';
What was the score for the away team when they played at lake oval?
SELECT away_team AS score FROM table_name_70 WHERE venue = "lake oval"
What is the score for Collingwood as the home team?
SELECT home_team AS score FROM table_name_85 WHERE home_team = "collingwood"
What was the loss of the game attended by 41,212?
SELECT loss FROM table_name_50 WHERE attendance = "41,212"
Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.
SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance
How many students are enrolled in the class taught by some professor from the accounting department?
SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting'
Which game type has least number of games?
SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1
What is listed the Favorite Professional Sport that's got a 2005 of 17.1%?
SELECT favorite_professional_sport FROM table_name_91 WHERE 2005 = "17.1%"
What is the pole position of the Portuguese Grand Prix?
SELECT pole_position FROM table_name_54 WHERE grand_prix = "portuguese grand prix"
Which country won in 1986?
SELECT country FROM table_name_59 WHERE year_s__won = "1986"