sentence
stringlengths
3
347
sql
stringlengths
18
804
How many different genders are there in the dorms?
SELECT count(DISTINCT gender) FROM dorm
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;
Which major has most number of students?
SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1
What is the earliest year a Baylor player made the list?
SELECT MIN(year) FROM table_name_79 WHERE college_country = "baylor"
what is the highest number of dismissals in a match with 8 innings
SELECT COUNT(dismissals) FROM table_19870086_24 WHERE innings = 8
Identify the total weight of shipments transported to San Mateo, California, in 2016.
SELECT SUM(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'San Mateo' AND STRFTIME('%Y', T1.ship_date) = '2016'
What ride opened after 2011?
SELECT current_name FROM table_name_91 WHERE year_first_opened > 2011
What Year has an (Aramac) of 832 and a Population (Total) less than 3,762?
SELECT SUM(year) FROM table_name_42 WHERE _aramac_ = 832 AND population__total_ < 3 OFFSET 762
How many people were assisted in 1997?
SELECT people_assisted FROM table_name_14 WHERE year = "1997"
What years have joyce couwenberg as the character?
SELECT years FROM table_name_62 WHERE character = "joyce couwenberg"
Which category does "tofu" belong to?
SELECT T2.CategoryName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.ProductName = 'Tofu'
How many sanitarian employees in Chicago are from the zip code 60617?
SELECT COUNT(employee_id) FROM employee WHERE zip = '60617'
Please list the texts of all the tweets posted from Buenos Aires with a positive sentiment.
SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Sentiment > 0 AND T2.City = 'Buenos Aires'
Which town has the most villages with the hanzi 南流乡 and a population larger than 24,802?
SELECT MAX(villages) FROM table_name_92 WHERE hanzi = "南流乡" AND population > 24 OFFSET 802
What is the Winners when the United States is the runner-up at st. germain golf club?
SELECT winners FROM table_name_90 WHERE runners_up = "united states" AND venue = "st. germain golf club"
How many headquarters are there listed for HSBC?
SELECT COUNT(headquarters) FROM table_1682026_7 WHERE company = "HSBC"
What is the new classification for La Mirada, California?
SELECT new_classification FROM table_name_69 WHERE location = "la mirada, california"
What is the percentage of Harvard university's international students in 2011?
SELECT T1.pct_international_students FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'Harvard University'
Among the countries that use Bosnian as their language, how many of them don't have a positive population growth rate?
SELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country INNER JOIN population AS T3 ON T3.Country = T2.Country WHERE T2.Name = 'Bosnian' AND T3.Population_Growth < 0
Please list the home phone numbers of the employees who are in charge of the sales in the territories in the Eastern Region.
SELECT T1.HomePhone FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T4.RegionDescription = 'Eastern ' GROUP BY T1.HomePhone
What was the studio for The Hard Way in 1943?
SELECT studio FROM table_name_77 WHERE year = 1943 AND title = "the hard way"
What Main Location(s) has an Area of 19,800 HA?
SELECT main_location_s_ FROM table_name_16 WHERE area = "19,800 ha"
Write down the description and series code of Benin in year 2005.
SELECT T2.Description, T2.Seriescode FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.TableName = 'Benin' AND T2.Year = 'YR2005'
Great! Now can you update this list to include the genders of all of these individuals?
SELECT T1.staff_id , T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Department Manager"
what is the color code of product name "chervil"?
SELECT t1.color_code FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "chervil"
what is the capacity percentage of New Meadowlands Stadium
SELECT Capacity_Percentage FROM stadium where name = "New Meadowlands Stadium"
Which 1999 has 2000 as the year-end championship?
SELECT 1999 FROM table_name_40 WHERE 2000 = "year-end championship"
What is the record on October 13, when philadelphia was the home team?
SELECT record FROM table_name_47 WHERE home = "philadelphia" AND date = "october 13"
How many numbers have the product code of 2.6?
SELECT _number FROM table_20124413_2 WHERE prod_code = "2.6"
Name the Fixtures Sec which has a Season of 2009–2010
SELECT fixtures_sec FROM table_name_12 WHERE season = "2009–2010"
Which club has 15 losses and 14 wins?
SELECT club FROM table_name_60 WHERE losses = 15 AND wins = 14
Please list all the film titles.
SELECT title from film
How many product names does the supplier Exotic Liquids have?
SELECT COUNT(T1.ProductName) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Exotic Liquids'
Which Tournament has a 2002 of grand slam tournaments?
SELECT tournament FROM table_name_82 WHERE 2002 = "grand slam tournaments"
What is the birth date of the poker player with the lowest earnings?
SELECT T1.Birth_Date FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings ASC LIMIT 1
List all bounding box widths and heights of object sample ID 2.
SELECT W, H FROM IMG_OBJ WHERE OBJ_SAMPLE_ID = 2
Show the name for regions not affected.
SELECT region_name FROM region WHERE region_id NOT IN (SELECT region_id FROM affected_region)
What is the Result with a Date with 22 january 2008?
SELECT result FROM table_name_43 WHERE date = "22 january 2008"
What are the names of the characters voiced by Frank Welker?
SELECT character FROM `voice-actors` WHERE 'voice-actor' = 'Frank Welker'
If the team is Rubio ñú, what is the 08 points?
SELECT 08 AS _pts FROM table_22011138_7 WHERE team = "Rubio Ñú"
What is the mean year number where there are more than 0 wins, the class is 250cc, and the points are 95?
SELECT AVG(year) FROM table_name_66 WHERE wins > 0 AND class = "250cc" AND points = 95
What 2007 has 236 for 2006?
SELECT 2007 FROM table_name_70 WHERE 2006 = "236"
Give the districts which have two or more addresses.
SELECT district FROM address GROUP BY district HAVING count(*) >= 2
What is the first name of the male employee who has a western name style?
SELECT T2.FirstName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.NameStyle = 0 AND T1.Gender = 'M'
what is the average number of factories and maximum number of shops for manufacturers that opened before 1990.
SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990
What was the date of the earliest payment?
SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1
What state does he live in?
SELECT state FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"
How many Catalan-language Wikipedia pages are there overall?
SELECT pages FROM langs WHERE lang = 'ca'
How many stadiums are there?
select count ( * ) from stadium
What is the broadcast are for channel 1?
SELECT broadcast_area FROM table_2638104_1 WHERE channel = 1
Which To par has a Player of bernhard langer?
SELECT to_par FROM table_name_34 WHERE player = "bernhard langer"
ok, which of them is the most common one?
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count ( * ) DESC LIMIT 1
What's the record after week 16?
SELECT record FROM table_name_80 WHERE week > 16
Tell me the sex of 1005 and 1004 and their city code ..
SELECT sex, city_code FROM STUDENT WHERE stuid = 1005 or stuid = 1004
What Volume:Issue that has Peter Cetera as the artist and was on top for longer than 1 week?
SELECT volume AS :issue FROM table_name_97 WHERE weeks_on_top > 1 AND artist = "peter cetera"
Give the student's last name that gave the highest student satisfaction for the course "Intro to Database 2".
SELECT T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Intro to Database 2' ORDER BY T2.sat DESC LIMIT 1
Find the name and address of the customers who have both New and Pending orders.
SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "New" INTERSECT SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "Pending"
What was the weight of Serhiy Alfyorov?
SELECT weight FROM table_name_50 WHERE name = "serhiy alfyorov"
Among the incidents in January, 2018, how many of them were stated "against Property" in the FBI classification?
SELECT SUM(CASE WHEN SUBSTR(T2.date, 5, 4) = '2018' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.crime_against = 'Property' AND SUBSTR(T2.date, 1, 1) = '1'
And what is the zip postcode of the address with monthly rental 1297.807?
SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id where T2.monthly_rental = 1297.807
Which Car # has a Team of hendrick motorsports, and a Driver of mark martin, and a Position larger than 4?
SELECT AVG(car__number) FROM table_name_95 WHERE team = "hendrick motorsports" AND driver = "mark martin" AND pos > 4
What room seats 120 people?
SELECT * FROM classroom WHERE capacity = 120
What is the label for the catalog of none, and is in the United Kingdom?
SELECT label FROM table_name_12 WHERE catalog = "none" AND region = "united kingdom"
what is the circuit when the winner is stan jones and the race is phillip island trophy race?
SELECT circuit FROM table_name_3 WHERE winner = "stan jones" AND race = "phillip island trophy race"
What are the names of all European countries with at least 3 manufacturers?
SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent = T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId = T3.Country WHERE T2.Continent = 'europe' GROUP BY T1.CountryName HAVING count(*) >= 3;
Show the prices of the products named "Dining" or "Trading Policy".
SELECT Product_Price FROM Products WHERE Product_Name = "Dining" OR Product_Name = "Trading Policy"
List names of each manufacturer?
select name from manufacturers
What is the venue name of Bandladore?
SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_ID = T2.City_ID WHERE T2.City_Name = 'Bangalore'
What is the location/attendance of the game with a 3-1 record?
SELECT location_attendance FROM table_name_1 WHERE record = "3-1"
What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
SELECT T1.id , T1.Name , T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC
How many players are on a team? | Which team are you referring to? | The Boston Red Stockings.
SELECT count ( * ) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'
Give me IDs of instructors in the Marketing department
select ID from instructor where dept_name = 'Marketing'
HOW MANY PEOPLE HAS KILLED AT SOUTH KOREA ?
SELECT killed FROM perpetrator WHERE Country = "South Korea"
Return the names and ids of all products whose price is between 600 and 700.
SELECT product_name , product_id FROM products WHERE product_price BETWEEN 600 AND 700
Which League Goals have FA Cup Apps of 2, and Total Goals smaller than 0?
SELECT AVG(league_goals) FROM table_name_80 WHERE fa_cup_apps = "2" AND total_goals < 0
What are the original air date(s) for episodes with 8.63 million viewers?
SELECT original_airdate FROM table_2501754_2 WHERE viewing_figures_millions = "8.63"
Name the number of district for bill shuster
SELECT COUNT(district) FROM table_25030512_41 WHERE incumbent = "Bill Shuster"
Which major has the most students?
SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
What is Name, when Location is Tanzania, and when Novelty is Gen Nov?
SELECT name FROM table_name_88 WHERE location = "tanzania" AND novelty = "gen nov"
What is the phone number of the customer who has filed the most recent complaint?
SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1
What is the voltage of the Pentiumiii866 microprocessor with a socket 370?
SELECT voltage FROM table_name_8 WHERE socket = "socket 370" AND model_number = "pentiumiii866"
how many subdivisions have an English Name of jiyang?
SELECT COUNT(population) FROM table_name_24 WHERE english_name = "jiyang"
List the votes of elections in descending order.
SELECT Votes FROM election ORDER BY Votes DESC
Which championship had a Circuit of le mans?
SELECT championship FROM table_name_39 WHERE circuit = "le mans"
What is the smallest ERP W with a frequency MHz of 94.9?
SELECT MIN(erp_w) FROM table_name_26 WHERE frequency_mhz = 94.9
What are the GDP and population of the city that already served as a host more than once?
SELECT t1.gdp , t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING count(*) > 1
Find the employee id for all employees who earn more than the average salary.
SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)
List the school color of the school that has the largest enrollment.
SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
How many tracks are in the AAC audio file media type?
SELECT COUNT(*) FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId WHERE T1.Name = "AAC audio file"
Among all the users who use a vivo device, what is the age of the youngest user?
SELECT T1.age FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' ORDER BY T1.age LIMIT 1
Which rank is the most common among captains?
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
Tell me the home team score for essendon
SELECT home_team AS score FROM table_name_54 WHERE home_team = "essendon"
could you please let me know the ID of the stations with 10 precipitation?
SELECT t2.id FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id where t1.precipitation = 10
Which position was morristown minutemen in?
SELECT position FROM table_name_1 WHERE team = "morristown minutemen"
What was the Venue in 2003?
SELECT venue FROM table_name_16 WHERE date = "2003"
what is Gina Gegeneres's actor id?
SELECT actor_id from actor where first_name = 'GINA' and last_name = 'DEGENERES'
What is the price of Chevrolet Vega 2300?
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet vega 2300'
What are the names of catalog entries with level number 8?
SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8"
When was university of Rhode island founded?
SELECT founded FROM university WHERE school = "University of Rhode Island"
What is all the information about the Marketing department?
SELECT * FROM departments WHERE department_name = 'Marketing'