sentence
stringlengths
3
347
sql
stringlengths
18
804
What is the Qual listed on the Year of 1954?
SELECT qual FROM table_name_38 WHERE year = "1954"
In the year 2013, what was the outcome?
SELECT outcome FROM table_2516282_3 WHERE year = 2013
WHAT IS THE DATE WITH BOSTON ROAD TEAM AND 126-105 RESULT?
SELECT date FROM table_name_86 WHERE road_team = "boston" AND result = "126-105"
Please list the names of all the products under the type "promo brushed steel".
SELECT p_name FROM part WHERE p_type = 'PROMO BRUSHED STEEL'
Show different hometown of teachers and the number of teachers from each hometown.
SELECT Hometown , COUNT(*) FROM teacher GROUP BY Hometown
What is the name of the product with the color description 'yellow'?
SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow'
How many distinct parties are there for representatives?
SELECT count(DISTINCT Party) FROM representative
What is the description of the service type which offers both the photo product and the film product?
SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'
What is the injured that has skierlik as the location?
SELECT injured FROM table_name_9 WHERE location = "skierlik"
what is the total number of years for rockets where school/club team/country is baylor
SELECT COUNT(years_for_rockets) FROM table_11734041_20 WHERE school_club_team_country = "Baylor"
Which major has between 2 and 30 number of students? List major and the number of students.
SELECT Major , count(*) FROM Student GROUP BY Major HAVING count(Major) BETWEEN 2 AND 30;
What was bruce baldwin's pick #?
SELECT pick__number FROM table_2508633_5 WHERE player = "Bruce Baldwin"
Please list the total number of title with the production code 211.
SELECT COUNT(title) FROM table_12451376_2 WHERE production_code = 211
What are the top 5 genres? | Do you mean sort by the id number? | Yes please
select id,name from genres order by id desc limit 5
What territories is the Inside Sales Coordinator in charge of?
SELECT T3.TerritoryDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.Title = 'Inside Sales Coordinator'
Show the name of employees with three lowest salaries.
SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
Which publisher had the highest job level? Give his/her full name.
SELECT T1.fname, T1.minit, T1.lname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id ORDER BY T1.job_lvl DESC LIMIT 1
What date was game 37?
SELECT date FROM table_name_71 WHERE game = 37
Which country's city is Sendai?
SELECT country FROM table_name_5 WHERE city = "sendai"
What are the descriptions of the categories that products with product descriptions that contain the letter t are in?
SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'
What's the Japanese title when the Romaji Title was Atsu-Hime?
SELECT japanese_title FROM table_name_24 WHERE romaji_title = "atsu-hime"
what's the position with team being skilled racing team
SELECT position FROM table_14139408_1 WHERE team = "Skilled Racing team"
How did he place in 1970?
SELECT result FROM table_name_58 WHERE year = 1970
Corey Maggette from the United States plays what position?
SELECT position FROM table_name_70 WHERE nationality = "united states" AND player = "corey maggette"
Among the films directed by directors who direct the best, how many of them have an average rating of over 3.5?
SELECT COUNT(*) FROM ( SELECT DISTINCT T2.movieid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid INNER JOIN u2base AS T3 ON T2.movieid = T3.movieid WHERE T1.d_quality = 5 GROUP BY T2.movieid HAVING AVG(T3.rating) > 3.5 ) AS T1
Number of students in each major?
SELECT Major, count ( * ) FROM STUDENT GROUP BY major
Find the first and last name of students whose age is younger than the average age.
SELECT fname , lname FROM student WHERE age < (SELECT avg(age) FROM student)
Find the id for the trips that lasted at least as long as the average duration of trips in zip code 94103.
SELECT id FROM trip WHERE duration >= (SELECT avg(duration) FROM trip WHERE zip_code = 94103)
What was the type after 2004?
SELECT type FROM table_name_14 WHERE year > 2004
I need to know which train route passes through the most stations, please.
SELECT t1.name 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
Give the building that the instructor who teaches the greatest number of courses lives in.
SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 1
Which tournament did Patrick Rafter win?
SELECT tournament FROM table_name_96 WHERE winner = "patrick rafter"
What are the name, independence year, and surface area of the country with the smallest population?
SELECT Name, SurfaceArea, IndepYear FROM country ORDER BY Population LIMIT 1
For the university id 268, show its number of students in 2013.
SELECT num_students FROM university_year WHERE university_id = 268 AND year = 2013
Among the English comedy movies produced in the UK, how many movies with a running time of 3 was rated the highest by users between the age 45-50? Indicate the movie names.
SELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN u2base AS T3 ON T1.movieid = T3.movieid INNER JOIN users AS T4 ON T3.userid = T4.userid WHERE T1.country = 'UK' AND T2.genre = 'Comedy' AND T1.runningtime = 3 AND T3.rating = 5 AND T4.age BETWEEN 45 AND 50 AND T1.isEnglish = 'T'
Which business in fashion category has the most review?
SELECT T3.business_id FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Reviews AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Fashion' AND T1.category_id = 7 GROUP BY T3.business_id ORDER BY COUNT(T4.user_id) DESC LIMIT 1
Tell me the title of japan january 31, 2008
SELECT title FROM table_name_74 WHERE japan = "january 31, 2008"
Tell me the average for 1 yards
SELECT avg FROM table_name_65 WHERE yards = "1"
Which race has a winning team of Penske Racing, and a winning driver of Bobby Unser?
SELECT name FROM table_name_62 WHERE winning_team = "penske racing" AND winning_driver = "bobby unser"
When were the odds of winner 16.66?
SELECT year FROM table_21676617_1 WHERE odds_of_winner = "16.66"
What is the number of cities in the United States with more than 3 airports?
SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 3
display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.
SELECT first_name , last_name , salary , department_id , MAX(salary) FROM employees GROUP BY department_id
Show names of ships involved in a mission launched after 1928.
SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928
exactly
SELECT * from addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Kaitlin"
Return the first names and last names of all guests
SELECT guest_first_name , guest_last_name FROM Guests
Name the score for september 11
SELECT score FROM table_name_48 WHERE date = "september 11"
What was the result of the match on December 1, 1963?
SELECT result FROM table_name_43 WHERE date = "december 1, 1963"
What were the reasons that venues closed in the 1990s?
SELECT reason FROM table_name_59 WHERE closed = "1990s"
What is Away, when Home is "marathon"?
SELECT away FROM table_name_14 WHERE home = "marathon"
What are the title, id, and description of the movie with the greatest number of actors?
SELECT T2.title , T2.film_id , T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1
List the maximum scores of the team Boston Red Stockings when the team won in postseason?
SELECT max(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings';
What is the first and last name of the student who played the most sports?
SELECT T2.Fname , T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
How many region 1's did back to earth have?
SELECT COUNT(region_1) FROM table_25721_4 WHERE release = "Back to Earth"
What are the names of the singers who performed in a concert in 2014?
SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id = T2.singer_id JOIN concert AS T3 ON T1.concert_id = T3.concert_id WHERE T3.year = 2014
what's the status in the style of ballet/ gymnastics?
SELECT status FROM table_name_73 WHERE style = "ballet/ gymnastics"
What is the name of product purchased with transaction type P?
SELECT ProductID FROM Product WHERE ProductID IN ( SELECT ProductID FROM TransactionHistory WHERE TransactionType = 'P' )
What is the average capacity of the stadiums that were opened in year 2005?
SELECT avg(capacity) FROM stadium WHERE opening_year = 2005
What are the names of the top 3 expensive rooms?
SELECT roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3
What is the decile for Westminster Christian School with a state integrated authority?
SELECT decile FROM table_name_55 WHERE authority = "state integrated" AND name = "westminster christian school"
What is the date with 68,463 in attendance?
SELECT date FROM table_name_82 WHERE attendance = "68,463"
Show countries where a singer above age 40 and a singer below 30 are from.
SELECT country FROM singer WHERE age > 40 INTERSECT SELECT country FROM singer WHERE age < 30
Who is the winner in 2010?
SELECT winners FROM table_name_92 WHERE season = 2010
What was the date of the match played at MCG?
SELECT date FROM table_name_86 WHERE venue = "mcg"
What is the oldest year listed with the 1500 Louisiana Street name?
SELECT MIN(year) FROM table_name_87 WHERE name = "1500 louisiana street"
What is the time/retired with a toyota constructor and a 5 grid?
SELECT time_retired FROM table_name_93 WHERE constructor = "toyota" AND grid = 5
What is the ID of the longest song, please?
SELECT f_id FROM files ORDER BY duration DESC LIMIT 1
Among the cars over 3000lbs, how many of them cost less than $30000?
SELECT COUNT(T1.car_name) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.weight > 3000 AND T2.price < 30000
what team played on july 9
SELECT opponent FROM table_name_72 WHERE date = "july 9"
What date was the nascar nationwide series held?
SELECT record FROM table_name_57 WHERE date = "nascar nationwide series"
Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO"
In which city live the most staff? List the city name and number of staff.
SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;
What is origin country for a title that charted at 52?
SELECT origin FROM table_name_84 WHERE chart_no = 52
Show me the ID's from the products from supplier number 2 that are more expensive than this average, please.
SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > ( SELECT avg ( T2.product_price ) FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 )
What are the names of all directors who have made one movie except for the director named NULL?
SELECT director FROM Movie WHERE director != "null" GROUP BY director HAVING count(*) = 1
Find all the songs performed by artist with last name "Heilo"
SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo"
Find the number of routes that list John F Kennedy International Airport as a destination.
SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
Which planet has the transcription of wan suk?
SELECT planet FROM table_180802_3 WHERE transcription = "wan suk"
When did Oliver Jarvis have pole position?
SELECT date FROM table_21321935_2 WHERE pole_position = "Oliver Jarvis"
Give the code of the airport with the least flights.
SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.DestAirport OR T1.AirportCode = T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) LIMIT 1
What was the total number of games where A. Johnson (6) gave the most high assists?
SELECT COUNT(game) FROM table_11961582_4 WHERE high_assists = "A. Johnson (6)"
How many games were played by the team with 2 draws, less than 16 points and a position higher than 5?
SELECT COUNT(played) FROM table_name_74 WHERE drawn = 2 AND points < 16 AND position > 5
What was the Attendance at the Game with a Result of w 21–7?
SELECT AVG(attendance) FROM table_name_71 WHERE result = "w 21–7"
What is the oldest season that had a listed Super G score of 33?
SELECT MIN(season) FROM table_name_34 WHERE super_g = "33"
Find the first name of students who are living in the dorm that has most number of amenities.
SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)
Tony P. Hall was the incumbent in the race between what two candidates?
SELECT candidates FROM table_1341453_37 WHERE incumbent = "Tony P. Hall"
What is the denomination of the III Series?
SELECT denomination FROM table_name_8 WHERE series = "iii series"
What are the first names and support rep ids for employees serving 10 or more customers?
SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10
Who won a medal at the 2008 Beijing Olympics?
SELECT name FROM table_name_33 WHERE games = "2008 beijing"
What are their transaction type descriptions?
SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10
Find the names of all stores in Khanewal District.
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = "Khanewal District"
What is the average winning margin of all the matches SC Ganguly has played in?
SELECT CAST(SUM(T3.Win_Margin) AS REAL) / COUNT(*) 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'
What are ids of the all distinct orders, sorted by placement date?
SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed
Hi, can you please tell me what is the ID of the station whose maximum precipitation is higher than 50?
SELECT t2.id FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING max ( t1.precipitation ) > 50
List at least 15 phone models released under the OPPO brand.
SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 15
What is the highest lane value for a mark of 2:02.27 NR, with heats under 2?
SELECT MAX(lane) FROM table_name_82 WHERE mark = "2:02.27 nr" AND heat < 2
which chapter was Transmitted on wednesday if the episode of "363 the hangover part ii" was transmitted on monday?
SELECT wednesday FROM table_18173916_8 WHERE monday = "363 The Hangover Part II"
and can you also show me headquarters that have companies in the oil and gas industry?
SELECT distinct Headquarters FROM company WHERE Industry = "Oil and gas"
which countries' tv channels are playing some cartoon written by Todd Casey?
SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'
What is the mascot for South Bend Clay?
SELECT mascot FROM table_name_8 WHERE school = "south bend clay"
Which Team has a Score of 89-123?
SELECT team FROM table_name_40 WHERE score = "89-123"