sentence
stringlengths
3
347
sql
stringlengths
18
804
Who directs before 1949 with linda darnell leading and jonathan kent?
SELECT director FROM table_name_60 WHERE year < 1949 AND leading_lady = "linda darnell" AND role = "jonathan kent"
How many projects are there?
SELECT count(*) FROM Projects
Among all the customers of store no.1, how many of them are active?
SELECT COUNT(customer_id) FROM customer WHERE active = 1 AND store_id = 1
What are the dates for those support rates?
SELECT Date FROM candidate ORDER BY support_rate DESC LIMIT 3
How many titles have directors of matthew Penn and number in series of 143?
SELECT COUNT(title) FROM table_2618119_1 WHERE directed_by = "Matthew Penn" AND no_in_series = 143
What was the lowest round for Paul Hubbard?
SELECT MIN(round) FROM table_name_21 WHERE name = "paul hubbard"
What is the latest year that data is available for?
SELECT MAX(year) FROM table_22834834_12
Give the address of the business with the most number of the low risk violations.
SELECT T2.address FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk' GROUP BY T2.address ORDER BY COUNT(T1.business_id) DESC LIMIT 1
What is the average number of metres for the Dzelzavas Street 74?
SELECT AVG(metres) FROM table_name_61 WHERE name = "dzelzavas street 74"
Can you please provide me with a list of all paper IDs that are associated with author ID 57?
SELECT paperID FROM Authorship where authID = 57
what are the items with highest average rating | Do you mean the the title of the item with the highest average rating? | yes, title of the item with highest average rating
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg ( T2.rating ) DESC LIMIT 1
What is the high point toal for martine foubert placing below 2?
SELECT MAX(points) FROM table_name_32 WHERE artist = "martine foubert" AND place > 2
what is the highest year that the U.S. captain is ken venturi?
SELECT MAX(year) FROM table_name_61 WHERE us_captain = "ken venturi"
What is the April 28 rank when the Mar 24 is 17?
SELECT april_28 FROM table_name_92 WHERE mar_24 = "17"
Please list the social security numbers of the male employees with a salary of over $70,000 a year.
SELECT ssn FROM employee WHERE gender = 'M' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 70000
Find the names of schools that have more than one donator with donation amount above 8.5.
SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING count(*) > 1
What colors does David Langdon use?
SELECT colours FROM table_19624708_1 WHERE owner = "David Langdon"
Give the average number of cities within markets that had a low market estimation larger than 10000?
SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000
Can you show me all the product names, codes and ids? | Do you mean the product names, color codes and ids? | Yes please.
SELECT product_name,color_code,product_id from Products
What is the percentage democrats with democratic plurality of -3, and 2/5 democrat/republican?
SELECT percentage_democrats FROM table_name_45 WHERE democratic_seat_plurality = "-3" AND democratic__republican = "2/5"
What was the away team's score when Collingwood was the home team?
SELECT away_team AS score FROM table_name_17 WHERE home_team = "collingwood"
What is Caps, when Province / Club is DRFC, and when Position is Center?
SELECT caps FROM table_name_49 WHERE province___club = "drfc" AND position = "center"
Where was home with a record of 7–5–2?
SELECT home FROM table_name_77 WHERE record = "7–5–2"
Who wrote the lyrics for Mukti?
SELECT lyricist FROM table_name_14 WHERE film = "mukti"
For the 1948-49 season, what was the At Home record?
SELECT home FROM table_name_31 WHERE season = "1948-49"
List the order for all in-store sales along with the products sold.
SELECT DISTINCT T1.OrderNumber, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.`Sales Channel` = 'In-Store'
What is the date of enrollment of the course named "Spanish"?
SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish"
What's the name of Constituency number 108?
SELECT name FROM table_name_65 WHERE constituency_number = "108"
What are the full names and cities of employees who have the letter Z in their first names?
SELECT T1.first_name , T1.last_name , T3.city FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T1.first_name LIKE '%z%'
Which year was Codling open?
SELECT openning_year FROM cinema where name = "Codling"
what is the venue when the score is 1 goal and the date is october 11, 1997?
SELECT venue FROM table_name_96 WHERE score = "1 goal" AND date = "october 11, 1997"
What is the ID of the device used by the youngest user?
SELECT device_id FROM gender_age WHERE age = ( SELECT MIN(age) FROM gender_age )
What is the venue of game 3?
SELECT venue FROM table_name_88 WHERE game = 3
How many years has the Mercury Prize award been given?
SELECT COUNT(year) FROM table_name_47 WHERE award = "mercury prize"
Tell the language of the movie "C'era una volta il West".
SELECT T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T1.title LIKE 'C%era una volta il West'
Where was the Fairfield Barnett classic tournament held?
SELECT location FROM table_11622771_1 WHERE tournament = "Fairfield Barnett Classic"
Add a column with department name
select T1.DEPARTMENT_ID, T1.DEPARTMENT_NAME, count ( * ) from departments AS T1 JOIN employees AS T2 where T1.DEPARTMENT_ID = T2.DEPARTMENT_ID group by T1.DEPARTMENT_ID
Show me the winery they are from
SELECT distinct Appelation FROM WINE WHERE Score > 93
List the address in Texas in the ascending order of city id.
SELECT address FROM address WHERE district = 'Texas' AND city_id = ( SELECT MIN(city_id) FROM address WHERE district = 'Texas' )
What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
What is the record in the atlantic coast conference for the Miami team?
SELECT acc_record FROM table_28744929_2 WHERE team = "Miami"
What is the highest Density for the independencia province, with an area smaller than 2,007.4?
SELECT MAX(density) FROM table_name_88 WHERE province = "independencia" AND area < 2 OFFSET 007.4
Name the player that went to notre dame
SELECT player FROM table_name_88 WHERE college = "notre dame"
May I also see the names of bottom 5 countries by number of invoices. Please show me country names and number of invoices.
SELECT billing_country , COUNT ( * ) FROM invoices GROUP BY billing_country ORDER BY count ( * ) LIMIT 5
Which year won has a Finish of t24, and a Country of england?
SELECT AVG(year_won) FROM table_name_6 WHERE finish = "t24" AND country = "england"
What is the jersey number of the player from years 1986 – 1991 1997 – 1999?
SELECT jersey_number_s_ FROM table_name_54 WHERE years = "1986 – 1991 1997 – 1999"
What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?
SELECT T2.party, T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.opensecrets_id = 'N00003689' AND T1.thomas_id = 186 GROUP BY T2.party, T2.state
Who did the Jays play on August 30?
SELECT opponent FROM table_name_53 WHERE date = "august 30"
Show me IDs of workshop groups that have bookings with status code "stop"
SELECT T2.Workshop_Group_ID FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop"
Which record has a Boxscore of w2, and a Loss of kline (2–3)?
SELECT record FROM table_name_89 WHERE boxscore = "w2" AND loss = "kline (2–3)"
What's the address of the union bank of California tower?
SELECT street_address FROM table_name_27 WHERE name = "union bank of california tower"
What genre is the Banpresto game tittled Ranma ½: netsuretsu kakutouhen?
SELECT genre FROM table_name_34 WHERE developer = "banpresto" AND japanese_title = "ranma ½: netsuretsu kakutouhen"
What is the name and job title of the staff who was assigned the latest?
SELECT T1.staff_name , T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1
What is the score when a loss was listed with Lannan (4-8)?
SELECT score FROM table_name_48 WHERE loss = "lannan (4-8)"
Where did Dennis Byrd go to college?
SELECT college FROM table_name_29 WHERE player = "dennis byrd"
How many viewers saw the episode written by kevin biegel & bill lawrence?
SELECT us_viewers__in_million_ FROM table_27987623_1 WHERE written_by = "Kevin Biegel & Bill Lawrence"
Calculate the percentage of inspections with verified quality. Among them, how many businesses were from Chicago?
SELECT CAST(COUNT(CASE WHEN T2.results LIKE '%Pass%' THEN T2.inspection_id END) AS REAL) * 100 / COUNT(T2.inspection_id), COUNT(DISTINCT T2.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.city = 'CHICAGO'
What is the average pay rate of the employees who worked in the Engineering Departmentin 2007?
SELECT AVG(T3.Rate) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID INNER JOIN EmployeePayHistory AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Name = 'Engineering' AND STRFTIME('%Y', EndDate) > '2007' AND STRFTIME('%Y', T1.StartDate) < '2007'
Show the title and publication dates of books.
SELECT T1.Title, T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID
Can you please list the room name and room id associated with each of those 3 base prices?
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3
Among the customers with customer ID of 100 and below, how many of them have Thomas as their last name?
SELECT COUNT(customer_id) FROM customer WHERE last_name = 'Thomas' AND customer_id < 100
How many FA cup goals did dick taylor score in the year that he had 0 league goals?
SELECT MIN(fa_cup_goals) FROM table_name_10 WHERE name = "dick taylor" AND league_goals < 0
Which Year jennifer tarol barrientos is in?
SELECT MAX(year) FROM table_name_50 WHERE delegate = "jennifer tarol barrientos"
Who was the opponent before week 6 at cleveland municipal stadium?
SELECT opponent FROM table_name_19 WHERE week < 6 AND game_site = "cleveland municipal stadium"
what is the number of points when the place is less than 7, the draw is more than 2 and the artist is piece of cake?
SELECT COUNT(points) FROM table_name_76 WHERE place < 7 AND draw > 2 AND artist = "piece of cake"
Find the abbreviation and country of the airline that has fewest number of flights?
SELECT T1.Abbreviation, T1.Country FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline GROUP BY T1.Airline ORDER BY COUNT(*) LIMIT 1
How many courses are there in total?
SELECT count(*) FROM COURSE
What is the average pick number for Washington State?
SELECT AVG(pick) FROM table_name_32 WHERE school = "washington state"
What is the result of the game at kyiv, ukraine?
SELECT result FROM table_name_2 WHERE venue = "kyiv, ukraine"
What is the weight in pounds of the heaviest player?
SELECT MAX(T2.weight_in_lbs) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id
How many templates do we have?
SELECT count(*) FROM Templates
What place was the player from Italy in ?
SELECT place FROM table_name_32 WHERE country = "italy"
what is the result when the venue is singapore on september 8, 1996?
SELECT result FROM table_name_37 WHERE venue = "singapore" AND date = "september 8, 1996"
What are the ids of all male students who do not play football?
SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = "Football"
Find names and times of trains that run through stations for the local authority Chiltern.
SELECT t3.name , t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern"
List all Zimbabwean players.
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'Zimbabwea'
Where us the club named "Tennis Club" located?
SELECT clublocation FROM club WHERE clubname = "Tennis Club"
what are the names of the buildings with institutions founded before 2003?
SELECT T1.name from building as T1 JOIN institution as T2 on T1.building_id = T2.building_id WHERE T2.founded < 2003
What is the average weight for each type of pet?
SELECT avg(weight) , pettype FROM pets GROUP BY pettype
Where was the score 67-71-70=208?
SELECT place FROM table_name_26 WHERE score = 67 - 71 - 70 = 208
What are the names of all clubs that do not have any players?
SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)
Which year do the majority of the players were born?
SELECT DOB FROM Player GROUP BY DOB ORDER BY COUNT(DOB) DESC LIMIT 1
Return the countries of the mountains that have a height larger than 5000.
SELECT Country FROM mountain WHERE Height > 5000
What date did the show air when Rhod Gilbert was the headliner?
SELECT airdate FROM table_23122988_1 WHERE headliner = "Rhod Gilbert"
Give the language that is spoken in the most countries.
SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1
Interesting... Okay, I can only see the first three entries on that table, so I assumed "rem" and "auf" were lower down and I simply couldn't see them. Can you show me a list of all of the different product names on the "Product" table?
SELECT product_name from product
Find the number of medications prescribed for each brand.
SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
What subdivision names (RU) have a code of by-hr?
SELECT subdivision_name___ru____bgn_pcgn_ FROM table_290017_1 WHERE code = "BY-HR"
What is the lowest number of laps for kyle petty with under 118 points?
SELECT MIN(laps) FROM table_name_99 WHERE points < 118 AND driver = "kyle petty"
What are the names of the products that were ordered by Alejandro Grove?
SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Alejandro Grove'
What is the total value for Solo, when the value of Sacks is 2, and when the Team is New York Jets?
SELECT COUNT(solo) FROM table_name_45 WHERE sacks = 2 AND team = "new york jets"
WHAT PLACE WAS A SCORE 67-70=137?
SELECT place FROM table_name_48 WHERE score = 67 - 70 = 137
What are the names of all the physicians who took appointments.
SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID
Which Away has an Opponent of slavia prague?
SELECT away FROM table_name_7 WHERE opponent = "slavia prague"
What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?
SELECT T1.Name , T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Vincent" OR T2.Tourist_Details = "Vivian"
What's the total number of episodes with the production code 2395113A?
SELECT COUNT(title) FROM table_10953197_4 WHERE production_code = "2395113A"
Show the faculty id of each faculty member, along with the number of students he or she advises.
SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID
Drawn smaller than 24, and a Lost smaller than 17, and a Win % smaller than 31.25 had how many total number of matches?
SELECT COUNT(matches) FROM table_name_5 WHERE drawn < 24 AND lost < 17 AND win__percentage < 31.25
What category does the item ordered by Katherine Murray on 11/4/2018 in the South region belong to?
SELECT DISTINCT T3.Category FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Katherine Murray' AND T1.`Order Date` = '2018-11-04' AND T2.Region = 'South'
Episode of 16 involves which performer 1?
SELECT performer_1 FROM table_name_64 WHERE episode = 16