sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What are their customer id's? | SELECT customer_id FROM customers |
How many shops have more staff than shop 10? | SELECT count ( * ) from shop where num_of_staff > ( select num_of_staff from shop where shop_id = 10 ) |
Name the rank for wins of 0 and points of 2 | SELECT rank FROM table_name_10 WHERE wins = 0 AND points = 2 |
Find the first name and last name of the instructor of course that has course name | SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = "COMPUTER LITERACY" |
What is the total number in class for the Whitehaven Coal? | SELECT SUM(number_in_class) FROM table_name_13 WHERE owner = "whitehaven coal" |
show the customer ids, first name and last name with card type and number | Do you mean card type code? | show the customer ids and card number | SELECT customer_id , card_number FROM Customers_cards |
What is the score 1 for the major league soccer all-star game? | SELECT score1 FROM table_name_20 WHERE competition_or_tour = "major league soccer all-star game" |
What is the lowest number of loses of the club with more than 42 goals scored, more than 20 goals conceded, and less than 3 draws? | SELECT MIN(loses) FROM table_name_30 WHERE goals_scored > 42 AND goals_conceded > 20 AND draws < 3 |
OK. What is it for Nancy Edwards? | SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" |
Which prod code was series 11? | SELECT production_code FROM table_25996938_1 WHERE no_in_series = 11 |
When was the date in 1786? | SELECT date FROM table_name_82 WHERE year = 1786 |
What is the CFL Team with #48 as the pick number? | SELECT cfl_team FROM table_name_98 WHERE pick__number = 48 |
List the full names and phone numbers of clients that were from the Pacific. | SELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific' |
Sum the total game sales in every region for platform ID 9658. | SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658 |
Name the pinyin for where population is 44617 | SELECT pinyin FROM table_1638437_2 WHERE population = 44617 |
Who is the pitcher from the 1983 season in location Kingdome? | SELECT pitcher FROM table_name_40 WHERE location = "kingdome" AND season = "1983" |
What Label has a Region of united states, and a Format of cassette? | SELECT label FROM table_name_68 WHERE region = "united states" AND format = "cassette" |
List the character names in the "Open Water" movie. | SELECT T2.character_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Open Water' |
How many points did the away team of st kilda score? | SELECT away_team AS score FROM table_name_84 WHERE away_team = "st kilda" |
Oh, I see, and what are the names of the players from UCLA? | SELECT Player FROM match_season where College = 'UCLA' |
What is the lowest amount of wins of someone who has 2 losses? | SELECT MIN(wins) FROM table_name_96 WHERE losses = 2 |
what is the least draws when the position is lower than 5, the points is 62 and played is more than 38? | SELECT MIN(draws) FROM table_name_98 WHERE position < 5 AND points = 62 AND played > 38 |
What company collaborated with non-hodgkin lymphoma? | SELECT collaboration FROM table_name_5 WHERE indication = "non-hodgkin lymphoma" |
What is the number of attendance values for ties having an opponent of Middlesbrough and result of 3-1? | SELECT COUNT(attendance) FROM table_name_2 WHERE opponent = "middlesbrough" AND result = "3-1" |
What are the order details of the products with price higher than 2000? | SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 |
Can you display the salary and name of the employees? | SELECT salary, name from employee |
How many team franchises are active, with active value 'Y'? | SELECT COUNT(*) FROM team_franchise WHERE active = 'Y' |
how many times was nation counted where athlete is shuhei nishida category:articles with hcards | SELECT COUNT(nation) FROM table_22355_50 WHERE athlete = "Shuhei Nishida Category:Articles with hCards" |
Which home team has more than 19,000 spectators? | SELECT home_team FROM table_name_73 WHERE crowd > 19 OFFSET 000 |
Find the name of tracks which are in Movies playlist but not in music playlist. | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' |
How many players 89 points? | SELECT COUNT(blocks) FROM table_25342713_5 WHERE points = 89 |
List down the territory IDs and descriptions existed in Southern region. | SELECT T1.TerritoryID, T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern' |
What is the average attendance on October 9, 1983? | SELECT AVG(attendance) FROM table_name_11 WHERE date = "october 9, 1983" |
What about Celine? | SELECT count ( * ) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid and T1.name = 'Celine Dion' |
Which job level is O'Rourke at? | SELECT job_lvl FROM employee WHERE lname = 'O''Rourke' |
What band performed when Samantha Mumba presented? | SELECT band FROM table_name_80 WHERE female = "samantha mumba" |
Who is the team captain for the team with sparkasse (düsseldorf) as the shirt sponsor? | SELECT team AS captain FROM table_name_41 WHERE shirt_sponsor = "sparkasse (düsseldorf)" |
Show the working years of managers in descending order of their level. | SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC |
What is the Result when the memphis grizzlies ( 2) were the loser? | SELECT result FROM table_name_10 WHERE loser = "memphis grizzlies ( 2)" |
What is the name and capacity for the stadium with highest average attendance? | SELECT name , capacity FROM stadium ORDER BY average DESC LIMIT 1 |
On what Date is Tie no 19? | SELECT date FROM table_name_36 WHERE tie_no = "19" |
How many colleges have enrollment greater than 18000? | SELECT count ( * ) FROM College WHERE enr > 18000 |
Calculate the sum of all the total amount donated to the essay project titled 'Lets Share Ideas' which were paid through paypal and indicate the city and poverty level. | SELECT SUM(T3.donation_total), school_city, poverty_level FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Lets Share Ideas' AND T3.payment_method = 'paypal' |
For the client who made the complaint call "CR0217298", what was his/her birthday? | SELECT T1.month, T1.day FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0217298' |
Name the date with a hard surface and tournament of usa f5, brownsville | SELECT date FROM table_name_83 WHERE surface = "hard" AND tournament = "usa f5, brownsville" |
What is the listed Status that has the Province of Ontario and Rank of 86? | SELECT status FROM table_name_19 WHERE province = "ontario" AND rank = 86 |
Student21 is enlisted in which organization and has the student been absent? | SELECT T2.month, T1.organ FROM enlist AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.`name` = T2.`name` WHERE T1.name = 'student21' |
How much higher is James Johnson's salary from the minimum salary of his title? | SELECT CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL) AS diff FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.lastname = 'Johnson' AND T1.firstname = 'James' |
What's the distance of the course of stage 4? | SELECT distance FROM table_name_73 WHERE stage = "4" |
What are the population and life expectancies in Brazil? | SELECT Population , LifeExpectancy FROM country WHERE Name = "Brazil" |
What is the casting temperature for the alloy with hardness 21? | SELECT casting_at__°c_ FROM table_name_98 WHERE hardness = "21" |
What is the least total seasons of the Vancouver 86ers? | SELECT MIN(total_seasons) FROM table_name_58 WHERE team = "vancouver 86ers" |
Which visitor has a Los Angeles home? | SELECT visitor FROM table_name_20 WHERE home = "los angeles" |
Which award description has a year later than 1994 with a date of December 6? | SELECT award_description_s_ FROM table_name_84 WHERE year > 1994 AND date = "december 6" |
what are the names and classes of the ships that do not have any captain yet? | SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain) |
What years did Orlando have stanley roberts on the team? | SELECT years_in_orlando FROM table_name_75 WHERE player = "stanley roberts" |
What is the value Others% when the value Others# is greater than 147 and the value Kerry% is 39.6%? | SELECT others_percentage FROM table_name_83 WHERE others_number > 147 AND kerry_percentage = "39.6%" |
Name the most points for independiente | SELECT MAX(points) FROM table_16940409_1 WHERE team = "Independiente" |
What is the most common type code of all the products? | SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT ( * ) DESC LIMIT 1 |
How many movies starring Morgan Freeman are suggested by parental guidance? | SELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Morgan Freeman' AND T1.`MPAA Rating` = 'PG' |
How about the most recent one? | Did you just want to know the recent date? | Yes | SELECT date FROM races ORDER BY date DESC LIMIT 1 |
Return the ids of documents that do not have expenses. | SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses |
Show the description and code of the attraction type most tourist attractions belong to. | SELECT T1.Attraction_Type_Description , T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 |
What is the Purpose of the Area Braidwood? | SELECT purpose FROM table_name_62 WHERE area_served = "braidwood" |
What driver was the winner when Joakim Bonnier was in the Pole Position? | SELECT winning_driver FROM table_name_78 WHERE pole_position = "joakim bonnier" |
How many materials are there for output power of ~0.1 pw per cycle (calculated)? | SELECT COUNT(material) FROM table_30057479_1 WHERE output_power = "~0.1 pW per cycle (calculated)" |
How many dishes appear in the right upper corner of the menu page? | SELECT COUNT(*) FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T1.dish_id = T2.id WHERE T1.xpos > 0.75 AND T1.ypos < 0.25 |
Please name any three parts that have an available quantity of more than 9998. | SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_availqty > 9998 LIMIT 3 |
What product has been ordered the greatest number of times? | SELECT t1.product_name FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count ( * ) DESC LIMIT 1 |
How many images have at least 5 "black" classes? | SELECT COUNT(IMGID) FROM ( SELECT T1.IMG_ID AS IMGID FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.ATT_CLASS = 'black' GROUP BY T1.IMG_ID HAVING COUNT(T1.ATT_CLASS_ID) >= 5 ) T3 |
Which event is in the 1952 summer olympics? | SELECT event FROM table_name_57 WHERE olympics = "1952 summer olympics" |
What is the affiliation of the University called Explorers? | SELECT affiliation FROM table_19210115_1 WHERE nickname = "Explorers" |
What was team number 2's Fluminense's 2nd leg? | SELECT 2 AS nd_leg FROM table_24426072_1 WHERE team__number2 = "Fluminense" |
What is the campus fee of "San Jose State University" in year 1996? | SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Jose State University" AND T2.year = 1996 |
Return all the distinct payment methods used by customers. | SELECT DISTINCT payment_method FROM customers |
where did marie-laure taya win? | SELECT venue FROM table_name_90 WHERE winner = "marie-laure taya" |
state all the spokesperson for the channel where commentator is dmitriy guberniyev | SELECT spokesperson FROM table_1992924_3 WHERE commentator = "Dmitriy Guberniyev" |
Count the number of patients who stayed in room 112. | SELECT count(patient) FROM stay WHERE room = 112 |
Which Engine has a Model of s430? | SELECT engine FROM table_name_71 WHERE model = "s430" |
What is the total number of suppliers from Germany? | SELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY' |
For all the games ended up with 1-1, what percentage of them are from Liga NOS division? | SELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1 |
Find the product type whose average price is lower than the average price of all products. | SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg ( product_price ) < ( SELECT avg ( product_price ) FROM products ) |
What episode number was written by Karin Gist? | SELECT MAX(no) FROM table_25851971_1 WHERE written_by = "Karin Gist" |
What are the nationalities of the player picked from Thunder Bay Flyers (ushl) | SELECT nationality FROM table_1013129_2 WHERE college_junior_club_team = "Thunder Bay Flyers (USHL)" |
What buildings were founded in 2003? | SELECT institution from institution where founded = 2003 |
From how many years did tampa, FL depart? | SELECT SUM(year) FROM table_name_76 WHERE departed_from = "tampa, fl" |
With a total of 11, and 10 rank points, what are the score points? | SELECT score_points FROM table_name_25 WHERE rank_points = "10" AND total = "11" |
How many account ids are on the table? | SELECT count ( Account_ID ) from accounts |
Which Competition was 1st Position with 57.03 in Notes? | SELECT competition FROM table_name_57 WHERE position = "1st" AND notes = "57.03" |
Which airlines have at least 10 flights? | SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline HAVING count(*) > 10 |
How many episodes were written by Ross brown? | SELECT COUNT(no_in_series) FROM table_2468961_2 WHERE written_by = "Ross Brown" |
Which Free polite has a Genitive 1 of *=ku? | SELECT free AS polite FROM table_name_13 WHERE genitive_1 = * = ku |
How many stations does this train run through? | SELECT count ( * ) FROM train AS t1 JOIN route AS t2 ON t1.id = t2.train_id GROUP BY t2.train_id ORDER BY count ( * ) DESC LIMIT 1 |
Who is the winner of the game happened on 2009/10/10, between "East Fife" and "Dumbarton"? | SELECT CASE WHEN FTR = 'H' THEN 'East Fife' ELSE 'Dumbarton' END WINNER FROM matchs WHERE Date = '2009-10-10' AND HomeTeam = 'East Fife' AND AwayTeam = 'Dumbarton' |
what is the sum of totaltk when yards is less than 0? | SELECT SUM(totaltk) FROM table_name_9 WHERE yards < 0 |
what are the endings of examples achilles, appendices, fæces | SELECT ending FROM table_17798093_20 WHERE examples = "Achilles, appendices, fæces" |
Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance. | SELECT T1.name , T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT avg(balance) FROM savings) |
What are the email addresses of teachers whose address has zip code "918"? | SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = "918" |
How many tries against got the club with 62 tries for? | SELECT tries_against FROM table_13564702_4 WHERE tries_for = "62" |
What is the total number of electorates in 2009 with a constituency of 193? | SELECT COUNT(number_of_electorates__2009_) FROM table_name_83 WHERE constituency_number = "193" |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.