sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
In what Games did Patrick Etolu compete? | SELECT games FROM table_name_60 WHERE name = "patrick etolu" |
What are the codes corresponding to document types for which there are less than 3 documents? | SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*) < 3 |
What is the total number of Silver for the Nation with more than 1 Bronze and a Rank less than 5? | SELECT COUNT(silver) FROM table_name_26 WHERE bronze > 1 AND rank < 5 |
I need to know the number of checking accounts for each account name. | SELECT count ( * ) , T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name |
What is the profit on net of the vendor with the highest standard price? If there are two vendors of the same amount, calculate only for one vendor. | SELECT LastReceiptCost - StandardPrice FROM ProductVendor ORDER BY StandardPrice DESC LIMIT 1 |
Show the names of editors of age 24. | SELECT Name FROM editor WHERE Age = 24 |
Thank you! Can you show me a list of all of the book titles published by Alyson? | select Book_Title from book_club where Publisher = 'Alyson' |
When 8.9% is the electricity reduction percentage what is the £ saved? | SELECT £_saved FROM table_29538735_1 WHERE _percentage_electricity_reduction = "8.9%" |
Give the actual elapsed time of the flights with air carrier named Semo Aviation Inc.: SEM. | SELECT T2.ACTUAL_ELAPSED_TIME FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Semo Aviation Inc.: SEM' |
Which Centerfold model has a Cover model of irina voronina? | SELECT centerfold_model FROM table_name_81 WHERE cover_model = "irina voronina" |
How many schools in urban area requested for books resources? | SELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.resource_type = 'Books' AND T2.school_metro = 'urban' |
How many were in attendance during the game on January 9, 1988? | SELECT attendance FROM table_16119656_1 WHERE date = "January 9, 1988" |
How many suburban metros are there in Livingston Parish School District? | SELECT COUNT(projectid) FROM projects WHERE school_district = 'Livingston Parish School Dist' AND school_metro = 'suburban' |
What is the engine for the car with 3 points? | SELECT engine FROM table_name_6 WHERE points = 3 |
List all the load shapes of all head cars of each train and identify which load shape has the highest number. Calculate the percentage of the trains with the said head car that are running eas | SELECT DISTINCT T3.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC ) AS T3 UNION ALL SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 UNION ALL SELECT (CAST(COUNT(DISTINCT CASE WHEN T2.direction = 'east' THEN T2.id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.id)) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_shape = ( SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars AS T WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 ) |
Which away team has a tie number of 14? | SELECT away_team FROM table_name_62 WHERE tie_no = "14" |
What was the maximum vertical measurement if the horizon measurement is 640? | SELECT MAX(vertical) FROM table_272313_1 WHERE horizontal = 640 |
Which department offers the most number of degrees? List department name and id. | SELECT T2.department_name , T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY count(*) DESC LIMIT 1 |
What is her age? | SELECT age FROM Student WHERE Fname = "Linda" AND Lname = "Smith" |
Find the first and last name of students who are living in the dorms that have amenity TV Lounge. | SELECT T1.fname , T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') |
What are the distinct majors that students with treasurer votes are studying? | SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote |
How much lower in percentage is the unit price of Ikura in order no. 10273 than its standard unit price? | SELECT CAST((T1.UnitPrice - T2.UnitPrice) AS REAL) * 100 / T1.UnitPrice FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10273 AND T1.ProductName = 'Ikura' |
How many statements do we have? | SELECT count(*) FROM Statements |
For each payment method, return how many customers use it. | SELECT payment_method_code , count(*) FROM customers GROUP BY payment_method_code |
What is the mean vertical relief in feet when the Peak Name is Tower near mead wood road entrance and the elevation in feet is more than 1,410? | SELECT AVG(vertical_relief__ft_) FROM table_name_87 WHERE peak_name = "tower near mead wood road entrance" AND elevation__ft_ > 1 OFFSET 410 |
Who was the runner up when the won by 4 strokes? | SELECT runner_s__up FROM table_21649285_2 WHERE margin_of_victory = "4 strokes" |
How many professors have a Ph.D. in each department? | SELECT count(*) , dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code |
Please list the names of all the products ordered by Aimee Bixby in 2016. | SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND STRFTIME('%Y', T2.`Ship Date`) = '2016' |
What are the job ids for jobs done more than once for a period of more than 300 days? | SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2 |
what are the names of people who did not participate in the candidate election. | SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate) |
what is the minimum attendance with score 8.16 (64) – 8.12 (60) | SELECT MIN(attendance) FROM table_10566855_1 WHERE score = "8.16 (64) – 8.12 (60)" |
What was the Attendance on September 11, 1983? | SELECT attendance FROM table_name_49 WHERE date = "september 11, 1983" |
Show the id, name of each festival and the number of artworks it has nominated. | SELECT T1.Festival_ID , T3.Festival_Name , COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID |
What is the card type code with most number of cards? | SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
What is the owner of the channel that has the highest rating ratio? | SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1 |
Which opponent has 32194 as the attendance? | SELECT opponent FROM table_23466021_4 WHERE attendance = 32194 |
How many laps for a grid of over 18 and retired due to electrical failure? | SELECT SUM(laps) FROM table_name_31 WHERE grid > 18 AND time_retired = "electrical" |
What are the themes and locations of parties? | SELECT Party_Theme , LOCATION FROM party |
list the dates of debates | SELECT Date FROM debate |
The game in week 11 has what result? | SELECT result FROM table_name_70 WHERE week = 11 |
What is Tatyana Gubina's Weight? | SELECT weight FROM table_name_43 WHERE name = "tatyana gubina" |
What is the total number of weeks that the buffalo bills played against the San Diego Chargers? | SELECT SUM(week) FROM table_name_49 WHERE opponent = "san diego chargers" |
What`s the score in October 7. | SELECT score FROM table_27734286_1 WHERE date = "October 7" |
How many orders has Cordy Dumbarton made? | SELECT COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Cordy' AND T1.last_name = 'Dumbarton' |
State the address of drivers who transported the shipment with weight greater than 50000 pounds. | SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id GROUP BY T2.driver_id HAVING SUM(T1.weight) > 50000 |
What is the value for the byte string when the memory map, decimal, and floating points are all standard and the max memory is smaller than 512? | SELECT byte_string FROM table_name_23 WHERE memory_map = "standard" AND decimal = "standard" AND floating_point = "standard" AND max_memory__kwords_ < 512 |
What is the name of department where has the largest number of professors with a Ph.D. degree? | SELECT T2.dept_name , T1.dept_code FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T1.prof_high_degree = 'Ph.D.' GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1 |
Show the census ranking of cities whose status are not "Village". | SELECT Census_Ranking FROM city WHERE Status <> "Village" |
What home team plays at Princes Park? | SELECT home_team FROM table_name_62 WHERE venue = "princes park" |
what is the institution at akron, oh? | SELECT institution FROM table_name_78 WHERE location = "akron, oh" |
Mention the first name of employee who took care the order id 10250. | SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10250 |
What home team has a score of 2–1, when the away team was Telford United? | SELECT home_team FROM table_name_10 WHERE score = "2–1" AND away_team = "telford united" |
What is the date of the Rome to Florence course? | SELECT date FROM table_name_44 WHERE course = "rome to florence" |
What School/Club Team has a Player named Juan Dixon and a Position of guard? | SELECT school_club_team FROM table_name_58 WHERE position = "guard" AND player = "juan dixon" |
What is the price of the book with ISBN 9780763628321? | SELECT T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.isbn13 = 9780763628321 |
Tell me the average wins for class of 50cc and rank of 8th | SELECT AVG(wins) FROM table_name_47 WHERE class = "50cc" AND rank = "8th" |
What is Gary David Saunders' Tenure? | SELECT tenure FROM table_name_23 WHERE name = "gary david saunders" |
Find the title and score of the movie with the lowest rating among all movies directed by each director. | SELECT T2.title , T1.stars , T2.director , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director |
whatthe minimum round where grand prix is german grand prix | SELECT MIN(round) FROM table_1137704_2 WHERE grand_prix = "German grand_prix" |
What is the service type code of thing id 2? | select service_type_code from things where thing_id = 2 |
Show the outcome code of mailshots along with the number of mailshots in each outcome code. | SELECT outcome_code , count(*) FROM mailshot_customers GROUP BY outcome_code |
How many circuits had a winning team of #1 patrón highcroft racing ang gtc winning team #81 alex job racing ? | SELECT COUNT(circuit) FROM table_24037660_2 WHERE lmp_winning_team = "#1 Patrón Highcroft Racing" AND gtc_winning_team = "#81 Alex Job Racing" |
What was the highest number of extra points scored by Albert Herrnstein, when he scored more than 15 points total? | SELECT MAX(extra_points) FROM table_name_38 WHERE player = "albert herrnstein" AND points > 15 |
What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21' | SELECT DISTINCT T2.thing_id , T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' |
What were the starts when the points dropped 18? | SELECT races__starts_ FROM table_24937583_1 WHERE points__dropped_points_ = "18" |
List the ID of all professors who are not faculty member along with the courses taught by him/her. | SELECT T2.p_id, T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 AND T1.hasPosition <> 0 |
which providence's soccer stadium was founded in 2005? | SELECT province FROM table_27369069_1 WHERE founded = 2005 |
What is the Outcome when christophe rochus was partner, on 31 july 2005? | SELECT outcome FROM table_name_38 WHERE partner = "christophe rochus" AND date = "31 july 2005" |
When Collingwood was the home team who was the opposing away team? | SELECT away_team FROM table_name_52 WHERE home_team = "collingwood" |
Which menu page of "Ritz Carlton" has the biggest height? | SELECT T1.page_number FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.name = 'Ritz Carlton' ORDER BY T1.full_height DESC LIMIT 1 |
what is the customer name of customer id 3 | SELECT customer_name FROM Customers WHERE customer_id = 3 |
If team two is San Lorenzo, how many were on team one? | SELECT COUNT(team__number1) FROM table_16795394_3 WHERE team__number2 = "San Lorenzo" |
Find the average price of wines that are not produced from Sonoma county. | SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma') |
What were the US Open's final scores? | SELECT score_in_the_final FROM table_22597626_1 WHERE championship = "US Open" |
What is the lowest 1971 number of the Macedonian population with a 2002 value greater than 133 and a 1991 value less than 171? | SELECT MIN(number_1971) FROM table_name_15 WHERE 2002 > 133 AND 1991 < 171 |
Show me 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" |
How many silver medals did the country that won 20 gold medals win in the 1955 Pan American Games? | SELECT SUM(silver) FROM table_name_62 WHERE gold = 20 |
What is the average price of the orders made by a customer in Germany? | SELECT AVG(T3.o_totalprice) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY' |
What are first and last names of players participating in all star game in 1998? | SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998 |
What is the number of people on board at Iberia Airline, with the aircraft type of lockheed l-1049g? | SELECT AVG(people_on_board) FROM table_name_48 WHERE airline = "iberia" AND aircraft_type = "lockheed l-1049g" |
What is the lowest heat that had a time of 1:02.85 in a lane larger than 7? | SELECT MIN(heat) FROM table_name_40 WHERE time = "1:02.85" AND lane > 7 |
What is the email id of Iron Man? | select email from user_profiles where name = "Iron Man" |
Which team has a Game of 49? | SELECT team FROM table_name_18 WHERE game = 49 |
Which businesses are no longer in business but have a low number of votes useful? | SELECT DISTINCT T1.business_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T2.active LIKE 'FALSE' AND T1.review_votes_useful LIKE 'Low' |
Which country has the smallest land area in square kilometers for 19 consecutive years starting from year 1961? Indicate how much is its land area in square kilometers in those years and the income group of the country. | SELECT T1.CountryName, SUM(T1.Value) area, T2.IncomeGroup FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Land area (sq. km)' AND T1.Year >= 1961 AND T1.Year < 1980 GROUP BY T1.CountryCode ORDER BY SUM(T1.Value) ASC LIMIT 1 |
Calculate the bmi of the competitor id 147420. | SELECT CAST(T1.weight AS REAL) / (T1.height * T1.height) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.id = 147420 |
What is the most common status across all cities? | SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1 |
List the countries having more than 4 addresses listed. | SELECT country FROM addresses GROUP BY country HAVING count(address_id) > 4 |
What is mario domínguez's average Grid? | SELECT AVG(grid) FROM table_name_88 WHERE driver = "mario domínguez" |
Which country have completed vital registration? List all the countries. | SELECT ShortName FROM Country WHERE VitalRegistrationComplete = 'Yes' |
How many podiums for the driver with 18 stage wins? | SELECT COUNT(podiums) FROM table_18811741_15 WHERE stage_wins = 18 |
What's the total long for an avg/g over 0.2, fewer than 2 loss, and a gain less than 8? | SELECT COUNT(long) FROM table_name_30 WHERE avg_g > 0.2 AND loss < 2 AND gain < 8 |
What was the score for the match where the home team was Leicester City? | SELECT score FROM table_name_16 WHERE home_team = "leicester city" |
Can you give me the zip_postcode for Colorado | SELECT zip_postcode FROM addresses where state_province_county = 'Colorado' |
Indicate the id of the reviewer whose itunes id is 1516665400. | SELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.itunes_id = 1516665400 |
what is Tiger woods's age | SELECT age FROM head where name = "Tiger Woods" |
which rooms have a king bed? | SELECT * FROM Rooms WHERE bedtype = 'King' |
how many purchases did members with level 5 make? | SELECT count ( * ) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 5 |
Count the number of matches. | SELECT count(*) FROM matches |
Show all destinations and the number of flights to each destination. | SELECT destination , count(*) FROM Flight GROUP BY destination |
Subsets and Splits