sentence
stringlengths
3
347
sql
stringlengths
18
804
Which course authors teach two or more courses? Give me their addresses and author IDs.
SELECT T1.address_line_1 , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING Count(*) >= 2
Name the title with termination of mission of february 24, 1828
SELECT title FROM table_name_65 WHERE termination_of_mission = "february 24, 1828"
How many schools have some students playing in goalie and mid positions.
SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')
What is the description of role code ED?
SELECT role_description FROM ROLES WHERE role_code = "ED";
What is points diff when points against is 123?
SELECT points_diff FROM table_name_73 WHERE points_against = "123"
What is Distance, when Venue is "Belgrade"?
SELECT distance FROM table_name_39 WHERE venue = "belgrade"
WHAT MANUFACTURER AFTER 1966 HAD A START SMALLER THAN 5, A WOOD TEAM AND FINISHED 35?
SELECT manufacturer FROM table_name_5 WHERE year > 1966 AND start < 5 AND team = "wood" AND finish = 35
Pts Agst of 572, and a Pts For larger than 346 has what total number of position?
SELECT COUNT(position) FROM table_name_22 WHERE pts_agst = 572 AND pts_for > 346
how many Organizations there
SELECT count ( * ) from Organizations
What city has the highest population?
SELECT Name FROM City ORDER BY Population DESC LIMIT 1
Show the 3 counties with the smallest population.
SELECT County_name FROM county ORDER BY Population ASC LIMIT 3
What are the full names and gradepoints for all enrollments?
SELECT T3.Fname , T3.LName , T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID
What player has +2 to par?
SELECT player FROM table_name_29 WHERE to_par = "+2"
What are the distinct types of mills that are built by American or Canadian architects?
SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian'
What kind of shop is that?
SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = "walk"
Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company.
SELECT Company_name , count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;
Please tell me the address of the Accounting department.
SELECT dept_address from department where dept_name = "Accounting"
what is the users' name?
SELECT name FROM user_profiles
Find the title of course that is provided by both Statistics and Psychology departments.
SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
Which School has a #/ County of 85 wabash, and an IHSAA Football Class of A, and a Mascot of norsemen?
SELECT school FROM table_name_43 WHERE _number___county = "85 wabash" AND ihsaa_football_class = "a" AND mascot = "norsemen"
What is the nationality of the event with a 1:51.51 time?
SELECT nationality FROM table_name_66 WHERE time = "1:51.51"
Calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status.
SELECT SUM(T2.OrderQty) FROM PurchaseOrderHeader AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.PurchaseOrderID = T2.PurchaseOrderID WHERE T1.Status = 1
In what race did Buddy Rice hav fastest lap?
SELECT race_name FROM table_2454550_1 WHERE fastest_lap = "Buddy Rice"
Show all company names and headquarters in the descending order of market value.
SELECT company, headquarters FROM company ORDER BY market_value DESC
What are the minimum and maximum vote percents of elections?
SELECT min(Vote_Percent) , max(Vote_Percent) FROM election
Find the number of customers handled by each of the sales people.
SELECT COUNT(CustomerID) FROM Sales GROUP BY SalesPersonID
How many orders has Aimee Bixby made?
SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby'
When nd 2 fe 14 b (bonded) is the magnet how many measurements of tc (°c)?
SELECT COUNT(t_c__) AS °c_ FROM table_2282444_1 WHERE magnet = "Nd 2 Fe 14 B (bonded)"
Who was the Class A winner in 2006-07?
SELECT class_a FROM table_14603057_2 WHERE school_year = "2006-07"
Please show me the names of wines by Brander winery.
SELECT Name FROM WINE WHERE Winery = "Brander"
Who is the current manager of the team located in tubize?
SELECT current_manager FROM table_name_15 WHERE location = "tubize"
What director had a production number of 1490?
SELECT director FROM table_name_27 WHERE production_number = 1490
Name the time for result msst 29–24
SELECT time FROM table_26842217_18 WHERE result = "MSST 29–24"
What is Score, when Place is "T9", and when Player is "Jeff Sluman"?
SELECT score FROM table_name_39 WHERE place = "t9" AND player = "jeff sluman"
Name the total number of fin pos for 12 points of accident
SELECT COUNT(fin_pos) FROM table_17304308_1 WHERE points = "12" AND time_retired = "Accident"
Can you please provide their circuit IDs?
SELECT circuitId FROM circuits WHERE country = "France"
Show the minimum amount of transactions whose type code is "PUR" and whose share count is bigger than 50.
SELECT min(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = "PUR" AND share_count > 50
and of those 41 countries, which one has the most drivers?
SELECT nationality FROM drivers group by nationality order by count ( * ) desc limit 1
What is the Place of Player with To par of +6 and Score of 78-70-74=222?
SELECT place FROM table_name_79 WHERE to_par = "+6" AND score = 78 - 70 - 74 = 222
How many of them have expenses?
SELECT count ( document_id ) FROM Documents_with_expenses
What year did the movie Rango come out?
SELECT AVG(year) FROM table_name_3 WHERE film = "rango"
What are the dates of the projects with at least 2 documents, please? | Do you mean the projects of documents, not projects, right? | Yes
select document_date from documents where project_id in ( SELECT project_id FROM Documents GROUP BY project_id HAVING count ( * ) > = 3 )
What nation has a bronze of 2 with a total less than 5 and rank of 6?
SELECT nation FROM table_name_84 WHERE bronze = 2 AND total < 5 AND rank = "6"
What is the name of the most common genre in all tracks?
SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
Find the names of the chip models that are not used by any phone with full accreditation type.
SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full'
Name the country with fastest growth in adjusted net national income in 1980 and state the currency used by this country.
SELECT T2.countryname, T1.CurrencyUnit FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Adjusted net national income (annual % growth)' AND T2.Year = 1980 AND T1.CurrencyUnit != '' ORDER BY T2.Value DESC LIMIT 1
How many movies were made before 2000?
SELECT COUNT(*) FROM Movie WHERE YEAR < 2000
Rank larger than 8, and a Rider of chris barrett is what team?
SELECT team FROM table_name_87 WHERE rank > 8 AND rider = "chris barrett"
Does the bike with Id number 16 making any intercity trip? If yes, calculate the total travel duration during all the intercity trip. Convert the duration to hour.
SELECT T1.end_station_name, T2.city, CAST(SUM(T1.duration) AS REAL) / 3600 FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.bike_id = 16 AND T1.start_station_name != T1.end_station_name
Hello! Can you first give me a list of all of the countries?
SELECT country FROM airlines
What is the population density of the Petropavl's home country?
SELECT CAST(T1.Population AS REAL) / T1.Area FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Petropavl'
Who did they play when there were only 751 in attendance?
SELECT opponent FROM table_name_78 WHERE attendance < 751
FIND THE NAME OF CUSTOMER WHO HAS THE LOWEST CREDIT SCORE
SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
Name the total number of goal difference when the position is more than 20
SELECT COUNT(goal_difference) FROM table_name_49 WHERE position > 20
What is the name of the away team with a Tie no of 7?
SELECT away_team FROM table_name_40 WHERE tie_no = "7"
What is the title of the film that had a production cost of $850,000?
SELECT title FROM table_name_93 WHERE production_cost = "$850,000"
List the file size and format for all songs that have resolution lower than 800.
SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800
How many colors are never used by any product?
SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)
What's the season number of the episode originally aired on October 14, 2008?
SELECT no_in_season FROM table_19401346_1 WHERE original_air_date = "October 14, 2008"
What is the number of products that Creative Labs does manufacture?
SELECT count ( DISTINCT name ) FROM products WHERE name IN ( SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' )
What is the sum of grids with an engine in Time/Retired with less than 45 laps for Giancarlo Baghetti?
SELECT SUM(grid) FROM table_name_27 WHERE time_retired = "engine" AND laps < 45 AND driver = "giancarlo baghetti"
Which Outcome has a Opponent of lindsay lee-waters?
SELECT outcome FROM table_name_83 WHERE opponent = "lindsay lee-waters"
What Venue has a Date of 17/03/1990?
SELECT venue FROM table_name_46 WHERE date = "17/03/1990"
How many teachers have made some type of donation for projects in Chicago?
SELECT COUNT(DISTINCT T2.teacher_acctid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.is_teacher_acct = 't' AND T2.school_city = 'Chicago'
What was the result of the game against Mississippi State?
SELECT result FROM table_21063459_1 WHERE opponent = "Mississippi State"
How much per unit of Konbu does Mayumi's charge?
SELECT T1.UnitPrice FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName LIKE 'Mayumi%' AND T1.ProductName = 'Konbu'
How many Goals have a Result of 0 – 4?
SELECT AVG(goals) FROM table_name_26 WHERE result = "0 – 4"
Can I get the names of all the payment methods used?
SELECT distinct Payment_Method_Code FROM Payments
Which customer made the order No. 10160? Give the contact name.
SELECT t2.contactFirstName, t2.contactLastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10160'
Among the players who have passed away, who had the most award?
SELECT T1.playerID FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE deathDate IS NOT NULL GROUP BY T1.playerID ORDER BY COUNT(award) DESC LIMIT 1
Among the clients who did receive a timely response for their complaint, how many of them are from New York?
SELECT COUNT(T1.city) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'No' AND T1.city = 'New York City'
What is the average weight of the competitors who won a silver medal?
SELECT AVG(T1.weight) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.medal_name = 'Silver'
How many path does the github address "https://github.com/jeffdik/tachy.git" have?
SELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git'
Which average S.R. has an Average of 39.13 and Balls Faced larger than 318?
SELECT AVG(sr) FROM table_name_48 WHERE average = 39.13 AND balls_faced > 318
What is Date, when Record is 12-58?
SELECT date FROM table_name_31 WHERE record = "12-58"
What are the years of film market estimation for the market of Japan, ordered by year descending?
SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC
Find the wineries that have at least four wines.
SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4
What is the week with a date of October 9, 1983, and attendance smaller than 40,492?
SELECT COUNT(week) FROM table_name_27 WHERE date = "october 9, 1983" AND attendance < 40 OFFSET 492
What event has a 0:49 time?
SELECT event FROM table_name_13 WHERE time = "0:49"
What is the record of the game with 28,135 people in attendance?
SELECT record FROM table_name_30 WHERE attendance = "28,135"
What is the Tie no when Chester is the away team?
SELECT tie_no FROM table_name_83 WHERE away_team = "chester"
What is the incumbent for pennsylvania 15
SELECT incumbent FROM table_1342013_37 WHERE district = "Pennsylvania 15"
What is the City or Town of the monument with a Longitude of 89°11′w?
SELECT city_or_town FROM table_name_71 WHERE longitude = "89°11′w"
What is the name of the player with the largest number of votes?
SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1
What Allied-Unrelated is labeled as "common"?
SELECT allied_unrelated FROM table_name_61 WHERE allied_related = "common"
Which towns are represented in district 31?
SELECT towns_represented FROM table_name_65 WHERE district = "31"
Jim Obradovich, picked after round 2, but before pick 183, plays what position?
SELECT position FROM table_name_88 WHERE round > 2 AND pick < 183 AND player = "jim obradovich"
List the min grade point for each letter grade?
SELECT min ( gradepoint ) , lettergrade FROM GRADECONVERSION group by lettergrade
For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.
SELECT T1.title , T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title != T2.title ORDER BY T1.director , T1.title
What is the title that has 14.59 u.s. viewers (millions)?
SELECT title FROM table_22078691_2 WHERE us_viewers__millions_ = "14.59"
What is the rating of artists with at least one English song?
select T2.rating from artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english' group by T1.artist_name having count ( * ) > = 1
For how long did Elly Koss's cystitis last?
SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Cystitis'
How many mixed doubles were there in the year that Olga Koseli won the women's singles?
SELECT COUNT(mixed_doubles) FROM table_15002177_1 WHERE womens_singles = "Olga Koseli"
ratio of 15:14, and a just (cents) larger than 119.44 is what average size (cents)?
SELECT AVG(size__cents_) FROM table_name_40 WHERE just_ratio = "15:14" AND just__cents_ > 119.44
Who is Doug Basham's team?
SELECT team FROM table_name_39 WHERE wrestler = "doug basham"
Show the authors who have submissions to more than one workshop.
SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1
What are the different album labels listed?
SELECT DISTINCT label FROM Albums
Who took the loss on May 25?
SELECT loss FROM table_name_85 WHERE date = "may 25"
Show names of all high school students who do not have any friends.
SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id
Who was the opponent when the result was w24-7?
SELECT opponent_number FROM table_name_1 WHERE result = "w24-7"