sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What category would the report fall into? | SELECT Budget_type_code FROM Documents_with_Expenses |
How many holes did Mike Reid from United States have? | SELECT hole FROM table_name_75 WHERE country = "united states" AND player = "mike reid" |
What are the names of the cars worth 20000? | SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000 |
How many documents have document type code CV or BK? | SELECT count(*) FROM All_documents WHERE document_type_code = "CV" OR document_type_code = "BK" |
How many poles for the Netherlands? | SELECT MAX(poles) FROM table_19487922_1 WHERE country = "Netherlands" |
What are the names of all students taking a course who received an A or C? | SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A' |
When Alinna D Penta was the cyber girl in week 3, who was the cyber girl in week 1? | SELECT week_1 FROM table_name_69 WHERE week_3 = "alinna d penta" |
Count the number of employees | SELECT count(*) FROM employee |
WHAT IS THE EMAIL ADDRESS OF LYLA WILSON MEDHURST ? | SELECT email_address FROM Teachers WHERE first_name = 'Lyla' and middle_name = 'Wilson' and last_name = 'Medhurst' |
What is the first name and last name of the customer that has email "[email protected]"? | SELECT FirstName, LastName FROM CUSTOMER WHERE Email = "[email protected]" |
What states is Tesco located in? | do you mean the address id or the address details? | The address details. | SELECT T3.address_details FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id = T2.supplier_id JOIN addresses AS T3 ON T2.address_id = T3.address_id where T1.supplier_name = 'Tesco' |
What are the names of the drama workshop groups with address in Feliciaberg city? | SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg" |
Among the projects whose donators are teachers, what is the percentage of projects that affected more than 30 students? | SELECT CAST(SUM(CASE WHEN T1.students_reached > 30 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.is_teacher_acct = 't' |
Find the name and salary of instructors who are advisors of the students from 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' |
College of lsu has how many rounds? | SELECT COUNT(round) FROM table_name_52 WHERE college = "lsu" |
Please show the countries and the number of climbers from each country. | SELECT Country , COUNT(*) FROM climber GROUP BY Country |
At what date and time did San Jose Diridon Caltrain Station have most bikes available. | SELECT T2.time FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.bikes_available = ( SELECT MAX(T2.bikes_available) FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T1.name = 'San Jose Diridon Caltrain Station' ) |
Sort all captain names by their ages from old to young. | SELECT name FROM captain ORDER BY age DESC |
who is highest rating? | SELECT artist_name from song order by rating desc limit 1 |
What is the maximum point for climbers whose country is United Kingdom? | SELECT max(Points) FROM climber WHERE Country = "United Kingdom" |
If the language is another native, what is the San Benito Municipality total number? | SELECT COUNT(san_benito_municipality) FROM table_2509112_3 WHERE language = "Another native" |
How many tracks in this table? | SELECT count ( * ) from tracks |
How many female Professors do we have? | SELECT count(*) FROM Faculty WHERE Sex = 'F' AND Rank = "Professor" |
What is GPU Frequency, when Frequency is 1.67 GHz, and when sSpec Number is SLBX9(A0)? | SELECT gpu_frequency FROM table_name_71 WHERE frequency = "1.67 ghz" AND sspec_number = "slbx9(a0)" |
Which state has the most customers? | SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1 |
For the team with 7 points, how many points were scored against this season? | SELECT COUNT(pts_agst) FROM table_21991074_1 WHERE points = 7 |
What was his employee hire date? | SELECT EMP_HIREDATE FROM employee ORDER BY emp_dob LIMIT 1 |
Name the theatre name for french | SELECT theatre_name FROM table_2461720_1 WHERE language_of_films = "French" |
What are the distinct ages of the heads who are acting? | SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes' |
How many airports had Thompson driven by August 1963? | SELECT count ( * ) FROM airport as T1 JOIN flight as T2 on T1.id = T2.airport_id WHERE T2.pilot = 'Thompson' and T2.date > 'August 16, 1963' |
Which allergy type is the least common? | SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1 |
How many games did the tallest player have ever played? | SELECT T1.GP FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.ELITEID = ( SELECT t.ELITEID FROM PlayerInfo t ORDER BY t.height DESC LIMIT 1 ) |
Then could you please show me the list of wines those are more expensive than the average? | select * from wine where price > ( select avg ( price ) from wine ) |
Find the average prices of all products from each manufacture, and list each company's name. | SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name |
what is the date in 1986? | SELECT date FROM table_name_14 WHERE year = 1986 |
What was the timeslot for the episode in the year 2008? | SELECT timeslot FROM table_2639433_4 WHERE year = 2008 |
How long has the "Clear Green Turtle" dish appeared on the menu, and tell me when its latest update was? | SELECT T1.last_appeared - T1.first_appeared, T2.updated_at FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle' |
What is the difference in price between HL Mountain Frame - Black, 42 and LL Mountain Frame - Black, 42? | SELECT ( SELECT Price FROM Products WHERE Name = 'HL Mountain Frame - Black, 42' ) - ( SELECT Price FROM Products WHERE Name = 'LL Mountain Frame - Black, 42' ) AS num |
Which character is portrayed by Elias Koteas? | SELECT character FROM table_name_10 WHERE portrayed_by = "elias koteas" |
What was the compression ration when the engine was Wasp Jr. T1B2? | SELECT compression_ratio FROM table_1123802_1 WHERE engine = "Wasp Jr. T1B2" |
What is the sum of Game, when Date is "Wed. Nov. 14"? | SELECT SUM(game) FROM table_name_26 WHERE date = "wed. nov. 14" |
What is the Apartment type code of building id 808? | SELECT apt_type_code FROM Apartments where building_id = 808 |
What is the episode number of the episode that originally aired on January 26, 2009 and had a production number smaller than 38? | SELECT COUNT(episode_no) FROM table_name_53 WHERE original_airdate = "january 26, 2009" AND production_no < 38 |
What is the Track in Louisville, Kentucky? | SELECT track FROM table_name_56 WHERE location = "louisville, kentucky" |
What is his sponsor name? | SELECT Sponsor_name FROM player GROUP BY Occupation ORDER BY COUNT ( * ) desc LIMIT 1 |
List all the cities in Sumatra and state the population of each city. | SELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T3.Name = 'Sumatra' |
Which residence is the one with more than one player? | SELECT residence FROM player GROUP BY Residence HAVING COUNT ( * ) > 1 |
Who are the friends of Bob? | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob' |
How many breweries are there in Australia? | SELECT COUNT(BreweryName) FROM rootbeerbrand WHERE Country = 'Australia' |
Which Segment A has a Segment C of poster restoration? | SELECT segment_a FROM table_name_70 WHERE segment_c = "poster restoration" |
What character is portrayed by Joe Jonas? | SELECT character FROM table_name_59 WHERE portrayed_by = "joe jonas" |
What is the most common participant type? | SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1 |
Name the womens doubles when tour is malaysia super series | SELECT womens_doubles FROM table_14496232_2 WHERE tour = "Malaysia Super Series" |
What are the names of counties that do not contain any cities? | SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city) |
Name the player for fiji | SELECT player FROM table_name_29 WHERE country = "fiji" |
What was the earliest year with rank 20 and less than 60 floors? | SELECT MIN(year) FROM table_name_65 WHERE rank = 20 AND floors < 60 |
Name the club when tries for is 83 | SELECT club FROM table_13564702_3 WHERE tries_for = "83" |
What was the home team when the visiting team was Toronto? | SELECT home FROM table_name_22 WHERE visitor = "toronto" |
What are the last names of students in room 111? | SELECT lastname FROM list WHERE classroom = 111 |
What is the full name of the customer who rented the highest number of movies of all time? | SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.rental_id) AS num FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1 |
Find the name of the user who tweeted more than once, and number of tweets tweeted by them. | SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1 |
Mention the series code of countries using Australian dollar as their currency unit. Which country belongs to middle income group among them. | SELECT T1.CountryCode, T2.SeriesCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Australian dollar' AND T1.IncomeGroup = 'Lower middle income' |
What is the transfer window with n/a as the Transfer fee, free agent for the Moving to, and Joe Sagar as the name? | SELECT transfer_window FROM table_name_63 WHERE transfer_fee = "n/a" AND moving_to = "free agent" AND name = "joe sagar" |
Identify the percent of long reviews among all 5-star reviews given to businesses by the Yelp users. | SELECT CAST(SUM(CASE WHEN review_length = 'Long' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(review_length) FROM Reviews WHERE review_stars = 5 |
Show all storm names affecting region "Denmark". | SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'; |
What is the status of the county that has a 14.7% poverty rate? | SELECT status FROM table_22815568_1 WHERE poverty_rate = "14.7%" |
HOw many no votes were there when there were 45.60% yes votes | SELECT MIN(no_votes) FROM table_256286_20 WHERE _percentage_yes = "45.60%" |
Name the Score of jack nicklaus, united states, ? | SELECT score FROM table_name_13 WHERE country = "united states" AND player = "jack nicklaus" |
What is the US modern rock rank of code bad 0003? | SELECT us_modern_rock FROM table_name_90 WHERE code = "bad 0003" |
Show all male student ids who don't play football. | SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = "Football" |
and for the Jazz tracks? | SELECT AVG ( T2.Milliseconds ) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Jazz" |
How many different instruments does the musician with the last name "Heilo" use? | SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo" |
What was November 4, 1973 attendance? | SELECT attendance FROM table_name_64 WHERE date = "november 4, 1973" |
What was the highest attendance when the result was L 6-28? | SELECT MAX(attendance) FROM table_name_40 WHERE result = "l 6-28" |
Can you list the residents by the count of services in descending order by count of services? | Do you just want the resident ids? | The resident_id and count of services | SELECT T1.resident_id, count ( * ) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY count ( * ) DESC |
How many high assists are listed for the game with a score of 68-60? | SELECT COUNT(high_assists) FROM table_17118657_8 WHERE score = "68-60" |
What is the total amount paid for rentals made on July 29, 2005? | SELECT SUM(T2.amount) FROM rental AS T1 INNER JOIN payment AS T2 ON T1.rental_id = T2.rental_id WHERE date(T1.rental_date) = '2005-07-29%' |
Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail. | SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) = 2 INTERSECT SELECT T1.asset_id , T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING count(*) < 2 |
What is the sum of the points of the game with philadelphia as the visitor and an attendance greater than 7,284? | SELECT SUM(points) FROM table_name_26 WHERE visitor = "philadelphia" AND attendance > 7 OFFSET 284 |
What is the average number of reckless homicides that happened in a district? | SELECT CAST(COUNT(T2.report_no) AS REAL) / COUNT(DISTINCT T1.district_name) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T3.secondary_description = 'RECKLESS HOMICIDE' |
What is the average credit score for customers who have taken a loan? | SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) |
What is the content of the series Sky Radio? | SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio"; |
How many membership cards are black? | SELECT count ( * ) FROM member WHERE membership_card = "Black" |
list all female (sex is F) candidate names in the alphabetical order. | SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name |
What is the most common nationality of people? | SELECT Nationality FROM people GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 |
Calculate the average salary per order for Andrew Fuller. | SELECT CAST(SUM(T1.Salary) AS REAL) / COUNT(T2.EmployeeID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Andrew' AND T1.LastName = 'Fuller' |
Which GDP per capita (US$) (2004) is the highest one that has an Area (km²) larger than 148825.6, and a State of roraima? | SELECT MAX(gdp_per_capita__us) AS $___2004_ FROM table_name_37 WHERE area__km²_ > 148825.6 AND state = "roraima" |
What are the names of the other people who work for that company? | SELECT first_name,last_name FROM customers WHERE company = "Riotur" AND first_name ! = "Roberto" AND last_name ! = "Almeida" |
Return the minister who left office at the latest time. | SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 |
How many items appear in the average column when the totals were 105-161? | SELECT COUNT(average) FROM table_28628309_6 WHERE totals = "105-161" |
What is the smallest year for a Main of Eintracht Frankfurt, Rhein of Waldhof Mannheim, Sarr of FK Pirmasens, and Hessen of Wormatia Worms? | SELECT MIN(year) FROM table_name_96 WHERE main = "eintracht frankfurt" AND rhein = "waldhof mannheim" AND saar = "fk pirmasens" AND hessen = "wormatia worms" |
List the names of clubs that do not have any players. | SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player) |
Name the crew chief for ricky craven | SELECT crew_chief FROM table_2187178_1 WHERE driver_s_ = "Ricky Craven" |
Which department has the highest average instructor salary? | SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1 |
Who did the Seahawks play on September 4, 1983? | SELECT opponent FROM table_13258876_2 WHERE date = "September 4, 1983" |
Return reviewer name, movie title, stars, and rating date. And sort the data first by reviewer name, then by movie title, and lastly by number of stars. | SELECT T3.name , T2.title , T1.stars , T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name , T2.title , T1.stars |
Can you tell me the lowest Total natches that has the Points won of 3, and the Year of 1994? | SELECT MIN(total_matches) FROM table_name_11 WHERE points_won = 3 AND year = "1994" |
What is the name with the builder of Kerr Stuart | SELECT name FROM table_142159_1 WHERE builder = "Kerr Stuart" |
What is the score for round 2 for team Toshiba? | SELECT COUNT(round2) FROM table_16815824_1 WHERE team = "team Toshiba" |
What is the full place of birth of Rene Chenevert Balcer? | SELECT birth_place, birth_region FROM Person WHERE birth_name = 'Rene Chenevert Balcer' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.