sentence
stringlengths
3
347
sql
stringlengths
18
804
What is the issue date of the volume with the minimum weeks on top?
SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
What is maximum and minimum death toll caused each time?
SELECT max(killed) , min(killed) FROM death
On May 13, what was the team's record?
SELECT record FROM table_name_33 WHERE date = "may 13"
Find and list the full name of customers who rented more family movies than Sci-Fi movies.
SELECT DISTINCT IIF(SUM(IIF(T5.name = 'Family', 1, 0)) - SUM(IIF(T5.name = 'Sci-Fi', 1, 0)) > 0, T1.first_name, 0) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film_category AS T4 ON T4.film_id = T3.film_id INNER JOIN category AS T5 ON T4.category_id = T5.category_id GROUP BY T1.customer_id
How many bridges was built by Frank Lloyd Wright?
SELECT count ( * ) from architect as T1 join bridge as T2 on T1.id = T2.architect_id where T1.name = "Frank Lloyd Wright"
Who is h.t. brewer when je armstrong is c.p. greeks?
SELECT ht_brewer FROM table_1320857_1 WHERE je_armstrong = "C.P. Greeks"
What is the length of the coaster with the unknown speed
SELECT length__ft_ FROM table_2665085_1 WHERE speed__mph_ = "unknown"
What team has jordan 193 chassis after 1990?
SELECT team FROM table_name_61 WHERE year > 1990 AND chassis = "jordan 193"
Among the matches held in 2015, who is the winning team in the match ID 829768?
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Date LIKE '2015%' AND T1.Match_Id = 829768
What are the names of departments that have primarily affiliated physicians.
SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1
How many campuses opened between 1935 and 1939?
SELECT count ( campus ) FROM campuses WHERE YEAR > = 1935 AND YEAR < = 1939
What is the earliest election with 2 seats and the outcome of the election of minority in parliament?
SELECT MIN(election) FROM table_name_67 WHERE outcome_of_election = "minority in parliament" AND seats = "2"
What position does Jamar Chaney play?
SELECT position FROM table_name_45 WHERE name = "jamar chaney"
What is the population of the year featuring an 87.5% German population?
SELECT population FROM table_name_51 WHERE germans = "87.5%"
Who was the player with a 36.74 average?
SELECT player FROM table_26041144_11 WHERE average = "36.74"
Which manufacturer was used after 1969 with a finish position of 34?
SELECT manufacturer FROM table_name_14 WHERE year > 1969 AND finish = 34
what is the constellation when the Right ascension ( J2000 ) is 10h18m58.4s?
SELECT constellation FROM table_name_10 WHERE right_ascension___j2000__ = "10h18m58.4s"
Name the part which is most profitable.
SELECT T.p_name FROM ( SELECT T3.p_name , T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity AS num FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ) AS T ORDER BY T.num DESC LIMIT 1
Yes please | Which one? Do you mean the publishers of the result table that also have publications with prices lower than 5000000 or any publisher that has a publication with a price lower than 5000000? | in the table that you just created, add the names of the publishers with price lower than 5000000, and include their price in the table too.
SELECT Publisher, Price FROM publication WHERE Price > 10000000 or Price < 5000000
What is the total goals with 12 assists, and less than 291 apps?
SELECT SUM(goals) FROM table_name_52 WHERE assists = 12 AND apps < 291
Which catalog contents have length below 3 or above 5? Find the catalog entry names.
SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5
Which Bronze has a Rank of 3, and a Silver larger than 0?
SELECT MIN(bronze) FROM table_name_39 WHERE rank = 3 AND silver > 0
hmmm. Can you also show me the name and age of the oldest editor?
SELECT Name, age FROM editor WHERE Age = ( select max ( age ) from editor )
What are the names of the songs they have sung?
select song_name from song where artist_name in ( SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7 )
When the lead margin was 35, what were the Democrat: Vivian Davis Figures?
SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE lead_margin = 35
Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2
Can you also include their id?
SELECT last_name ,teacher_id FROM Teachers EXCEPT SELECT T1.last_name ,T1.teacher_id FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id
What is the total population for all the districts that have an area larger tahn the average city area?
SELECT sum(city_population) FROM district WHERE city_area > (SELECT avg(city_area) FROM district)
Who is the owner of the branding gx94?
SELECT owner FROM table_name_78 WHERE branding = "gx94"
How many attended tie number 3?
SELECT MAX(attendance) FROM table_name_97 WHERE tie_no = "3"
Who won when the Patriots played the Denver Broncos?
SELECT record FROM table_name_38 WHERE opponent = "denver broncos"
What type of document is that?
SELECT document_type_code FROM documents ORDER BY access_count DESC LIMIT 1
Find distinct cities of addresses of people?
SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id
who is the the candidates with incumbent being james o'connor
SELECT candidates FROM table_1342393_17 WHERE incumbent = "James O'Connor"
What is the average gpa of Ogdon Zywicki's research assistants?
SELECT SUM(T3.gpa) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
How many films have a rental duration of over 6 days?
SELECT COUNT(film_id) FROM film WHERE rental_duration > 6
What is the appointment day for 4 December 2008 vacancy?
SELECT date_of_appointment FROM table_name_40 WHERE date_of_vacancy = "4 december 2008"
Name the samurai for stampede of t. mask
SELECT samurai FROM table_name_97 WHERE stampede = "t. mask"
Which steal/intercept ball has no for both the sliding tackle and dump tackle?
SELECT steal_intercept_ball FROM table_name_37 WHERE sliding_tackle = "no" AND dump_tackle = "no"
What is the highest number of losses where a team scored more than 45 goals and had 32 against?
SELECT MAX(losses) FROM table_name_23 WHERE goals_against = 32 AND goals_for > 45
When the incumbent was William Elliott, what was the result?
SELECT result FROM table_name_75 WHERE incumbent = "william elliott"
State the headquarter of the truck which completed shipment no.1045.
SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = 1045
Show all artist names with an average exhibition attendance over 200.
SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING avg(T1.attendance) > 200
What is the round for a year earlier than 1987?
SELECT round FROM table_name_19 WHERE year < 1987
List the name, nationality and id of all male architects ordered by their names lexicographically?
SELECT name , nationality , id FROM architect WHERE gender = 'male' ORDER BY name
What team did Alireza mansourian leave?
SELECT team FROM table_22297198_3 WHERE outgoing_manager = "Alireza Mansourian"
What was the margin of victory when the winning score was −9 (72-68-64-67=271)?
SELECT margin_of_victory FROM table_name_84 WHERE winning_score = −9(72 - 68 - 64 - 67 = 271)
Of those 18, how many doctorates are employed by the accounting department?
SELECT count ( * ) from professor where prof_high_degree = "Ph.D." and dept_code = "ACCT"
Name the team for 48 game
SELECT team FROM table_name_16 WHERE game = 48
What is the Final Four with a win percentage of .750?
SELECT final_four FROM table_name_32 WHERE win__percentage = ".750"
Who did he fight in Rumble of the Kings 6?
SELECT opponent FROM table_name_87 WHERE event = "rumble of the kings 6"
What is the total number of deaths and damage for all storms with a max speed greater than the average?
SELECT sum(number_deaths) , sum(damage_millions_USD) FROM storm WHERE max_speed > (SELECT avg(max_speed) FROM storm);
What is the result for a year after 2003, when the nominee(s) is john wells?
SELECT result FROM table_name_64 WHERE year > 2003 AND nominee_s_ = "john wells"
What are the names and locations of tracks that have had exactly 1 race?
SELECT T2.name , T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING count(*) = 1
What country does Tiger Woods play for?
SELECT country FROM table_name_17 WHERE player = "tiger woods"
How many flights were there from San Diego International airport to Los Angeles International airport in the August of 2018?
SELECT COUNT(FL_DATE) FROM Airlines WHERE FL_DATE LIKE '2018/8%' AND ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'San Diego, CA: San Diego International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T4.DEST WHERE T3.Description = 'Los Angeles, CA: Los Angeles International' )
What was the score of the game that put the team at 27-32?
SELECT loss FROM table_name_51 WHERE record = "27-32"
where did arron oberholser play?
SELECT country FROM table_name_84 WHERE player = "arron oberholser"
List the names and prices of the cars with model 82 and mileage per gallon of greater than 30.
SELECT T2.car_name, T1.price FROM price AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.model = 82 AND T2.mpg > 30
Which Name has a AAFC Team of los angeles dons, and a Position of fb, and a College of oklahoma a&m?
SELECT name FROM table_name_70 WHERE aafc_team = "los angeles dons" AND position = "fb" AND college = "oklahoma a&m"
what is the rate of kill in south korea
SELECT Killed FROM perpetrator WHERE country = "South Korea"
Hello, what are the names of the faculty members who don't participate in any activity?
SELECT Lname, Fname FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
Which home team competed against the away team of Melbourne?
SELECT home_team FROM table_name_56 WHERE away_team = "melbourne"
How many times is the number of "Women's Clothing" Yelp businesses to "Men's Clothing"?
SELECT CAST(SUM(CASE WHEN T2.category_name = 'Women''s Clothing' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.category_name = 'Men''s Clothing' THEN 1 ELSE 0 END) AS TIMES FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id
What are the names of everyone else who lives in Austin?
select name from person where city = "austin"
How many mountains in this table?
SELECT count ( * ) FROM mountain
display the employee number, name( first name and last name ), and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'J' in their first name.
SELECT employee_id , first_name , last_name , salary FROM employees WHERE salary > ( SELECT AVG (salary) FROM employees ) AND department_id IN ( SELECT department_id FROM employees WHERE first_name LIKE '%J%')
List all the issues of the complaints made by Kaitlyn Eliza Elliott.
SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kaitlyn' AND T1.middle = 'Eliza' AND T1.last = 'Elliott'
What is the least number of Races for a Racer with less than 0 Points?
SELECT MIN(races) FROM table_name_31 WHERE points < 0
What instrument did the musician with last name "Heilo" use in the song "Le Pop"?
SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = "Heilo" AND T3.title = "Le Pop"
Return the name and id of the furniture with the highest market rate.
SELECT name , furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1
What is the average score of all universities in 2012?
SELECT AVG(score) FROM university_ranking_year WHERE year = 2012
How many flaps did he have when he had 109 points?
SELECT MAX(flaps) FROM table_23128286_1 WHERE points = 109
How many "servant to Timon" characters are there?
SELECT COUNT(id) FROM characters WHERE Description = 'servant to Timon'
What is the party of the election in which Robert Bauman is the incumbent?
SELECT party FROM table_1341690_20 WHERE incumbent = "Robert Bauman"
How many laps did the grid 1 engine have?
SELECT SUM(laps) FROM table_name_96 WHERE time_retired = "engine" AND grid = 1
What is the most recent year in which the score was 4–6, 6–3, 7–5?
SELECT MAX(year) FROM table_name_91 WHERE score = "4–6, 6–3, 7–5"
Name the minimum inhabitants for markatal 49
SELECT MIN(inhabitants_per_km²) FROM table_16278673_1 WHERE markatal = 49
Name the broadcast date of 6.9 million viewers
SELECT broadcast_date FROM table_2114308_1 WHERE viewers__in_millions_ = "6.9"
What are flight numbers of flights departing from Airport "APG"?
SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = "APG"
What is the Away team at the Wolverhampton Wanderers Home game with a Score of 2–0?
SELECT away_team FROM table_name_33 WHERE score = "2–0" AND home_team = "wolverhampton wanderers"
At which race did reg parnell win the goodwood trophy?
SELECT race FROM table_name_47 WHERE event = "goodwood trophy" AND driver = "reg parnell"
How many devices are there?
SELECT COUNT(*) FROM device
Find the instructor id of all instructors in the Statistics department
select ID from instructor where dept_name = 'Statistics'
Which res has a Time of 5:00, and a Method of decision (unanimous), and a Record of 1–0?
SELECT res FROM table_name_25 WHERE time = "5:00" AND method = "decision (unanimous)" AND record = "1–0"
Find the distinct names of all songs that have a higher resolution than some songs in English.
SELECT DISTINCT song_name FROM song WHERE resolution > ( SELECT min ( resolution ) FROM song WHERE languages = "english" )
When was the game with 13-5-6 record played?
SELECT date FROM table_23308178_5 WHERE record = "13-5-6"
film description?
SELECT T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY count ( * ) DESC LIMIT 1
What is the average duration of bike trips in the city of Palo Alto?
SELECT AVG(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Palo Alto'
What is Version, when Genre is "Action", and when Title is "Hairball"?
SELECT version FROM table_name_39 WHERE genre = "action" AND title = "hairball"
Who is the sales person in charge of the territory with the id "9"? Provide their full name.
SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.TerritoryID = 9
List the project details of the project both producing patent and paper as outcomes.
SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id WHERE T2.outcome_code = 'Patent'
What is the nominal GDP per capita when the population is 63.056 million?
SELECT MIN(gdp_per_capita_nominal__) AS $_ FROM table_1610496_3 WHERE population__millions_ = "63.056"
What is the unit of measurement of product named "cumin"?
SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "cumin"
What is the maximum length in meters for the bridges and what are the architects' names?
SELECT max(T1.length_meters) , T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id
what is the date on week 6
SELECT date FROM table_name_97 WHERE week = 6
Which film has the most number of actors or actresses? List the film name, film id and description.
SELECT T2.title , T2.film_id , T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY count(*) DESC LIMIT 1
Who was the away team when North Melbourne was the home team?
SELECT away_team FROM table_name_17 WHERE home_team = "north melbourne"
Show the years in which orchestras that have given more than one performance are founded.
SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1
What is the highest infant mortality rate per thousand of the countries whose inflation is under 3?
SELECT MAX(T2.Infant_Mortality) FROM economy AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE T1.Inflation < 3