sentence
stringlengths
3
347
sql
stringlengths
18
804
What was the total attendance for the 3:1 game?
SELECT SUM(attendance) FROM table_name_79 WHERE score = "3:1"
Which Res has a Time of 11:58?
SELECT res FROM table_name_27 WHERE time = "11:58"
Find the number of products with category "Spices" and typically sold above 1000.
SELECT count(*) FROM products WHERE product_category_code = "Spices" AND typical_selling_price > 1000
Find the city where the most customers live.
SELECT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id GROUP BY t3.city ORDER BY count(*) DESC LIMIT 1
Which Song has a Weeks at number one larger than 2, and an Issue date(s) of 17 april - 8 may?
SELECT song FROM table_name_52 WHERE weeks_at_number_one > 2 AND issue_date_s_ = "17 april - 8 may"
What is Score, when Opponent is "Ivo Minář"?
SELECT score FROM table_name_52 WHERE opponent = "ivo minář"
Who wrote the episode with a production code of 116?
SELECT written_by FROM table_29087004_2 WHERE production_code = 116
Name the end date for robert goebbels
SELECT end_date FROM table_name_50 WHERE minister = "robert goebbels"
What are the names of wrestlers who have never been eliminated?
SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)
What is Mark, when React is less than 0.148?
SELECT mark FROM table_name_59 WHERE react < 0.148
What is the lowest position of the club with 53 goals against, 26 points, and a -11 goal difference?
SELECT MIN(position) FROM table_name_70 WHERE goals_against = 53 AND points = 26 AND goal_difference > -11
What are the clean and jerk score of the body builder with the highest total score?
SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1
Hello! Can you provide me with a list of all customer ids and their associated policy type codes?
select T2.Customer_ID, T1.Policy_Type_Code from Policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id
What is the score with third place of stefan edberg?
SELECT score FROM table_name_33 WHERE third_place = "stefan edberg"
What years did number 54 play for the jazz
SELECT years_for_jazz FROM table_11545282_4 WHERE no = 54
What's the highest pick for SS position?
SELECT MAX(pick) FROM table_name_76 WHERE position = "ss"
Which Unit test has a MSDN integration of full, and a Projects templates of yes?
SELECT unit_test FROM table_name_76 WHERE msdn_integration = "full" AND projects_templates = "yes"
What date was the opposing team Poverty Bay?
SELECT date FROM table_name_94 WHERE opposing_team = "poverty bay"
Tell me the time for 6/6/77 release date and song title of way down
SELECT time FROM table_name_95 WHERE release_date = "6/6/77" AND song_title = "way down"
What is the number of projects that Sony doesn't manufacture?
SELECT count ( DISTINCT name ) FROM products WHERE name NOT IN ( SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony' )
What year was incumbent Michael A. Feighan first elected?
SELECT MIN(first_elected) FROM table_1342218_35 WHERE incumbent = "Michael A. Feighan"
How many students have milk or egg allergies?
SELECT count ( * ) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.allergy = "Milk" OR T1.allergy = "Eggs"
What are the names of all movies that were made after 2000 or reviewed by Brittany Harris?
SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000
Please calculate the total payment amount of customers who come from the USA.
SELECT SUM(T1.amount) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T2.country = 'USA'
What number in the season was episode 52 in the series?
SELECT MIN(_number) FROM table_22904707_1 WHERE no = 52
Find the department with the most employees.
SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;
How many segment C are there in the episode where segment D is bicycle tires?
SELECT COUNT(segment_c) FROM table_15187735_20 WHERE segment_d = "Bicycle Tires"
How many events did the device ID "3915082290673130000" join?
SELECT COUNT(event_id) FROM events WHERE device_id = 3915082290673130000
Name the result for 1810
SELECT result FROM table_2668352_14 WHERE first_elected = "1810"
What is the title when the series # is 7?
SELECT title FROM table_29747178_2 WHERE series__number = 7
What was the score on October 13?
SELECT score FROM table_name_94 WHERE date = "october 13"
Show order ids and the total quantity in each order.
SELECT order_id , sum(product_quantity) FROM Order_items GROUP BY order_id
How many different professors are there for the different schools?
SELECT count(*) , T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code
Where did Kisnorbo move from?
SELECT moving_from FROM table_22810095_8 WHERE name = "Kisnorbo"
What is the league for season 1955-56?
SELECT league FROM table_name_93 WHERE season = "1955-56"
What is the average attendance for the game on September 26, 1976?
SELECT AVG(attendance) FROM table_name_48 WHERE date = "september 26, 1976"
For businesses with long length reviews, which state are they located?
SELECT DISTINCT T1.state FROM Business AS T1 INNER JOIN Tips AS T2 ON T1.business_id = T2.business_id WHERE T2.tip_length = 'Long'
Which team had a qualifying 2 time of 1:01.093?
SELECT team FROM table_name_11 WHERE qual_2 = "1:01.093"
What is the average quantity of product that have been shipped by Federal Shipping in November 1996?
SELECT CAST(SUM(T2.Quantity) AS REAL) / COUNT(T2.OrderID) FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Shippers AS T3 ON T1.ShipVia = T3.ShipperID WHERE T1.ShippedDate LIKE '1996-11%' AND T3.CompanyName = 'Federal Shipping'
State name of students who have been absent for 5 months from school and do not have payment due.
SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T1.month = 5 AND T2.bool = 'neg'
Can you list the names in alphabetical order from top to bottom?
SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count ( * ) > 1 order by T1.name
How many have interactions with medicines?
SELECT count ( distinct enzyme_id ) FROM medicine_enzyme_interaction
Who is the player from Round 3 from Russia?
SELECT player FROM table_name_17 WHERE round = 3 AND nationality = "russia"
Engine 2.3 16v has how many cylinders?
SELECT cyl FROM table_name_1 WHERE engine = "2.3 16v"
In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'?
SELECT T1.season , T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem'
Name the opponents for game 5
SELECT opponents FROM table_21091145_1 WHERE game = 5
How many lots have share count smaller than 50?
SELECT Count ( T1.lot_id ) FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50
The deputy that left office in 2003 took office in which year?
SELECT took_office FROM table_name_90 WHERE left_office = "2003"
What is the date when the document "Marry CV" was stored?
SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV"
Who is the customer with the largest payment for rental films?
SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T2.amount) AS num FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1
What are their ids?
SELECT customer_id FROM Customers
Great, can you show the role code with the last employees? | Did you mean the employee with the largest id? | yes
SELECT role_code FROM Employees order by employee_id desc limit 1
List all the object classes in image 10.
SELECT DISTINCT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 10
Can you filter this list to show only the students? | Would you like me to show you a list of names and corresponding jobs for people whose job is student? | Yes please!
SELECT name, job FROM Person WHERE job = 'student'
What Event has an Outcome of other open tournaments?
SELECT event FROM table_name_34 WHERE outcome = "other open tournaments"
How many eviction results occurred with a eviction no. 12 and a vote to save of 2.76%?
SELECT COUNT(eviction_result) FROM table_15162479_8 WHERE eviction_no = 12 AND vote_to_save = "2.76%"
name the composer of balls to wall
SELECT distinct T2.composer FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall"
What game was developed by Naughty Dog?
SELECT genre FROM table_name_33 WHERE developer_s_ = "naughty dog"
What 1986 movie was nominated for a Tony Award for Best Book of a Musical?
select name from musical where year = 1986 and category = 'Best Book of a Musical' and Result = 'Nominated'
What is the place of the person with a score of 67-70=137?
SELECT place FROM table_name_96 WHERE score = 67 - 70 = 137
Which FCC info has an ERP W of 100 watts?
SELECT fcc_info FROM table_name_67 WHERE erp_w = "100 watts"
Show the average room count of the apartments that have booking status code "Provisional".
SELECT avg(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
List the course's name where students acquired a grade of D.
SELECT T1.name FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'D'
When a team wins 4, how much is the Maximum amount of points?
SELECT MAX(points) FROM table_14889048_2 WHERE wins = 4
What are the ids of the problems reported after the date of any problems reported by Rylan Homenick?
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Rylan" AND T4.staff_last_name = "Homenick" )
What player has a total of 297?
SELECT player FROM table_name_87 WHERE total = 297
What is the date for the game where Platense was the home side?
SELECT date FROM table_name_99 WHERE home = "platense"
What is the Shirt No for Henry Bell Cisnero whose height is less than 190?
SELECT MAX(shirt_no) FROM table_name_24 WHERE height < 190 AND player = "henry bell cisnero"
How many candidates were there in the year of 1987?
SELECT number_of_candidates FROM table_19698421_1 WHERE year = "1987"
What is the lowest grid with rider casey stoner and laps that are smaller than 27?
SELECT MIN(grid) FROM table_name_96 WHERE rider = "casey stoner" AND laps < 27
What year did actor Richard Farnsworth get nominated for an award?
SELECT year FROM table_name_73 WHERE actor = "richard farnsworth"
What is the compatible repository when the version is old version, no longer supported: 9 and default desktop environment is lxde?
SELECT compatible_repository FROM table_27329061_2 WHERE version = "Old version, no longer supported: 9" AND default_desktop_environment = "LXDE"
What type of ship is the Corbridge ?
SELECT type FROM ship WHERE name = "Corbridge"
How many transactions have the type code PUR?
SELECT count ( * ) FROM TRANSACTIONS WHERE transaction_type_code = "PUR"
What is the Born–Died for the person whose family moved to Australia at age 6?
SELECT born___died FROM table_name_93 WHERE connection_with_australia = "family moved to australia at age 6"
How many flights arriving in Aberdeen city?
SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport = T2.AirportCode WHERE T2.City = "Aberdeen"
How many airports haven't the pilot 'Thompson' driven an aircraft?
SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' );
Find all students taught by OTHA MOYER. Output the first and last names of the students.
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
What is the highest goals for that has a drawn less than 11, with a played less than 42?
SELECT MAX(goals_for) FROM table_name_54 WHERE drawn < 11 AND played < 42
Show me organization ids for organizations described as research
SELECT t1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id JOIN organisation_Types AS T3 ON T2.organisation_type = T3.organisation_type WHERE T3.organisation_type_description = 'Research'
Find the name of the club that has the most female students.
SELECT t1.clubname 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 t3.sex = "F" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
How many teams did the team with the most victories in 1915 play against? Indicate the name of the team who won the most games in 1915, as well as the names of the opposing team.
SELECT COUNT(DISTINCT oppID), T2.tmID, T2.oppID FROM Teams AS T1 INNER JOIN TeamVsTeam AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID WHERE T2.year = 1915 GROUP BY T2.tmID, T2.oppID ORDER BY SUM(T2.W) DESC LIMIT 1
Are there any captains that are included in both lists? | Did you mean ships that are included in both lists? | Oh sorry, yes ships that are included in both lists
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
How many Eredivisie teams have played in 2008?
SELECT COUNT(DISTINCT T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Eredivisie' AND T1.season = 2008
What was built in a class with less than 10, and the Downer Rail owner?
SELECT built FROM table_name_58 WHERE number_in_class < 10 AND owner = "downer rail"
What was the score when Françoise Dürr was partner?
SELECT score FROM table_177273_2 WHERE partner = "Françoise Dürr"
Please list the official full names of all the current legislators who have served in the U.S. House.
SELECT official_full_name FROM current WHERE house_history_id IS NOT NULL
What is the movie that Paul Schneider directed?
SELECT title FROM table_name_97 WHERE director = "paul schneider"
Can you tell me the Chinese that has the Chapter larger than 4, and the English Translation of food transformations?
SELECT chinese FROM table_name_7 WHERE chapter > 4 AND english_translation = "food transformations"
Show the organizer and name for churches that opened between 1830 and 1840.
SELECT organized_by, name FROM church WHERE open_date BETWEEN 1830 AND 1840
What is the title of Amenemhat I?
SELECT title FROM table_name_57 WHERE name = "amenemhat i"
List out the table name of countries using series code as SP.DYN.TO65.MA.ZS
SELECT T1.TableName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SP.DYN.TO65.MA.ZS'
Tell me the guns for third-rate ship of the line and rank of vice-admiral with year of 1802
SELECT guns FROM table_name_63 WHERE class = "third-rate ship of the line" AND rank = "vice-admiral" AND year = "1802"
How many volts has an energy-to-weight ratio of 54 kj/kg to 2.0v?
SELECT volts FROM table_name_44 WHERE energy_to_weight_ratio = "54 kj/kg to 2.0v"
Who has 48 points in the class of 500 cc?
SELECT team FROM table_name_11 WHERE points = 48 AND class = "500 cc"
Show the first name of all employees and their salary.
SELECT first_name, salary FROM employees
Who was the opponent in the Women's Cup 0 0 where Brancão Couto 0 is the scorer?
SELECT opponent FROM table_27654988_1 WHERE competition = "Women's Cup 0 0" AND scorers = "Brancão Couto 0"
How many Forfeits have Wins smaller than 8, and Losses larger than 16?
SELECT COUNT(forfeits) FROM table_name_84 WHERE wins < 8 AND losses > 16
Who owns the station on channel 33.3?
SELECT station_ownership FROM table_1404984_1 WHERE virtual_channel = "33.3"
What is the total number of students?
SELECT count(*) FROM Student