sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What is the total number of Total, when Gold is less than 1, when Silver is greater than 0, when Rank is 14, and when Nation is Afghanistan? | SELECT COUNT(total) FROM table_name_68 WHERE gold < 1 AND silver > 0 AND rank = "14" AND nation = "afghanistan" |
Show the account id with most number of transactions. | SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1 |
List down the product id for products with the highest quantity. | SELECT DISTINCT ProductID FROM Sales WHERE Quantity = ( SELECT MAX(Quantity) FROM Sales ) |
can you show me a list of degrees? | SELECT * FROM degrees |
List the full name of players who are drafted from round 1 in 1973 but not born in USA. | SELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN draft AS T2 ON T1.playerID = T2.playerID WHERE T2.draftRound = 1 AND T1.birthCountry != 'USA' AND T2.draftYear = 1973 |
Who is GTU Winning Team's #27 Don Lindley's TO Winning Team? | SELECT to_winning_team FROM table_13657749_2 WHERE gtu_winning_team = "#27 Don Lindley" |
How many vacancies happened on 25 May? | SELECT COUNT(manner_of_departure) FROM table_17327458_1 WHERE date_of_vacancy = "25 May" |
Which locomotive class had 5 items made? | SELECT class FROM table_name_26 WHERE quantity_made = 5 |
Which Format has a Date of 1993, and a Catalog of cleo 2481-2? | SELECT format FROM table_name_81 WHERE date = 1993 AND catalog = "cleo 2481-2" |
How many runs did mahela jayawardene and thilan samaraweera have? | SELECT SUM(runs) FROM table_name_82 WHERE batting_partners = "mahela jayawardene and thilan samaraweera" |
What is the title of the paper with the most authors? | SELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id GROUP BY T1.PaperId ORDER BY COUNT(T1.PaperId) DESC LIMIT 1 |
how many people were killed in Japan? | SELECT sum ( Killed ) FROM perpetrator where country = 'Japan' |
What is Incumbent, when Results is "Re-Elected", when Party is "Democratic", and when District is "Minnesota 7"? | SELECT incumbent FROM table_name_75 WHERE results = "re-elected" AND party = "democratic" AND district = "minnesota 7" |
List all document type codes and document type names. | SELECT document_type_code , document_type_name FROM Ref_document_types |
What city has riverside ground as the venue, with a year prior to 1998? | SELECT city FROM table_name_16 WHERE venue = "riverside ground" AND year < 1998 |
What is the Area of the Parish with a Population of 71? | SELECT area_km_2 FROM table_name_71 WHERE population = 71 |
Who is the builder with a works number of 2534? | SELECT builder FROM table_name_16 WHERE works_number = "2534" |
Return all reviewer names and movie names together in a single list. | SELECT name FROM Reviewer UNION SELECT title FROM Movie |
What are the total and average enrollment of all schools? | SELECT sum(enrollment) , avg(enrollment) FROM school |
What team did the Heat play against at the TD Waterhouse Centre? | SELECT team FROM table_name_55 WHERE location_attendance = "td waterhouse centre" |
How much is the total amount of sales handled by Heather McBadden? | SELECT SUM(T2.Quantity * T3.Price) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Heather' AND T1.LastName = 'McBadden' |
What is the game number with a score of 116–138? | SELECT COUNT(game) FROM table_name_31 WHERE score = "116–138" |
What is the result in the final versos Jennifer Capriati? | SELECT outcome FROM table_19047_2 WHERE opponent_in_the_final = "Jennifer Capriati" |
Who was the 20 Questions section aimed at when Centerfold Model was Rachel Jeán Marteen? | SELECT 20 AS _questions FROM table_name_46 WHERE centerfold_model = "rachel jeán marteen" |
What city in Russia has the least population? | SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Russian Federation' ORDER BY T2.Population ASC LIMIT 1 |
How many teams came in fourth when Otsuka Pharmaceuticals won? | SELECT COUNT(fourth_place) FROM table_29446183_2 WHERE winner = "Otsuka Pharmaceuticals" |
What about Firefox's Market share | SELECT market_share FROM browser where name = "Firefox" |
What is the number of the sail with an overall length of 13.68? | SELECT sail_number FROM table_25595107_2 WHERE loa__metres_ = "13.68" |
How many trips started from Mountain View city and ended at Palo Alto city? | SELECT count(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = "Mountain View" AND T3.city = "Palo Alto" |
what is the least laps when the driver is rolf stommelen and the grid is more than 18? | SELECT MIN(laps) FROM table_name_99 WHERE driver = "rolf stommelen" AND grid > 18 |
What are the date and the operating professional's first name of each treatment? | SELECT T1.date_of_treatment , T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id |
Who boarded first class? | SELECT boarded FROM table_name_48 WHERE class = "first" |
How many engineer visits are required at most for a single fault log? List the number and the log entry id. | SELECT count(*) , T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1 |
What are the planned delivery date and actual delivery date for each booking? | SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS |
What is the Original Title, when Director is "Ting Shan-Si", and when Film Title Used In Nomination is "The 800 Heroes"? | SELECT original_title FROM table_name_73 WHERE director = "ting shan-si" AND film_title_used_in_nomination = "the 800 heroes" |
Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 |
Give the average life expectancy for countries in Africa which are republics? | SELECT avg(LifeExpectancy) FROM country WHERE Continent = "Africa" AND GovernmentForm = "Republic" |
What is the lowest amount of goals scored that has more than 19 goal conceded and played less than 18? | SELECT MIN(goals_scored) FROM table_name_50 WHERE goals_conceded > 19 AND played < 18 |
Calculate the percentage of products supplied by Gai pturage over all products. | SELECT CAST(COUNT(CASE WHEN T2.CompanyName = 'Gai pturage' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID |
How many people were in attendance when the Washington Nationals had a score of 7-3 and a loss of Worrell (0-1)? | SELECT COUNT(attendance) FROM table_name_54 WHERE score = "7-3" AND loss = "worrell (0-1)" |
What is the name of the school with a decile of 1, a state authority, and located in Otahuhu? | SELECT name FROM table_name_41 WHERE decile = "1" AND authority = "state" AND area = "otahuhu" |
Which Raison Blue has the highest nicotine? | SELECT MAX(nicotine) FROM table_name_40 WHERE name = "raison blue" |
What is the name of the establishment with the lowest inspection score of all time? | SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = ( SELECT MIN(score) FROM inspections ) |
What's the pick number of the player from New Mexico? | SELECT MAX(pick__number) FROM table_10812938_5 WHERE college = "New Mexico" |
Write down five rumoured movie titles within the genre of Drama. | SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.movie_status = 'Rumored' AND T3.genre_name = 'Drama' LIMIT 5 |
Which type had an unknown manufacturer? | SELECT type FROM table_name_57 WHERE manufacturer = "unknown" |
Show the names of companies in the banking or retailing industry? | SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing" |
List at least 5 device models that are commonly used by female users. | SELECT T.device_model FROM ( SELECT T2.device_model, COUNT(T2.device_model) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' GROUP BY T2.device_model ) AS T ORDER BY T.num DESC LIMIT 5 |
Name the presentation of credentials for appointed by of grover cleveland and representative of charles w. buck | SELECT presentation_of_credentials FROM table_name_45 WHERE appointed_by = "grover cleveland" AND representative = "charles w. buck" |
What date was the Competition of 2014 fifa world cup qualification, with a Score of 1–0? | SELECT date FROM table_name_26 WHERE competition = "2014 fifa world cup qualification" AND score = "1–0" |
What was the type of boat built in Port Blakeley | SELECT type FROM table_name_31 WHERE where_built = "port blakeley" |
Give the street number of a bar in Oakland with a 2.7 review. | SELECT T2.street_num FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.review = 2.7 AND T2.city = 'oakland' AND T1.food_type = 'bar' |
For each aircraft that has won an award, what is its name and how many time has it won? | SELECT T1.Aircraft , COUNT(*) FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft |
Which of those statuses is used most commonly? | SELECT status_code FROM BOOKINGS group by status_code order by count ( * ) desc limit 1 |
What is the payment method that were used the least often? | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1 |
Tell me the total number of attendance for result of l 18-6 | SELECT COUNT(attendance) FROM table_name_3 WHERE result = "l 18-6" |
What is the 1st prize of the tournament in Scotland? | SELECT 1 AS st_prize___$__ FROM table_name_95 WHERE location = "scotland" |
What is the sum of the golds of the nation with 5 total and less than 0 bronze medals? | SELECT SUM(gold) FROM table_name_18 WHERE total = 5 AND bronze < 0 |
What are the details of the student who registered the most number of courses? | SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 |
return all columns of the albums created in the year of 2012. | SELECT * FROM Albums WHERE YEAR = 2012 |
What is the total number of years that has a chassis of Ferrari 625 and 2 points? | SELECT COUNT(year) FROM table_name_24 WHERE chassis = "ferrari 625" AND points = "2" |
List the software platform shared by the greatest number of devices. | SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1 |
What actor has onderweg naar morgen, as the soap opera, with aafke couwenberg as the character? | SELECT actor FROM table_name_47 WHERE soap_opera = "onderweg naar morgen" AND character = "aafke couwenberg" |
What is Record, when Game is "36"? | SELECT record FROM table_name_24 WHERE game = 36 |
What kind of engine is in the car for Scuderia Ferrari that went all rounds? | SELECT engine FROM table_name_28 WHERE rounds = "all" AND entrant = "scuderia ferrari" |
What are the maximum and minimum values of area codes? | SELECT max(area_code) , min(area_code) FROM area_code_state |
What are the average prices of products, grouped by manufacturer code? | SELECT AVG(Price) , Manufacturer FROM Products GROUP BY Manufacturer |
What building is the Spring 2010 course located? | SELECT building FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010 |
When vp8 ( webm ) is 6.0, how much is the vp9 ( webm )? | SELECT vp9___webm__ FROM table_26099252_1 WHERE vp8___webm__ = "6.0" |
Who was the Cover model on 11-03? | SELECT cover_model FROM table_name_96 WHERE date = "11-03" |
When and in what zip code did max temperature reach 80? | SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80 |
Who did the team play on january 9? | SELECT team FROM table_27733258_8 WHERE date = "January 9" |
what are the elimination time of wrestlers | SELECT Time FROM elimination |
Which department has the highest average salary of professors? | SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg ( salary ) DESC LIMIT 1 |
Give the number of Ukrainian addresses in the database. | SELECT COUNT(*) FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T1.country_name = 'Ukraine' |
Show all payment method codes and the number of orders for each code. | SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code |
What are the first names and office of the professors who are in the history department and have a Ph.D? | SELECT T1.emp_fname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.' |
What was the date of the game against the New York Jets? | SELECT date FROM table_name_7 WHERE opponent = "new york jets" |
What is the qual for rank 18 in 1964? | SELECT qual FROM table_name_44 WHERE rank = "18" AND year = "1964" |
What was the Version prior to 1996? | SELECT version FROM table_name_45 WHERE year < 1996 |
What is Alexandr Elke's Weight? | SELECT weight FROM table_name_59 WHERE name = "alexandr elke" |
Which of these has the largest number of intentional passengers? | SELECT airport_name FROM airport order by international_passengers desc limit 1 |
Find the last names of teachers who are not involved in any detention. | SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id |
What is the average number of field goals scored by a right halfback who had more than 3 touchdowns? | SELECT AVG(field_goals) FROM table_name_80 WHERE position = "right halfback" AND touchdowns > 3 |
Who is the player for St. Mary's team? | SELECT player FROM table_name_48 WHERE school_club_team_country = "st. mary's" |
What was the margin in 2001 at the McDonald's LPGA Championship? | SELECT margin FROM table_name_88 WHERE year = 2001 AND championship = "mcdonald's lpga championship" |
What is the 2 June time for the rider with time of 17' 48.58 127.111mph on 3 June? | SELECT wed_2_june FROM table_25220821_4 WHERE thurs_3_june = "17' 48.58 127.111mph" |
What was the highest vote number for Bush? | SELECT MAX(bush_number) FROM table_1756284_1 |
What is the number of season premieres were 10.17 people watched? | SELECT COUNT(season) AS premiere FROM table_10120207_8 WHERE viewers__millions_ = "10.17" |
Which community area has the highest number of crimes reported on the street? | SELECT T1.community_area_no FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T2.location_description = 'STREET' GROUP BY T1.community_area_no ORDER BY COUNT(T2.location_description) DESC LIMIT 1 |
How many distinct payment methods are used by parties? | SELECT count(DISTINCT payment_method_code) FROM parties |
how many departments are there | SELECT count ( distinct department_id ) from Staff_Department_Assignments |
Which is a high quality product but with the lowest transacted quantity? | SELECT T1.Name FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Class = 'H' ORDER BY T2.Quantity ASC LIMIT 1 |
which Place has a Player of mark brooks? | SELECT place FROM table_name_30 WHERE player = "mark brooks" |
find the took office and region id for the event id 1 | SELECT T2.Took_office,T2.Region_ID FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id where T1.party_id = 1 |
List the names of phones that are not on any market. | SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market) |
Which Pos has a Team of roush fenway racing, and a Car # of 99? | SELECT SUM(pos) FROM table_name_32 WHERE team = "roush fenway racing" AND car__number = 99 |
On december 16, 1985, all the records were what? | SELECT record FROM table_10647639_1 WHERE date = "December 16, 1985" |
in what city is Nou Mestalla | SELECT city FROM stadium where name = "Nou Mestalla" |
What is the date for home team Collingwood? | SELECT date FROM table_name_19 WHERE home_team = "collingwood" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.