sentence
stringlengths
3
347
sql
stringlengths
18
804
Who ordered the book with the cheapest price?
SELECT T3.first_name, T3.last_name FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id ORDER BY T1.price ASC LIMIT 1
What is the inspection ID where the employee named "David Hodges" is currently employed in the "Kamayan Express" establishment?
SELECT T2.inspection_id FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T3.first_name = 'David' AND T3.last_name = 'Hodges' AND T1.dba_name = 'KAMAYAN EXPRESS'
Which Name has a Type of loan, and a Moving to of apollon kalamaria?
SELECT name FROM table_name_97 WHERE type = "loan" AND moving_to = "apollon kalamaria"
Count the number of customers who hold an account.
SELECT count(DISTINCT customer_id) FROM Accounts
How many locations have been used for ballparks named Memorial Stadium?
SELECT COUNT(location) FROM table_1987995_5 WHERE ballpark = "Memorial Stadium"
What is the total points when there is a refusal fault and the rider is H.R.H. Prince Abdullah Al-Soud?
SELECT SUM(points) FROM table_name_85 WHERE faults = "refusal" AND rider = "h.r.h. prince abdullah al-soud"
Name the coin with the highest percentage price changed in 24 hours. State the transaction date and price.
SELECT T1.name, T2.DATE, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_24h = ( SELECT MAX(percent_change_24h) FROM historical )
Show me a list of party themes
SELECT party_theme from party
Find the number of the products that have their color described as "red" and have a characteristic named "slow".
SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow"
List the number of shows that had 12.04 million viewers in the united states
SELECT COUNT(title) FROM table_22904780_1 WHERE us_viewers__million_ = "12.04"
How many votes were taken when the outcome was "6th voted out day 12"?
SELECT COUNT(vote) FROM table_1272844_2 WHERE finish = "6th voted Out Day 12"
How many laps did Nick Heidfeld drive on grids larger than 4?
SELECT SUM(laps) FROM table_name_77 WHERE grid > 4 AND driver = "nick heidfeld"
What are the titles of the episodes that have received more 7-star votes than the season average?
SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 AND T2.votes > 0.7 * ( SELECT CAST(COUNT(votes) AS REAL) / COUNT(CASE WHEN stars = 7 THEN 1 ELSE 0 END) FROM Vote );
How many dishes are there on page 1 of menu ID12882?
SELECT SUM(CASE WHEN T1.page_number = 1 THEN 1 ELSE 0 END) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id WHERE T1.menu_id = 12882
The venue of Brunswick Street Oval was used on what date?
SELECT date FROM table_name_53 WHERE venue = "brunswick street oval"
The 'More Stupider: A 90-Day Fiance Podcast' belongs to which category and what is the average rating of the podcast?
SELECT AVG(T3.rating) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'More Stupider: A 90-Day Fiance Podcast'
What was the premiere date for the episode whose alternate title was miłość i przeznaczenie?
SELECT series_premiere FROM table_29799700_2 WHERE alternante_title = "Miłość i przeznaczenie"
what is the average place when lost is more than 12?
SELECT AVG(place) FROM table_name_13 WHERE lost > 12
What are the last names and ages of the students who are allergic to milk and cat?
SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")
Which Attendance has a Round of 52, and a Home of södertälje sk?
SELECT MIN(attendance) FROM table_name_67 WHERE round = 52 AND home = "södertälje sk"
Can you tell me which statement has the most number of accounts? | Do you want to know its statement id? | Yes, what is its statement id?
SELECT T1.statement_id FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY count ( * ) DESC LIMIT 1
what is the stroke where the vehicle code is t211?
SELECT stroke__mm_ FROM table_23722304_2 WHERE vehicle_code = "T211"
Which IATA has a ICAO of slk?
SELECT iata FROM table_name_14 WHERE icao = "slk"
Who performed the song named "Badlands"? Show the first name and the last name.
SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands"
What countries have a stadium with a copacity greather than 60000?
SELECT distinct country FROM stadium WHERE capacity > 60000
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
SELECT flno , origin , destination FROM Flight ORDER BY origin
What is the pick number for Ray Giroux?
SELECT pick FROM table_name_52 WHERE player = "ray giroux"
Hi there! How are you? Can you show a list of all customer IDs for customers who have loans in the amount of 5000 or more?
SELECT T1.cust_id FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum ( T2.amount ) > = 5000
Which team offers the lowest average salary? Give me the name and id of the team.
SELECT T1.name , T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY avg(T2.salary) ASC LIMIT 1;
What are the investor ID and details for the investor who had the earliest transaction date?
SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY T2.date_of_transaction ASC LIMIT 1
List all the representatives in 1789 along with the districts and state.
SELECT T2.district, T2.state FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start LIKE '1789%'
Give the name of the movie which the song "I Thought I Lost You" is associated with.
SELECT movie_title FROM characters WHERE song = 'I Thought I Lost You'
How many people have the 747-400 certificate? | Do you mean the name of Boeing 747-400 in the Boeing 747-400 table ? | yes
SELECT count ( * ) FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid where T2.name = "Boeing 747-400"
Find the papers which have "Olin Shivers" as an author.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers"
Who was the opponent when they played after Game 26 and their record was 23-4?
SELECT opponent FROM table_name_2 WHERE game > 26 AND record = "23-4"
Return the names of all counties sorted by county name in descending alphabetical order.
SELECT County_name FROM county ORDER BY County_name DESC
Whats the total passengers london waterloo has?
SELECT Total_Passengers FROM station where name = "London Waterloo"
Where did Croatia lead?
SELECT lead FROM table_name_1 WHERE nation = "croatia"
What cover has a published date of May 27, 2009 (hc) May 20, 2009 (tpb)?
SELECT cover FROM table_name_12 WHERE published = "may 27, 2009 (hc) may 20, 2009 (tpb)"
Tell me the average units sold for square enix
SELECT AVG(units_sold) FROM table_name_46 WHERE publisher = "square enix"
In what round was lyon (32) a 5 seed?
SELECT lyon__32_ FROM table_20711545_1 WHERE seed = 5
Name the hanja for hangul of 주
SELECT hanja FROM table_name_77 WHERE hangul = "주"
What is the average weight in pounds of all the players with the highest prospects for the draft?
SELECT CAST(SUM(T2.weight_in_lbs) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.CSS_rank = ( SELECT MAX(CSS_rank) FROM PlayerInfo )
What is the ranking criteria ID of Brown University in 2014?
SELECT T1.ranking_criteria_id FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' AND T1.year = 2014
Find the id and number of shops for the company that produces the most expensive furniture.
SELECT t1.manufacturer_id , t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.Price_in_Dollar DESC LIMIT 1
Count the number of institutions.
SELECT count(*) FROM inst
Among all players drafted by the Toronto Maple Leafs, identify the percentage who are from Eastern Europe.
SELECT CAST(COUNT(CASE WHEN nation IN ('Belarus', 'Czech Rep.', 'Slovakia', 'Ukraine') THEN ELITEID ELSE NULL END) AS REAL) * 100 / COUNT(ELITEID) FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs'
List the publication dates of publications with 3 lowest prices.
SELECT Publication_Date FROM publication ORDER BY Price ASC LIMIT 3
What is the frequency when callsign is dxru-fm?
SELECT frequency FROM table_23915973_1 WHERE callsign = "DXRU-FM"
Which Driver has an Entrant of Arrows Racing Team and Rounds 1-3?
SELECT driver FROM table_name_25 WHERE entrant = "arrows racing team" AND rounds = "1-3"
Display the employee ID and salary of all employees who report to payam (First name)
SELECT employee_id , salary FROM employees WHERE manager_id = ( SELECT employee_id FROM employees WHERE first_name = 'Payam' )
What is the total number of Week(s), when Attendance is 61,603?
SELECT COUNT(week) FROM table_name_23 WHERE attendance = "61,603"
Which Opponent has a Score of 3–6, 5–7?
SELECT opponent FROM table_name_52 WHERE score = "3–6, 5–7"
What is the mother tongue language shared by 300 people in 2006?
SELECT mother_tongue FROM table_name_94 WHERE population__2006_ = 300
Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities.
SELECT catalog_entry_name , capacity FROM Catalog_Contents WHERE price_in_dollars > 700
Park Dietz was credited in which role in the episode titled "Cherished"?
SELECT T2.role FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T3.name = 'Park Dietz' AND T2.credited = 'true'
what is the name of every pilot who is at least 25 years old?
SELECT Name FROM pilot WHERE Age >= 25
WHAT IS THE TOTAL NUMBER WITH A ROUND BIGGER THAN 7 AND PICK OF 21?
SELECT COUNT(overall) FROM table_name_73 WHERE round > 7 AND pick = 21
Which podiums have a final placing of 10th?
SELECT podiums FROM table_15852257_1 WHERE final_placing = "10th"
Where did they play and how many attended game number 75?
SELECT location_attendance FROM table_27704187_11 WHERE game = 75
What is his name?
SELECT name FROM user_profiles WHERE name LIKE '%Swift%'
Who played Peter Pan in the 1990 Broadway?
SELECT 1990 AS _broadway FROM table_10312547_1 WHERE character = "Peter Pan"
What are the names of all players that got more than the average number of points?
SELECT name FROM player WHERE points > (SELECT avg(points) FROM player)
How many picks had less than 11 rounds and a player of Charley Casey?
SELECT SUM(pick) FROM table_name_29 WHERE round < 11 AND player = "charley casey"
What was the weekly rank by Virgin media for the title aired on May 20, 2010?
SELECT MIN(weekly_rank_virgin_media) FROM table_26826304_2 WHERE air_date = "May 20, 2010"
Show the name of buildings that do not have any institution.
SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution)
On what date did the country have a gross domestic product 400% higher than Saint Kitts and Nevis become independent?
SELECT Independence FROM politics WHERE country = ( SELECT country FROM economy WHERE GDP = 1100 )
What is the number of reviewers?
SELECT COUNT ( * ) FROM Reviewer
What are the department ids, full names, and salaries for employees who make the most in their departments?
SELECT first_name , last_name , salary , department_id , MAX(salary) FROM employees GROUP BY department_id
What is the to total number of par with laurie ayton?
SELECT COUNT(to_par) FROM table_name_99 WHERE player = "laurie ayton"
What is the name of the player from Vanderbilt University?
SELECT player FROM table_name_43 WHERE school = "vanderbilt university"
List the number of assists against illinois-chicago.
SELECT assists FROM table_26360571_2 WHERE opponent = "Illinois-Chicago"
Thank you for that! Could you filter that list to show only the church names and ids of churches that have hosted 2 or more weddings?
SELECT T1.name, T1.church_id FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING count ( * ) > = 2
List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.
SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
Provide the rooms of faculties with rank professor who live in building NEB?
SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB"
How many artists do we have?
SELECT COUNT(*) FROM artist
What is the reason for sales order "51883"?
SELECT T2.Name FROM SalesOrderHeaderSalesReason AS T1 INNER JOIN SalesReason AS T2 ON T1.SalesReasonID = T2.SalesReasonID WHERE T1.SalesOrderID = 51883
What is the total number of unique official languages spoken in the countries that are founded before 1930?
SELECT count(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = "T"
Name the number of international frieghts for domestic mail of 260
SELECT COUNT(international_freight) FROM table_1754531_4 WHERE domestic_mail = 260
What year was the Spanish Grand Prix where Emerson Fittipaldi drove?
SELECT year FROM table_name_30 WHERE event = "spanish grand prix" AND driver = "emerson fittipaldi"
Please show the names and the players of clubs.
SELECT T1.name , T2.Player_id FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID
Find the average prices of all products from each manufacture, and list each company's name.
SELECT avg(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name
What is the total number of playoffs held in exactly 2006?
SELECT COUNT(playoffs) FROM table_1999350_1 WHERE year = 2006
What is the employment and payment status of student110?
SELECT T1.bool FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name WHERE T1.name = 'student110'
If the qatari male is 1104, what is the grand total?
SELECT MAX(grand_total) FROM table_26214389_3 WHERE qatari_male = 1104
Robert S. Flanzer was the Free Libertarian ticket with who listed as the Liberal Ticket?
SELECT liberal_ticket FROM table_name_51 WHERE free_libertarian_ticket = "robert s. flanzer"
How many weeks on top for volumes associated with the artist aged 24 or older?
SELECT count ( weeks_on_top ) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age > = 24
How many dorms are there?
SELECT count(*) FROM dorm
What is the average number of EVA for the Orion?
SELECT AVG(number_of_s_eva) FROM table_name_50 WHERE lunar_lander = "orion"
What is the download of the varies catch-up period?
SELECT download FROM table_name_55 WHERE catch_up_period = "varies"
What is the total number of purchases for members with level 6?
SELECT count(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
What are the names of the workshop groups that have bookings with status code "stop"?
SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop"
What is the enrollment of that college?
SELECT enr FROM College WHERE enr > 10000 AND state = "LA"
What is the production number for Bell Hoppy in the MM Series?
SELECT COUNT(production_number) FROM table_name_21 WHERE series = "mm" AND title = "bell hoppy"
please show me the average age of those employees
SELECT avg ( T2.age ) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200
What was the maximum finish position of the car whose constructor was Joe Gibbs Racing, driven by Denny Hamlin?
SELECT MAX(pos) FROM table_27396005_2 WHERE constructor = "Joe Gibbs Racing" AND driver = "Denny Hamlin"
What is the middle name of the legislator whose birthday was on 8/24/1956?
SELECT middle_name FROM current WHERE birthday_bio = '1956-08-24'
Which Transfer fee has Ends larger than 2011, and a Moving from of psv?
SELECT transfer_fee FROM table_name_27 WHERE ends > 2011 AND moving_from = "psv"
What is the percentage of preprints of John Van Reenen's papers?
SELECT CAST(SUM(CASE WHEN T1.ConferenceId = 0 AND T1.JournalId = 0 THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'John Van Reenen'
Which position was in Orlando in 2000?
SELECT position FROM table_name_15 WHERE years_in_orlando = "2000"