sentence
stringlengths
3
347
sql
stringlengths
18
804
Can you find me the names of all the swimmers who have "win" results in the record?
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'
Please list the top 3 discounts with the highest discount percentage and fall under the reseller category.
SELECT Description, DiscountPct FROM SpecialOffer WHERE Category = 'Reseller' ORDER BY DiscountPct DESC LIMIT 0, 3
What is the name of the artist, for each language, that has the most songs with a higher resolution than 500?
SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
To the products which could make the profit as 21.9037, what were their list price after October of 2012?
SELECT T1.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ListPrice - T1.StandardCost > 21.9037 AND STRFTIME('%Y-%m-%d', T2.StartDate) >= '2012-10-01'
What's the largest crowd that attended a game at junction oval?
SELECT MAX(crowd) FROM table_name_36 WHERE venue = "junction oval"
Awesome! Can you also add to this list the number of registered courses for each of these students?
SELECT T1.student_id , count ( * ) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
Name the most game for us airways center 16,470
SELECT MIN(game) FROM table_27756474_6 WHERE location_attendance = "US Airways Center 16,470"
Give me the id, role and email of the professionals who did not perform any treatment on dogs.
SELECT professional_id , role_code , email_address FROM Professionals EXCEPT SELECT T1.professional_id , T1.role_code , T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id
For the triathlon with a bike (40km) of 58:20 what is the total time?
SELECT total_time FROM table_name_21 WHERE bike__40km_ = "58:20"
What batting style does player Shahid Afridi have?
SELECT batting_style FROM table_name_88 WHERE player = "shahid afridi"
What is the release title of the single under the "funk" tag that was released the oldest?
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'funk' AND T1.releaseType = 'single' ORDER BY T1.groupYear LIMIT 1
What are the names of scientists who have not been assigned a project?
SELECT Name FROM scientists WHERE ssn NOT IN (SELECT scientist FROM AssignedTo)
Name the f/laps for gp2 series
SELECT f_laps FROM table_24587026_1 WHERE series = "GP2 series"
What team played in the Bundesliga league with an Away record of 2-1?
SELECT teams FROM table_name_6 WHERE league = "bundesliga" AND away = "2-1"
List the names of the city with the top 5 white percentages.
SELECT Name FROM city ORDER BY White DESC LIMIT 5
What is the sum of Second, when Total is less than 70, when Premier is less than 20, and when First is greater than 18?
SELECT SUM(second) FROM table_name_1 WHERE total < 70 AND premier < 20 AND first > 18
What was the home team score when the VFL played at Princes Park?
SELECT home_team AS score FROM table_name_86 WHERE venue = "princes park"
Show the location code, the starting date and ending date in that location for all the documents.
SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations
Find the id and name of the museum that has the most staff members?
SELECT museum_id , name FROM museum ORDER BY num_of_staff DESC LIMIT 1
What is the largest Average with Goals smaller than 34, Matches larger than 30, and a Team of cultural leonesa?
SELECT MAX(average) FROM table_name_80 WHERE goals < 34 AND matches > 30 AND team = "cultural leonesa"
Which Party has a Member of david jull?
SELECT party FROM table_name_75 WHERE member = "david jull"
How many phones are there?
SELECT COUNT(*) FROM phone
How many points were scored when the podiums is 0 and position is 10th?
SELECT points FROM table_25318033_1 WHERE podiums = 0 AND position = "10th"
What are the names of conductors whose nationalities are not "USA"?
SELECT Name FROM conductor WHERE Nationality != 'USA'
List the number of different series names and contents in the TV Channel table.
SELECT count(DISTINCT series_name) , count(DISTINCT content) FROM TV_Channel;
Attendance of 29,000 occurred on what date?
SELECT date FROM table_name_80 WHERE attendance = "29,000"
Give the name and score of the university ID 124.
SELECT T2.university_name, T1.score FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.id = 124
How many units of item no.5 were sold in store no.3 on average on the days when the max temperature exceeded 90?
SELECT CAST(SUM(T1.units) AS REAL) / COUNT(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 T1.store_nbr = 3 AND T1.item_nbr = 5 AND T3.tmax > 90
Among all the matches SC Ganguly has played in, what is the highest winning margin?
SELECT MAX(T3.Win_Margin) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE T1.Player_Name = 'SC Ganguly'
Which Attendance has a Tie # of 15?
SELECT attendance FROM table_name_25 WHERE tie_no = "15"
What are all the report for the Belgian Grand Prix?
SELECT report FROM table_26258348_4 WHERE grand_prix = "Belgian grand_prix"
Who was the leader at the summit when the stage was larger than 14, the category was 1, the start was Saint-Girons, and the finish was Cauterets?
SELECT leader_at_the_summit FROM table_name_78 WHERE stage > 14 AND category = 1 AND start = "saint-girons" AND finish = "cauterets"
What is the smallest drawn with a position bigger than 10 and a played less than 20?
SELECT MIN(drawn) FROM table_name_51 WHERE position > 10 AND played < 20
State the Wikipedia page title that has revision page id of 28040864.
SELECT title FROM pages WHERE revision = 28040864
What is the earliest closed year in the country of france?
SELECT MIN(closed__as_a_rl_stadium_) FROM table_name_94 WHERE country = "france"
What are the candidates for new york 35?
SELECT candidates FROM table_1342233_32 WHERE district = "New York 35"
What kind of location in Austin reported the most number of crimes?
SELECT T2.location_description FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T1.district_name = 'Austin' GROUP BY T2.location_description ORDER BY COUNT(T2.case_number) DESC LIMIT 1
What is the largest mass for Tycho Crater?
SELECT MAX(mass__kg_) FROM table_name_59 WHERE landing_zone = "tycho crater"
What is the region of 1149 El Camino Real?
SELECT T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_num = 1149 AND T1.street_name = 'el camino real'
Please list the top five players with the most steals in the year 1997. Please give their full name.
SELECT DISTINCT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1997 ORDER BY T2.steals DESC LIMIT 5
What is Years, when Win-Loss is 11-60?
SELECT years FROM table_name_55 WHERE win_loss = "11-60"
What are the themes and years for exhibitions, sorted by ticket price descending?
SELECT theme , YEAR FROM exhibition ORDER BY ticket_price DESC
What are the years for Eileen Derbyshire with a duration of 52 years?
SELECT years FROM table_name_4 WHERE duration = "52 years" AND actor = "eileen derbyshire"
What is the Home team at corio oval?
SELECT home_team FROM table_name_57 WHERE venue = "corio oval"
Describe the supplier companies, cities and products which total production amount is more than 120.
SELECT T2.CompanyName, T2.City, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitsInStock + UnitsOnOrder > 120
Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .
select t1.first_name from students as t1 join addresses as t2 on t1.permanent_address_id = t2.address_id where t2.country = 'haiti' or t1.cell_mobile_number = '09700166582'
List the name of ships that are not involved in any mission
SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission)
In what year did the only team to beat the Houston in the final round of postseason series games earn its lowest ranking?
SELECT T2.year FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T1.round = 'DSF' AND T1.tmIDLoser = 'HSM' ORDER BY T2.rank ASC LIMIT 1
include member id in this table
SELECT T1.Name ,t1.Member_ID FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC
What is the value for congi core 1 if the code name is Redwood and core clock(mhz) is 500?
SELECT config_core_1 FROM table_25005714_3 WHERE code_name = "Redwood" AND core_clock___mhz__ = "500"
Who were they playing when Bird (1-4) had a loss?
SELECT opponent FROM table_name_42 WHERE loss = "bird (1-4)"
what is the bed type of the column "room in HBB ? | Do you mean the bed type for the room with id HBB? | yes
SELECT bedtype FROM rooms WHERE roomid = "HBB"
What products are sold at the store named Miramichi?
SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = "Miramichi"
What is the finish of player Hale Irwin?
SELECT finish FROM table_name_25 WHERE player = "hale irwin"
For each party, return its theme and the name of its host.
SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID
Which publisher released Martial Law: Substitutes?
SELECT publisher FROM table_name_47 WHERE release_title = "martial law: substitutes"
What is the Proto-Germanic origin associated with an allophone of [[[|k]]]?
SELECT proto_germanic_origin FROM table_name_15 WHERE sound__allophone_ = "[[[|k]]]"
What is the FA Cup App for Squad Number 3 having fewer than 4 league goals?
SELECT fa_cup_apps FROM table_name_53 WHERE league_goals < 4 AND squad_no = 3
Who won the race at the Jersey circuit?
SELECT winning_driver FROM table_1140119_5 WHERE circuit = "Jersey"
What is the phone number of the performer Ashley?
SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = "Ashley"
What is the game number for series 4-2?
SELECT COUNT(game) FROM table_name_56 WHERE series = "4-2"
Provide me with the name of the writer with the production code 210.
SELECT writer_s_ FROM table_12451376_2 WHERE production_code = 210
List all titles which have year to date sales higher than the average order by pubisher name.
SELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.ytd_sales > ( SELECT AVG(ytd_sales) FROM titles )
Return the maximum number of points for climbers from the United Kingdom.
SELECT max(Points) FROM climber WHERE Country = "United Kingdom"
what type of card is used by customer id 6?
SELECT card_type_code from Customers_Cards where customer_id = 6
Find the title, credit, and department name of courses that have more than one prerequisites?
SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1
What's the ratio of gender in actors to actress in all the UK movies?
SELECT CAST(SUM(IIF(T3.a_gender = 'M', 1, 0)) AS REAL) / SUM(IIF(T3.a_gender = 'F', 1, 0)) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T1.country = 'UK'
What Club team has an average of 8, plays kaj linna, and has an overall larger than 131?
SELECT club_team FROM table_name_97 WHERE overall > 131 AND round = 8 AND player = "kaj linna"
What is the Rank of the Character with Tenure of 2011?
SELECT rank FROM table_name_2 WHERE tenure = "2011"
What is the Result of the 2013 (86th) Ceremony?
SELECT result FROM table_name_77 WHERE year__ceremony_ = "2013 (86th)"
Could you give me the number of dorms for each gender?
SELECT count ( * ) , gender FROM dorm GROUP BY gender
Find the names of customers who have bought by at least three distinct products.
SELECT DISTINCT T1.customer_name 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_id HAVING COUNT (DISTINCT T3.product_id) >= 3
What is Moving, when Type is "Transfer", and when Name is "Andy Webster"?
SELECT moving_from FROM table_name_27 WHERE type = "transfer" AND name = "andy webster"
How many devices are in stock at Dinas Device?
SELECT count ( Device_ID ) FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID where Shop_Name = 'Dinas Device'
For Peter Kohnke, show the name of his/her region.
SELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Peter Kohnke'
Name the number of title for number in series being 25
SELECT COUNT(title) FROM table_25810656_3 WHERE no_in_series = 25
Manager of lyman lamb / marty berghammer is in what league?
SELECT league FROM table_name_59 WHERE manager = "lyman lamb / marty berghammer"
What's the record of the game where Lebron James (16) was the leading scorer?
SELECT record FROM table_name_69 WHERE leading_scorer = "lebron james (16)"
For each phone, show its names and total number of stocks?
SELECT T2.Name , sum ( T1.Num_of_stock ) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name
Which Catalog has a Region of Canada and a Format of cd/dvd?
SELECT catalog FROM table_name_61 WHERE region = "canada" AND format = "cd/dvd"
What cinema has the highest capacity?
SELECT Name FROM cinema ORDER BY Capacity DESC LIMIT 1
What is total bonus given in all evaluations?
SELECT sum(bonus) FROM evaluation
Show first name and id for all customers with at least 2 accounts.
SELECT T2.customer_first_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2
Of the employees whose vacation hours are no more than 10, what is the age of the oldest employee at the time he/she was hired? Indicate his/her full name.
SELECT STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate), T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.VacationHours <= 10 ORDER BY STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) DESC LIMIT 1
Name the max top 5 for avg finish being 27.6
SELECT MAX(top_5) FROM table_2181798_1 WHERE avg_finish = "27.6"
What's Brazil's lane with a time less than 21.15?
SELECT MIN(lane) FROM table_name_55 WHERE nationality = "brazil" AND time < 21.15
Which course is more difficult, Intro to BlockChain or Computer Network?
SELECT name FROM course WHERE name = 'Intro to BlockChain' OR name = 'Computer Network' ORDER BY diff DESC LIMIT 1
How many 'United Airlines' flights depart from Airport 'AHD'?
SELECT count(*) FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T2.Airline = T1.uid WHERE T1.Airline = "United Airlines" AND T2.SourceAirport = "AHD"
What are the ids of high school students who do not have friends?
SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend
When was the game played at Princes Park?
SELECT date FROM table_name_20 WHERE venue = "princes park"
What is the total number of Points with Wins larger than 0, a Position of 12th, and Poles larger than 0?
SELECT SUM(points) FROM table_name_67 WHERE wins > 0 AND position = "12th" AND poles > 0
With a silver greater than 0, gold of 9 and a bronze less than 9, what is the lowest total listed?
SELECT MIN(total) FROM table_name_75 WHERE silver > 0 AND gold = 9 AND bronze < 9
Hello! Can you provide me with the song name for the song with the lowest resolution?
SELECT T2.song_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1
What was the score of Tommy Aaron (2) when the tournament was in georgia?
SELECT score FROM table_name_38 WHERE location = "georgia" AND winner = "tommy aaron (2)"
Name the total number of troops per one million being 2.76
SELECT COUNT(troops_per_one_million_population) FROM table_30108346_1 WHERE troops_per_$1_billion___usd___gdp = "2.76"
When were the products ordered by Cruz & Sons Co. on 2003-03-03 shipped?
SELECT t1.shippedDate FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Cruz & Sons Co.' AND t1.orderDate = '2003-03-03'
What was the score when St. Louis was the visiting team?
SELECT score FROM table_name_92 WHERE visitor = "st. louis"
What tournament was on May 31, 1987?
SELECT tournament FROM table_name_7 WHERE date = "may 31, 1987"
For each position, what is the minimum time students spent practicing?
SELECT min(T2.HS) , T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos
what is the credit score for Mary?
SELECT credit_score from customer where cust_name = "Mary"