sentence
stringlengths
3
347
sql
stringlengths
18
804
In what Season is Necaxa an Opponent?
SELECT season FROM table_name_96 WHERE opponent = "necaxa"
What are the Department ids under the Sales and Marketing Group?
SELECT DepartmentID FROM Department WHERE GroupName = 'Sales and Marketing'
What rocket has a Block of block i and a COSPAR ID of 1995-060a?
SELECT rocket FROM table_name_41 WHERE block = "block i" AND cospar_id = "1995-060a"
what's the party with incumbent being william e. evans
SELECT party FROM table_1342359_5 WHERE incumbent = "William E. Evans"
what is the minimum position with 31 points?
SELECT MIN(position) FROM table_27781212_1 WHERE points = 31
What is the record for june 10?
SELECT record FROM table_name_28 WHERE date = "june 10"
what is the city id of Nanjing
SELECT City_ID from city WHERE City = "Nanjing ( Jiangsu ) "
Who was the winning driver of the Kraco Car Stereo 150?
SELECT winning_driver FROM table_name_78 WHERE name = "kraco car stereo 150"
What is the name of the most expensive product?
SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1
Who placed order after having order cancelled?
SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > ( SELECT min ( order_date ) FROM Customer_Orders WHERE order_status_code = "Cancelled" )
What was the total number of rebounds on november 27?
SELECT COUNT(high_rebounds) FROM table_22822559_4 WHERE date = "November 27"
Please list the family names of any employees whose middle names begin with C.
SELECT LastName FROM Person WHERE PersonType = 'EM' AND MiddleName LIKE 'C%'
Count the number of dogs of an age below the average.
SELECT count(*) FROM Dogs WHERE age < ( SELECT avg(age) FROM Dogs )
Show all role codes and the number of employees in each role.
SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code
How many employees live in Georgia?
SELECT count(*) FROM Addresses WHERE state_province_county = "Georgia";
Name the others % for johnson
SELECT others_percentage FROM table_1733457_1 WHERE county = "Johnson"
What was the date that ended in a record of 8-25-7?
SELECT date FROM table_name_21 WHERE record = "8-25-7"
In Alaska with school count of 1 from year 2011 to 2013, how many of the students are white?
SELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count = 1 AND T2.year BETWEEN 2011 AND 2013 AND T2.race = 'W' AND T1.state = 'Alaska'
Return the money rank of the poker player with the greatest height.
SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1
What country had a 100% cut?
SELECT country FROM table_21690339_1 WHERE _percentage_cut = "100%"
how many date with score being w 113–87
SELECT COUNT(date) FROM table_13480122_5 WHERE score = "W 113–87"
Who is the champion if the national trophy/rookie is not held?
SELECT champion FROM table_25563779_4 WHERE national_trophy_rookie = "not held"
How many episodes did Eve Weston write?
SELECT COUNT(no_in_series) FROM table_27462177_1 WHERE written_by = "Eve Weston"
Find the title of course that is provided by Statistics but not Psychology departments.
SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
When 790 am is the frequency what is the format?
SELECT format FROM table_1949746_1 WHERE frequency = "790 AM"
What is the fewest number of silvers for teams with more than 21 gold and more than 4 bronze?
SELECT MIN(silver) FROM table_name_56 WHERE bronze > 4 AND gold > 21
Which Purpose has a Name of oak?
SELECT purpose FROM table_name_49 WHERE name = "oak"
What is the lowest number of seats from the election with 27.0% of votes?
SELECT MIN(seats) FROM table_name_55 WHERE share_of_votes = "27.0%"
Name the Year which has a Label of atco records and a Type of album? Question 2
SELECT year FROM table_name_15 WHERE label = "atco records" AND type = "album"
Show the names and genders of players with a coach starting after 2011.
SELECT T3.Player_name , T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011
What is the first year in the competition?
SELECT MIN(year) FROM table_19047_2
Return the names of all counties sorted by county name in descending alphabetical order.
SELECT County_name FROM county ORDER BY County_name DESC
What is the name of the high schooler who has the greatest number of likes?
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
What is the title of the program that was originally aired on June 13, 1999?
SELECT title FROM table_name_8 WHERE original_airdate = "june 13, 1999"
Show the names of all airports with elevation over 5000.
SELECT name FROM airports WHERE elevation > 5000
Find the description of the most popular role among the users that have logged in.
SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)
Which of these users have more than one tweet?
SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count ( * ) > 1
How many registered students does each course have? List course name and the number of their registered students.
SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id
How many millions of U.S. viewers watched the episode with the production code of 6AKY07?
SELECT us_viewers__millions_ FROM table_28027307_1 WHERE production_code = "6AKY07"
What is the multiplier for the processor with a frequency of 733MHz?
SELECT multiplier FROM table_name_20 WHERE frequency = "733mhz"
Name the location of the church for berle kyrkje
SELECT location_of_the_church FROM table_178408_1 WHERE church_name = "Berle kyrkje"
What was the season number for production code E2110?
SELECT season_no FROM table_21781578_2 WHERE production_code = "E2110"
What is the weekly rank for the episode "A Love of a Lifetime"?
SELECT Weekly_Rank FROM TV_series WHERE Episode = "A Love of a Lifetime";
What is the description of the most popular role among users that have logged in?
SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)
Show the name of aircraft which fewest people have its certificate.
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1
For each type, how many ships are there?
SELECT TYPE , COUNT(*) FROM ship GROUP BY TYPE
What is Jerry Barber's To par?
SELECT to_par FROM table_name_74 WHERE player = "jerry barber"
What is the 2010–11 when the Event is colonial square ladies classic?
SELECT 2010 AS _11 FROM table_name_75 WHERE event = "colonial square ladies classic"
What is the make of the car that drove 54 laps?
SELECT constructor FROM table_name_26 WHERE laps = 54
Find the name of amenity that is most common in all dorms.
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY count(*) DESC LIMIT 1
What' the series number of the episode with season number 13?
SELECT MIN(no_in_series) FROM table_2226817_6 WHERE no_in_season = 13
How many Silver medals did the Nation of Croatia receive with a Total medal of more than 1?
SELECT MIN(silver) FROM table_name_3 WHERE bronze = 1 AND total > 1 AND nation = "croatia"
What is the number of dances total number if the average is 22.3?
SELECT COUNT(number_of_dances) FROM table_23662272_4 WHERE average = "22.3"
What is the sum of the swimsuit scores from Missouri that have evening gown scores less than 8.77 and average scores less than 8.823?
SELECT SUM(swimsuit) FROM table_name_77 WHERE evening_gown < 8.77 AND state = "missouri" AND average < 8.823
Show the names of players and names of their coaches in descending order of the votes of players.
SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC
Find the policy type used by more than 4 customers.
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4
What station has average ratings of 14.7%?
SELECT tv_station FROM table_name_25 WHERE average_ratings = "14.7%"
What was the status of the election featuring incumbent margaret kaiser?
SELECT status FROM table_26416704_2 WHERE incumbent = "Margaret Kaiser"
Name the least number in season for jessica ball
SELECT MIN(no_in_season) FROM table_23117208_4 WHERE written_by = "Jessica Ball"
What is geelong's aberage crowd as Away Team?
SELECT AVG(crowd) FROM table_name_13 WHERE away_team = "geelong"
List the name of the phone model launched in year 2002 and with the highest RAM size.
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1
Find names of all students who took some course and the course description.
SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code
Name the vendor who has the shortest average lead time for Product ID 319.
SELECT T1.Name FROM Vendor AS T1 INNER JOIN ProductVendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.ProductID = 319 ORDER BY T2.AverageLeadTime LIMIT 1
May I have their names please?
SELECT name FROM editor WHERE Age>25 and age<45
List out the procedure and medicine prescribed for drug overdose patients.
SELECT DISTINCT T2.DESCRIPTION, T3.DESCRIPTION FROM encounters AS T1 INNER JOIN procedures AS T2 ON T1.PATIENT = T2.PATIENT INNER JOIN medications AS T3 ON T1.PATIENT = T3.PATIENT WHERE T1.REASONDESCRIPTION = 'Drug overdose'
What is the id, name and IATA code of the airport that had most number of flights?
SELECT T1.id , T1.name , T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
Find the checking balance of the accounts whose savings balance is higher than the average savings balance.
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM savings))
What is the name of the product with the id "475"?
SELECT Name FROM Product WHERE ProductID = 475
Who is the earliest graduate of the school? List the first name, middle name and last name.
SELECT first_name , middle_name , last_name FROM Students ORDER BY date_left ASC LIMIT 1
Find the name and checking balance of the account with the lowest saving balance.
SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance LIMIT 1
Which college did the player picked larger than 130 by the New York Jets go to?
SELECT college FROM table_name_95 WHERE pick > 130 AND team = "new york jets"
What is the budget type code with most number of documents.
SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1
List all of the NLL Toronto Rock players.
SELECT player FROM table_18042409_1 WHERE national_lacrosse_league = "Toronto Rock"
When 1 is the number in series who is the director?
SELECT director FROM table_18335117_3 WHERE no_in_series = 1
What proportion of the total gross of all movies is from movies with songs?
SELECT CAST(COUNT(CASE WHEN T1.song IS NOT NULL THEN T2.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T2.movie_title) FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie_title = T2.movie_title
Calculate the percentage of businesses with the category name food that are open from 7AM to 8PM in the businesses with the same time.
SELECT CAST(SUM(CASE WHEN T3.category_name = 'Food' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.category_name) FROM Business_Categories AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T1.category_id = T3.category_id
What is the Season when the Lead was don bartlett, and the third was don walchuk, and a Second of carter rycroft?
SELECT season FROM table_name_63 WHERE lead = "don bartlett" AND third = "don walchuk" AND second = "carter rycroft"
What are the customer ID's for these orders?
SELECT t2.customer_id FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING count ( * ) > 2
Which papers have the substring "Database" in their titles? Show the titles of the papers.
SELECT title FROM papers WHERE title LIKE "%Database%"
Who were the away teams when the competition was the 1st ``republic of srpska football day`` and the home team was u 14 republic of srpska?
SELECT away_team FROM table_29728596_2 WHERE competition = "1st ``Republic of Srpska Football Day``" AND home_team = "U 14 Republic of Srpska"
What is the total number of Year with Wins of 1, and Losses smaller than 1?
SELECT SUM(year) FROM table_name_93 WHERE wins = 1 AND losses < 1
What was the latest game that Sacramento played?
SELECT MAX(game) FROM table_name_26 WHERE team = "sacramento"
How many lessons did customer with first name Ray take?
SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray"
What is the smallest week 3 score?
SELECT MIN(week_3) FROM table_28946565_2
What date was the race at Oran Park ran?
SELECT date FROM table_name_25 WHERE race_title = "oran park"
What Position has a Round of 27?
SELECT position FROM table_name_95 WHERE round = 27
When was the archbishop that was born on February 22, 1825 ordained as a bishop?
SELECT ordained_bishop FROM table_name_6 WHERE born = "february 22, 1825"
How many crimes are commited on January 1, 2018?
SELECT COUNT(*) FROM Crime WHERE date LIKE '1/1/2018%'
What shows for series 4 when the seat shows 1?
SELECT series_4 FROM table_name_27 WHERE seat = 1
What are the hometowns that are shared by at least two gymnasts?
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2
Find the state of all cities with post code starting with 4.
SELECT state_province_county FROM addresses WHERE zip_postcode LIKE "4%"
Find the names and descriptions of the photos taken at the tourist attraction called "film festival".
SELECT T1.Name , T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = "film festival"
How much capacity was installed in Wheatland?
SELECT installed_capacity__mw_ FROM table_24837750_1 WHERE county = "Wheatland"
What is the total number of UEFA Cup(s), when Total is greater than 3?
SELECT COUNT(uefa_cup) FROM table_name_44 WHERE total > 3
Opponent of chicago bears involved what date?
SELECT date FROM table_name_95 WHERE opponent = "chicago bears"
Name the Time which has a Manufacturer of aprilia, and a Grid smaller than 16, and a Rider of sandro cortese?
SELECT time FROM table_name_13 WHERE manufacturer = "aprilia" AND grid < 16 AND rider = "sandro cortese"
What's the postal code of the office the VP Sales is at?
SELECT t2.postalCode FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'VP Sales'
What is the attendance from November 3, 1974?
SELECT attendance FROM table_name_35 WHERE date = "november 3, 1974"
Find the names of furnitures whose prices are lower than the highest price.
SELECT t1.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID WHERE t2.Price_in_Dollar < (SELECT max(Price_in_Dollar) FROM furniture_manufacte)
What is Country, when To Par is "–2", and when Player is "Tsuneyuki Nakajima"?
SELECT country FROM table_name_48 WHERE to_par = "–2" AND player = "tsuneyuki nakajima"