sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Which Attendance has an Opponent of new york giants, and a Week smaller than 5? | SELECT AVG(attendance) FROM table_name_88 WHERE opponent = "new york giants" AND week < 5 |
What is the full name of the driver who transported the first shipment of the company? | SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id ORDER BY T1.ship_date ASC LIMIT 1 |
What is the flange thickness (mm) for the weight (kg/m) 10.4? | SELECT flange_thickness__mm_ FROM table_2071644_1 WHERE weight__kg_m_ = "10.4" |
What is the highest wins that has 350cc as the class, yamaha for the team, with points less than 37, and a year after 1979? | SELECT MAX(wins) FROM table_name_7 WHERE class = "350cc" AND team = "yamaha" AND points < 37 AND year > 1979 |
What is the nationality of the player named Kelly Tripucka? | SELECT nationality FROM table_11545282_19 WHERE player = "Kelly Tripucka" |
What are the names and salaries of instructors who advise students in the Math department? | SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' |
how many students have not enrolled in any courses | SELECT COUNT ( * ) FROM STUDENT WHERE StuID NOT IN ( SELECT StuID FROM ENROLLED_IN ) |
What is the home team that played on M.C.G. grounds? | SELECT home_team FROM table_16388398_2 WHERE ground = "M.C.G." |
Find the major and age of students who do not have a cat pet. | SELECT major, age FROM student WHERE NOT stuid IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat') |
Name the lelast decile for roll of 428 | SELECT MIN(decile) FROM table_name_63 WHERE roll = 428 |
What is the title and director for the movie with highest worldwide gross in the year 2000 or before? | SELECT title , director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1 |
Name the Away team score which has an Away team of st kilda, and a Crowd of 8157? | SELECT away_team AS score FROM table_name_3 WHERE away_team = "st kilda" AND crowd = 8157 |
Mention the series code of countries using pound sterling as their currency unit. Which country belongs to high income group among them. | SELECT DISTINCT T1.CountryCode, T1.CurrencyUnit, T1.IncomeGroup FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Pound sterling' AND T1.IncomeGroup LIKE '%high income%' |
Which states have more than 2 parks? | SELECT state FROM park GROUP BY state HAVING count(*) > 2; |
Which position did David Nugent play with an overall small than 187? | SELECT position FROM table_name_79 WHERE overall > 187 AND player = "david nugent" |
What college did john sullivan attend? | SELECT college FROM table_name_28 WHERE player = "john sullivan" |
who was the opponent when the attendance was larger than 54,766? | SELECT opponent FROM table_name_27 WHERE attendance > 54 OFFSET 766 |
How many professors are in the accounting dept? | SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting" |
Please list the years of film market estimations when the market is in country "Japan" in descending order. | 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 ids and first names of the 3 teachers that have the most number of assessment notes? | SELECT T1.teacher_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3 |
What is the google entity ID of Benjamin Hawkins? | SELECT google_entity_id_id FROM historical WHERE first_name = 'Benjamin' AND last_name = 'Hawkins' |
For the goalie who had the most shutouts in 2010, what's his catching hand? | SELECT T1.shootCatch FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2010 GROUP BY T2.playerID ORDER BY SUM(T2.SHO) DESC LIMIT 1 |
List the names of people that are not entrepreneurs. | SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur) |
what is the major of Tracy | select Major from Student where Fname = 'Tracy' |
Which sales person made the sale of 1635823.3967 last year? Give the Business Entity ID. | SELECT BusinessEntityID FROM SalesPerson WHERE SalesLastYear = '1635823.3967' |
Which game later than number 32 had both Ellis for the decision and Nashville as the visiting team? | SELECT record FROM table_name_59 WHERE visitor = "nashville" AND decision = "ellis" AND game > 32 |
What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open? | SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'WTA Championships' INTERSECT SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'Australian Open' |
What are the codes of the countries that do not speak English and whose government forms are not Republic? | SELECT Code FROM country WHERE GovernmentForm != "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" |
What kind of car has the NASCAR Camping World Truck Series record? | SELECT car_make FROM table_name_7 WHERE record = "nascar camping world truck series" |
What Bello has a 27 Liscumb and 6539 Libweshya? | SELECT bello FROM table_name_35 WHERE liscumb = "27" AND libweshya = "6539" |
What is the broadcast date of the episode with 9.65 million viewers? | SELECT broadcast_date FROM table_name_39 WHERE viewership__millions_ = 9.65 |
How many horror movies were made by the worst directors? | SELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid INNER JOIN directors AS T3 ON T1.directorid = T3.directorid WHERE T1.genre = 'horror' AND T3.d_quality = 0 |
If the district is Chittorgarh, what is the area? | SELECT area__km²_ FROM table_2168295_1 WHERE district = "Chittorgarh" |
Among the NBA All-star players in 1996 season , which have more than 70% free throw rate? Please give their player id. | SELECT playerID FROM player_allstar WHERE season_id = 1996 AND CAST(ft_made AS REAL) * 100 / ft_attempted > 70 |
Find the name of medication used on the patient who stays in room 111? | SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111 |
Which model had a wheelbase of 136 inches? | SELECT model FROM table_name_54 WHERE wheelbase_in = "136" |
How old is Zach? | SELECT age from person where name = "Zach" |
what is TV Lounge amenity id? | SELECT T1.amenid FROM dorm_amenity AS T1 where T1.amenity_name = 'TV Lounge' |
What was the total for radio luxembourg? | SELECT total FROM table_19439864_2 WHERE song = "Radio Luxembourg" |
How many starts did Hendrick motorsports have? | SELECT MIN(starts) FROM table_1012730_1 WHERE team_s_ = "Hendrick Motorsports" |
What is the height of the fastest roller coaster in Austria? | SELECT T2.Height FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID where T1.Name = "Austria" order by T2.speed desc limit 1 |
What is the sector is the establishment is 110313? | SELECT sector FROM table_23802822_1 WHERE establishments = 110313 |
Who are the actors starred in the film "Bound Cheaper"? | SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BOUND CHEAPER' |
How many types of credit cards are there and how many are vista? | SELECT COUNT(CardNumber) FROM CreditCard WHERE CardType = 'vista' |
which last names are both used by customers and by staff? | SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff |
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities. | SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city |
For the player fero lasagavibau who has the lowest start? | SELECT MIN(start) FROM table_name_71 WHERE player = "fero lasagavibau" |
Which Seasonhas a Score of 3 – 3 aet , 4–3 pen? | SELECT MAX(season) FROM table_name_52 WHERE score = "3 – 3 aet , 4–3 pen" |
Hmm, I also want to know the average savings balance of all savings accounts. | SELECT avg ( balance ) FROM savings |
If the latitude is 08.979° s, what is the depth? | SELECT depth FROM table_25675509_1 WHERE latitude = "08.979° S" |
What is the most frequent status of bookings? | SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY COUNT(*) DESC LIMIT 1 |
List the names of the country that officially uses English as their language. | SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T1.Language = 'English' |
List the project details of the projects which did not hire any staff for a researcher role ? | SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_Staff WHERE role_code = 'researcher' ) |
What was the result when the attendance was 12,000? | SELECT result FROM table_name_77 WHERE attendance = "12,000" |
Show the id and salary of Mark Young. | SELECT eid , salary FROM Employee WHERE name = 'Mark Young' |
Who directed the episodes that aired December 15, 1956? | SELECT director FROM table_25800134_1 WHERE airdate = "December 15, 1956" |
What are the languages of the first two published books? | SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id ORDER BY T1.publication_date ASC LIMIT 2 |
Attendance of 23,150 had what opponent? | SELECT opponent FROM table_name_49 WHERE attendance = "23,150" |
Which organization hired the most research staff? | SELECT * FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count ( * ) DESC LIMIT 1 |
How many tracks are in each genre? | SELECT count(*) , T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name; |
When 98 is the points what is the club? | SELECT club FROM table_17941032_1 WHERE points = "98" |
What is the maximum weeks on top in the table? | SELECT Weeks_on_Top FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1 |
Calculate the total price of shipped orders belonging to Land of Toys Inc. under the classic car line of products. | SELECT SUM(t3.priceEach * t3.quantityOrdered) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN orderdetails AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN products AS t4 ON t3.productCode = t4.productCode WHERE t4.productLine = 'Classic Cars' AND t1.customerName = 'Land of Toys Inc.' AND t2.status = 'Shipped' |
List the names of editors that are not on any journal committee. | SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee) |
What are department ids for departments with managers managing more than 3 employees? | SELECT DISTINCT department_id FROM employees GROUP BY department_id , manager_id HAVING COUNT(employee_id) >= 4 |
For the weather station has store no.9, what was the increased percentage of the average temperature from 2012/2/2 to 2012/2/3? | SELECT CAST((SUM(CASE WHEN T1.`date` = '2012-02-03' THEN T1.tavg * 1 ELSE 0 END) - SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 9 |
What generation is the member born on 1992.12.23 in? | SELECT generation FROM table_name_4 WHERE birthday = "1992.12.23" |
Identify the full name of the driver who delivered a shipment to the city of New York in February 2016. | SELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.city_name = 'New York' AND T1.ship_date LIKE '2016-02%' |
how about the total number of companies? | SELECT COUNT ( * ) from culture_company |
what about for each of the last two policies? | SELECT count ( * ) , Policy_type_code FROM Customer_Policies GROUP BY Policy_type_code having policy_type_code = "Life" or policy_type_code = "Car" |
What is the average amount of silver medals Montenegro, who has less than 15 bronze and more than 11 total medals, has? | SELECT AVG(silver) FROM table_name_87 WHERE bronze < 15 AND nation = "montenegro" AND total > 11 |
How many times in total did the team Boston Red Stockings participate in postseason games? | SELECT count(*) FROM ( SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ); |
What is the percentage of the podcast that are categorized in four or more categories? | SELECT COUNT(T1.podcast_id) FROM ( SELECT podcast_id FROM categories GROUP BY podcast_id HAVING COUNT(category) >= 4 ) AS T1 |
display all the information of the employees whose salary if within the range of smallest salary and 2500. | SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500 |
which tweet has the newest creation date? | SELECT * FROM tweets order by createdate desc limit 1 |
What ship was built in 2012? | SELECT ship FROM table_name_91 WHERE built = 2012 |
Opponent of @ atlanta flames had what game? | SELECT game FROM table_name_44 WHERE opponent = "@ atlanta flames" |
What is the origin of aircraft in service in 1943 and retired in 1954? | SELECT national_origin FROM table_13605170_2 WHERE retired = "1954" AND in_service = "1943" |
Which historical female legislator that have their term ended on the 3rd of March 1791? | SELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.end = '1791-03-03' AND T1.gender_bio = 'F' |
And what is the range of resolution in songs? | SELECT min ( resolution ) , max ( resolution ) FROM song |
What are the oppose rates of those? | SELECT Oppose_rate FROM candidate ORDER BY support_rate DESC LIMIT 3 |
What is the Arrival time of the Patna Junction Station? | SELECT arrival FROM table_name_62 WHERE station_name = "patna junction" |
What was the Margin of victory in the southwest golf classic Tournament? | SELECT margin_of_victory FROM table_name_84 WHERE tournament = "southwest golf classic" |
What is the original air date of season 18? | SELECT original_air_date FROM table_11664625_2 WHERE no_in_season = 18 |
What is the location of the venue owned by johnson c. smith university? | SELECT location FROM table_name_26 WHERE owner = "johnson c. smith university" |
What are the first name and last name of all the instructors? | SELECT fname , lname FROM Faculty WHERE Rank = "Instructor" |
What is the sum of checking and savings balances for all customers, ordered by the total balance? | SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance |
What about the advisor with the least number of students | SELECT advisor FROM Student GROUP BY advisor ORDER BY count ( * ) asc LIMIT 1 |
What are the names of the cameras that have taken picture of the most mountains? | SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1 |
What rank has a rating of 146.8? | SELECT rank FROM table_19517448_3 WHERE rating = "146.8" |
What is the order id and order details for the order more than two invoices. | SELECT T2.order_id , T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING count(*) > 2 |
Give the mean life expectancy of countries in which English is not the official language. | SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T") |
What school colors for the friends' school with over 1000 enrolled? | SELECT school AS Colors FROM table_name_70 WHERE enrolment > 1000 AND school = "the friends' school" |
What was the score of the Mariners game when they had a record of 56–21? | SELECT score FROM table_name_91 WHERE record = "56–21" |
What was the percentage in 1980 in Brooklyn? | SELECT MIN(1980) FROM table_name_70 WHERE borough = "brooklyn" |
Name the score for yuliya ustyuzhanina | SELECT score FROM table_name_84 WHERE opponent = "yuliya ustyuzhanina" |
List any five countries which use English as an official language. | SELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' LIMIT 5 |
Show the distinct position of players from college UCLA or Duke. | SELECT DISTINCT POSITION FROM match_season WHERE College = "UCLA" OR College = "Duke" |
What are the names of the tourist attractions that have only been visited once? | SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count ( * ) = 1 |
Show the name and theme for all concerts and the number of singers in each concert. | SELECT T2.concert_name, T2.theme, COUNT(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id = T2.concert_id GROUP BY T2.concert_id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.