sentence
stringlengths
3
347
sql
stringlengths
18
804
Find the total budgets of the Marketing or Finance department.
SELECT SUM(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
Find the number and averaged salary of all instructors who are in the department with the highest budget.
SELECT AVG(T1.salary), COUNT(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1
How old is the person with the height of m (ft 3⁄4 in)?
SELECT age FROM table_24192031_2 WHERE height = "m (ft 3⁄4 in)"
Name the location for eagles
SELECT location FROM table_1973648_1 WHERE nickname = "Eagles"
What's the points for count for the club with 41 points and 8 won games?
SELECT points_for FROM table_12886178_4 WHERE points = "41" AND won = "8"
* I have left the chat *
SELECT age FROM STUDENT WHERE StuID = 1003
Which tournament had an opponent of petra krejsová tereza smitková?
SELECT tournament FROM table_name_59 WHERE opponents = "petra krejsová tereza smitková"
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings.
SELECT booking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
Which heat and lane was in rank of 22?
SELECT heat__lane_ FROM table_name_75 WHERE rank = 22
What is the highest laps with a 30 finish?
SELECT MAX(laps) FROM table_name_89 WHERE finish = "30"
Among students that gave satisfaction of value 4 for the course named "Statistical Learning", how many of them have a gpa of 3.8?
SELECT COUNT(T1.student_id) 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 = 'Statistical learning' AND T2.sat = 4 AND T1.gpa = 3.8
What is the lowest salary in departments with average salary greater than the overall average.
SELECT min(salary) , dept_name FROM instructor GROUP BY dept_name HAVING avg(salary) > (SELECT avg(salary) FROM instructor)
What is the population of city Id 2?
SELECT population FROM city WHERE City_ID = 2
What is the Opponents on a clay surface with christophe rochus as partner?
SELECT opponents FROM table_name_57 WHERE surface = "clay" AND partner = "christophe rochus"
What are the names of the perpetrators in the country Japan?
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "Japan"
Which providers use version 2008?
SELECT provider FROM table_14465871_2 WHERE version = "2008"
What are the name and phone of the customer with the most ordered product quantity?
SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY sum(T3.order_quantity) DESC LIMIT 1
What is the bounding box of the object with image id 4 and a prediction relationship class id of 144?
SELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.PRED_CLASS_ID = 144 AND T1.IMG_ID = 3
What percentage of movies that came from Japan belong in the 'animation' genre?
SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Animation' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_COUNTry AS T3 ON T1.movie_id = T3.movie_id INNER JOIN genre AS T4 ON T2.genre_id = T4.genre_id INNER JOIN COUNTry AS T5 ON T3.COUNTry_id = T5.COUNTry_id WHERE T5.COUNTry_name = 'Japan'
What is the lowest heat of the Lakeside race?
SELECT MIN(heat) FROM table_name_65 WHERE race_title = "lakeside"
Which venue was melbourne the away team of?
SELECT venue FROM table_name_56 WHERE away_team = "melbourne"
What is the date when the document "Marry CV" was stored?
SELECT date_stored FROM All_documents WHERE Document_name = "Marry CV"
What is the semester which most student registered in? Show both the name and the id.
SELECT T1.semester_name , T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1
What is Ido Kozikaro's position?
SELECT position FROM table_12962773_2 WHERE player = "Ido Kozikaro"
How many businesses are opened for 24 hours?
SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T1.attribute_name LIKE 'Open 24 Hours'
What was his record at the AFC: Brazil 1 event that went 3 rounds?
SELECT record FROM table_name_59 WHERE round = "3" AND event = "afc: brazil 1"
What is the asset make and asset model for asset id 2?
SELECT asset_make,asset_model from assets where asset_id = 2
What are the last names and ages of the students who are allergic to milk and cat?
SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")
What is the name of the activity that has the most faculty members involved in?
SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1
What Percentage did the First game of 1998 have?
SELECT percentage FROM table_name_80 WHERE first_game = 1998
What is the lowest number of Drawn games for Team Mackenzie where the Played is less and 11 and the Points are greater than 7?
SELECT MIN(drawn) FROM table_name_58 WHERE played < 11 AND points > 7 AND team = "mackenzie"
Who were the runners-up when the individual winner was Tiger Woods?
SELECT runners_up FROM table_name_17 WHERE individual = "tiger woods"
What is the policy type code of customer with ID 334?
SELECT Policy_Type_Code from policies Where customer_id = 334
What is the highest number of wins?
SELECT MAX(wins) FROM table_26609690_1
What is the highest Year, when Apparatus is "Vault", and when Rank-Final is less than 9?
SELECT MAX(year) FROM table_name_45 WHERE apparatus = "vault" AND rank_final < 9
Can you show me the rating of the restaurant with ResID 1?
select Rating from Restaurant where ResID = 1
How many people reside in the nation's capital city, which is situated in the nation that attained independence on 8/15/1947?
SELECT T3.Population FROM politics AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN city AS T3 ON T3.Name = T2.Capital WHERE T1.Independence = '1947-08-15'
What position for the player from villa park high school?
SELECT position FROM table_name_5 WHERE school = "villa park high school"
How many dates originally aired episodes located in Philadelphia, pennsylvania?
SELECT COUNT(original_airdate) FROM table_24798489_2 WHERE location = "Philadelphia, Pennsylvania"
Show all publishers which do not have a book in 1989.
SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989
What is the total number of short cars on all the trains that run in the east direction?
SELECT SUM(CASE WHEN T1.len = 'short' then 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
What is the total number of Week, when Opponent is At Chicago Bears, and when Attendance is greater than 49,070?
SELECT COUNT(week) FROM table_name_81 WHERE opponent = "at chicago bears" AND attendance > 49 OFFSET 070
What was the Record on Week 13 at the Hoosier Dome?
SELECT record FROM table_name_97 WHERE game_site = "hoosier dome" AND week = 13
What was the introductory phrase for episode 794?
SELECT introductory_phrase FROM table_25691838_11 WHERE episode__number = 794
What rank was Core Districts + Inner Suburbs and had a population of 10123000?
SELECT MAX(rank) FROM table_name_37 WHERE definition = "core districts + inner suburbs" AND population = "10123000"
How many times did the Denver Broncos face the Dallas Texans this season?
SELECT COUNT(record) FROM table_17778417_1 WHERE opponent = "Dallas Texans"
what is the sweet for voice actor saki fujita?
SELECT sweet FROM table_26615633_3 WHERE voice_actor = "Saki Fujita"
What are the names and sum of checking and savings balances for accounts with savings balances higher than the average savings balance?
SELECT T1.name , T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT avg(balance) FROM savings)
Find the stories of the building with the largest height.
SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1
Show the number of buildings with a height above the average or a number of floors above the average.
SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building) OR floors > (SELECT avg(floors) FROM building)
what are all the location where station number is c11
SELECT location FROM table_11934032_1 WHERE station_number = "C11"
How many stations are in Mountain View?
SELECT COUNT(*) FROM station WHERE city = "Mountain View"
What are the papers published under the institution "Indiana University"?
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
Location of ebbets field, and a Time of 2:56, and a Game larger than 6 has what sum of attendance?
SELECT SUM(attendance) FROM table_name_49 WHERE location = "ebbets field" AND time = "2:56" AND game > 6
How many users are there?
SELECT count(*) FROM useracct
What is listed as the Place of Birth for the Elector of Pandolfo?
SELECT place_of_birth FROM table_name_40 WHERE elector = "pandolfo"
What is the total surface area of the countries in the Caribbean region?
SELECT sum(SurfaceArea) FROM country WHERE Region = "Caribbean"
WHAT IS THE NAME WITH A SUMMER TRANSFER WINDOW, AND COUNTRY SEN?
SELECT name FROM table_name_39 WHERE transfer_window = "summer" AND country = "sen"
Give the address of the schools that passed the inspection in March 2010.
SELECT DISTINCT T1.address FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-03' AND T2.results = 'Pass' AND T1.facility_type = 'School'
Count the number of courses with more than 2 credits.
SELECT count(*) FROM COURSE WHERE Credits > 2
Which county is the campus in?
SELECT county from campuses WHERE YEAR > = 1935 AND YEAR < = 1939
What is 2009, when Tournament is "Year-End Ranking"?
SELECT 2009 FROM table_name_77 WHERE tournament = "year-end ranking"
What are the names of those cities?
SELECT headquartered_city FROM district where city_population > 500000
Who had the decision goal when the date was 1?
SELECT decision FROM table_name_73 WHERE date = 1
What are the names of instructors who didn't teach courses in the Spring?
SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester = 'Spring')
What is the name of the winner with the most rank points who participated in the Australian Open tournament?
SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1
Name the sales person for store Area Bike Accessories. Which territory is he / she in?
SELECT T4.Name FROM Store AS T1 INNER JOIN SalesPerson AS T2 ON T1.SalesPersonID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID INNER JOIN SalesTerritory AS T4 ON T2.TerritoryID = T4.TerritoryID WHERE T1.Name = 'Area Bike Accessories'
Provide employees' ID who are in-charge of territory ID from 1000 to 2000.
SELECT EmployeeID FROM EmployeeTerritories WHERE TerritoryID BETWEEN 1000 AND 2000
Manager of marty berghammer / nick allen is what year?
SELECT year FROM table_name_91 WHERE manager = "marty berghammer / nick allen"
What are names of all programs?
SELECT name FROM program
What was Richmond's score when it was the away team?
SELECT away_team AS score FROM table_name_83 WHERE away_team = "richmond"
How many wins, on average, were defeated by furuichi?
SELECT AVG(wins) FROM table_name_45 WHERE defeated_by = "furuichi"
In heat rank 7, what is the sum of lanes?
SELECT SUM(lane) FROM table_name_48 WHERE heat_rank = 7
What was the result on the wild card?
SELECT result FROM table_name_74 WHERE week = "wild card"
what are the districts that have city mall.
SELECT t3.District_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 t1.Type = "City Mall"
How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?
SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990;
What is the total number of regions where the average family size is 2.8?
SELECT COUNT(_percentage_of_total_deportees) FROM table_16048129_5 WHERE average_family_size = "2.8"
How many orders which expected profits greater than 100?
SELECT COUNT(T1.productCode) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.MSRP - T2.buyPrice > 100
How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters?
SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.overallby = 'Arizona Coyotes' AND T1.height_in_cm = 195
How many projects (not labeled omnis) have two or more outcomes?
SELECT count ( T2.project_id ) FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING count ( * ) > 2
How many products are there?
SELECT count(*) FROM products
What is the Original title with a Country that is canada?
SELECT original_title FROM table_name_55 WHERE country = "canada"
What percentage of users were using Internet Explorer according to the source that reported 20.01% used Firefox?
SELECT internet_explorer FROM table_name_53 WHERE firefox = "20.01%"
What was the score of the game that had more than 8 points?
SELECT score FROM table_name_17 WHERE points > 8
Show all card type codes and the number of cards in each type.
SELECT card_type_code , count(*) FROM Customers_cards GROUP BY card_type_code
Which B Score has a Total larger than 15.325, and an A Score smaller than 6.4?
SELECT SUM(b_score) FROM table_name_2 WHERE total > 15.325 AND a_score < 6.4
What is the minimum of International migrant stock, total of heavily indebted poor countries?
SELECT MIN(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.OtherGroups = 'HIPC' AND T2.IndicatorName = 'International migrant stock, total'
What is the highest overall pick that has c as the position, with an NFL Draft greater than 1977?
SELECT MAX(overall_pick) FROM table_name_27 WHERE position = "c" AND nfl_draft > 1977
What are the names of the ships that are from either the US or the UK?
SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom"
What player was moved to Blackpool?
SELECT player FROM table_name_41 WHERE to_club = "blackpool"
How many activities do we have?
SELECT count(*) FROM Activity
Show the county name and population of all counties.
SELECT County_name , Population FROM county
What is the average credit score for customers who have never taken a loan?
SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
What is the Type with a Year larger than 2010, and a Location with justus lipsius building, brussels, and a President of herman van rompuy (2nd term), and a Date with 28–29 june?
SELECT type FROM table_name_96 WHERE year > 2010 AND location = "justus lipsius building, brussels" AND president = "herman van rompuy (2nd term)" AND date = "28–29 june"
How many employees are there?
SELECT COUNT ( * ) FROM Employees
What is the average age of the dogs who have gone through any treatments?
SELECT AVG(age) FROM Dogs WHERE dog_id IN (SELECT dog_id FROM Treatments)
What is the total number of Rating(s), when Air Date is June 25, 2008, and when Share is greater than 3?
SELECT COUNT(rating) FROM table_name_22 WHERE air_date = "june 25, 2008" AND share > 3
Emilya Valenti has what draw average?
SELECT AVG(draw) FROM table_name_31 WHERE artist = "emilya valenti"
Which Hanzi has a Regional Population of 4,591,972 in 2010?
SELECT hanzi FROM table_name_92 WHERE regional_population_2010_ = "4,591,972"
How many results have the two candidates Gene Taylor (r) 67.0% Ken Young (d) 33.0%?
SELECT COUNT(result) FROM table_1341586_26 WHERE candidates = "Gene Taylor (R) 67.0% Ken Young (D) 33.0%"