sentence
stringlengths
3
347
sql
stringlengths
18
804
What is the pick # for Dimelon Westfield?
SELECT MIN(pick__number) FROM table_name_93 WHERE player = "dimelon westfield"
Which two nations are separated from one another by the longest border? Please include the entire names of the nations in your answer.
SELECT Country1, Country2 FROM borders ORDER BY Length DESC LIMIT 1
Can you show me the list in descending order of sales and profits again?
SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion , Profits_in_Billion DESC
What was escape to river cottage released?
SELECT released FROM table_name_64 WHERE dvd_name = "escape to river cottage"
Show names and phones of customers who do not have address information.
SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM customer_address_history)
Show the booking status code and the corresponding number of bookings.
SELECT booking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
What campuses are located in Los Angeles county and opened after 1950?
SELECT campus FROM campuses WHERE county = "Los Angeles" AND YEAR > 1950
How many proteins are associated with an institution in a building with at least 20 floors?
SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20
Who were the guests in the episode with production code 6021?
SELECT guest FROM table_25691838_2 WHERE production_code = 6021
How many businesses are there in Phoenix city? Find the percentage of businesses in Phoenix city in the total city.
SELECT SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS "num" , CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.city) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id
What is the Tournament with a 3r 2011 and A 2010?
SELECT tournament FROM table_name_63 WHERE 2011 = "3r" AND 2010 = "a"
How many students who are majoring in 600 are in each of those clubs?
SELECT t1.clubname,count ( * ) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = "600" GROUP BY t1.clubname ORDER BY count ( * )
How many games has the club with 29-24 goals for/against score played?
SELECT games_played FROM table_13713206_1 WHERE goals_for_against = "29-24"
What is the average 2006 metropolitan population of Lima with a GDP per capita over $13,100?
SELECT AVG(metropolitan_population__2006__millions) FROM table_name_38 WHERE metropolitan_area = "lima" AND gdp__ppp__us$_per_capita > 13 OFFSET 100
What year was the venue in Barcelona, Spain?
SELECT MIN(year) FROM table_name_57 WHERE venue = "barcelona, spain"
Find the number of rooms that do not have any reservation.
SELECT COUNT(*) FROM rooms WHERE NOT roomid IN (SELECT DISTINCT room FROM reservations)
What is the lowest year that has athens, greece as the venue?
SELECT MIN(year) FROM table_name_83 WHERE venue = "athens, greece"
List the names of camera supervisors in the crew.
SELECT T1.person_name FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T2.job = 'Camera Supervisor'
How did Eunic Morar pay?
SELECT payment_method FROM customers where customer_name = "Eunice Morar"
What year saw the greatest number of organizations created on the European continent?
SELECT STRFTIME('%Y', T4.Established) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T2.Country = T3.Code INNER JOIN organization AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Europe' GROUP BY STRFTIME('%Y', T4.Established) ORDER BY COUNT(T4.Name) DESC LIMIT 1
What are the different carriers for devices, listed in alphabetical order?
SELECT Carrier FROM device ORDER BY Carrier ASC
What is the catalogue number for the song that is 3:17 and was released 9/21/71?
SELECT catalogue FROM table_name_94 WHERE release_date = "9/21/71" AND time = "3:17"
How many id movies have category id 11?
SELECT COUNT(film_id) FROM film_category WHERE category_id = 11
What is Position, when Player is "Kevin Durant category:articles with hCards"?
SELECT position FROM table_name_71 WHERE player = "kevin durant category:articles with hcards"
Which rounds do Arciero Wines sponsor a March 85c chassis?
SELECT rounds FROM table_name_7 WHERE sponsor_s_ = "arciero wines" AND chassis = "march 85c"
What are their party affiliations?
SELECT T2.Party FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name
Who were the Investing Dragons in the episode that first aired on 18 January 2005 with the entrepreneur Tracey Herrtage?
SELECT investing_dragon_s_ FROM table_name_65 WHERE first_aired = "18 january 2005" AND entrepreneur_s_ = "tracey herrtage"
Which object has the highest attribute classes?
SELECT OBJ_SAMPLE_ID FROM IMG_OBJ_ATT GROUP BY OBJ_SAMPLE_ID ORDER BY COUNT(OBJ_SAMPLE_ID) DESC LIMIT 1
Ok, I will also want to know the billing countries of the named customers
SELECT T1.FirstName, T1.lastname, T2.billingcountry FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId
What was the earliest round with Neil Colzie and a pick smaller than 24?
SELECT MIN(round) FROM table_name_26 WHERE player = "neil colzie" AND pick < 24
How many projects are there?
SELECT count ( project_id ) from Project_Staff
Find the payment method that is used the most often in all the invoices. Give me its code.
SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1
State the name of employee that manages the order from Victuailles en stock?
SELECT DISTINCT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.CompanyName = 'Victuailles en stock'
On what date was Arthur Jones the away captain at Sydney Cricket Ground?
SELECT date FROM table_name_33 WHERE away_captain = "arthur jones" AND venue = "sydney cricket ground"
What are the the full names and ids for all customers, and how many accounts does each have?
SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name , count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
How many home games are listed when the average attendance is 79475?
SELECT COUNT(home_games) FROM table_28884858_1 WHERE average_attendance = 79475
What is the Attendance number when the Opponent was purdue?
SELECT attendance FROM table_name_15 WHERE opponent_number = "purdue"
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'
What type has the characters 廣丙?
SELECT type FROM table_name_25 WHERE characters = "廣丙"
What percentage of all scenes are tragic scenes in Shakespeare's work in 1594?
SELECT CAST(SUM(IIF(T2.GenreType = 'Tragedy', 1, 0)) AS REAL) * 100 / COUNT(T1.Scene) FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.Date = '1594'
Who was the opponent at GCM – D.O.G. 4?
SELECT opponent FROM table_name_54 WHERE event = "gcm – d.o.g. 4"
What losses consist of the team of japan?
SELECT losses FROM table_name_13 WHERE team = "japan"
when was the episode with production code "2arg01" originally aired?
SELECT original_air_date FROM table_27332038_1 WHERE production_code = "2ARG01"
Name the number of class aaaaa for 1988-89
SELECT COUNT(class_aAAAA) FROM table_14601528_2 WHERE school_year = "1988-89"
What is the lowest Draws, when Byes is less than 2?
SELECT MIN(draws) FROM table_name_6 WHERE byes < 2
How many distinct kinds of camera lenses are used to take photos of mountain ranges in the country "Ethiopia"?
SELECT count ( DISTINCT T2.camera_lens_id ) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia'
Where can you rent the movie 'Wyoming Storm'? Identify the address of the rental store and the rental rate.
SELECT T2.store_id, T1.address, T4.rental_rate FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id INNER JOIN inventory AS T3 ON T2.store_id = T3.store_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.title = 'WYOMING STORM'
What club does John Westin play for?
SELECT college_junior_club_team__league_ FROM table_name_99 WHERE player = "john westin"
What was the Score on March 1?
SELECT score FROM table_name_18 WHERE date = "march 1"
Give the repository Url of the one with most solutions.
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) DESC LIMIT 1
can you show me artist's countries? | did you mean the country of the oldest artist or countries of all the artists? | countries of all the artists
SELECT distinct Country FROM artist
What time was the acc team #17 wake forest?
SELECT time FROM table_21330550_2 WHERE acc_team = "#17 Wake Forest"
What is the fewest number of draws for teams with more than 0 byes?
SELECT MIN(draws) FROM table_name_75 WHERE byes > 0
What nickname has the meaning of God knows my journey?
SELECT nickname FROM table_name_63 WHERE meaning = "god knows my journey"
On what Date was Henry I Latin Commander of the Battle of Boruy?
SELECT date FROM table_name_67 WHERE latin_commander = "henry i" AND battle = "battle of boruy"
what about international passengers?
SELECT sum ( International_Passengers ) FROM airport WHERE Airport_Name LIKE "%Heathrow%"
How long is the class?
SELECT Hours FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = "INTRODUCTION TO COMPUTER SCIENCE"
For which tie was Scunthorpe United the away team?
SELECT tie_no FROM table_name_5 WHERE away_team = "scunthorpe united"
Calculate the percentage of suppliers in Germany.
SELECT CAST(SUM(IIF(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0
Who had the fasted lap in motorsport arena oschersleben?
SELECT fastest_lap FROM table_21321935_2 WHERE circuit = "Motorsport Arena Oschersleben"
What is the total appearances when the total goals is 289?
SELECT MIN(total_appearances) FROM table_29701419_2 WHERE total_goals = 289
For each Orange county campus, report the number of degrees granted after 2000.
SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus
Who is the current champion in the NECW Heavyweight Championship?
SELECT current_champion_s_ FROM table_name_44 WHERE championship = "necw heavyweight champion"
Find the texts of assessment notes for teachers with last name "Schuster".
SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schuster"
What were the notes in 2011?
SELECT notes FROM table_name_89 WHERE year = 2011
Which tournament had a score of 6–4, 4–6, 7–5?
SELECT tournament FROM table_name_70 WHERE score = "6–4, 4–6, 7–5"
What is the total number of awards won by The simpson 20s: Season 20?
SELECT COUNT(award_id) FROM Award WHERE result = 'Winner';
How many captains have the kitmaker as n/a?
SELECT COUNT(captain) FROM table_27631756_2 WHERE kitmaker = "N/A"
Among the top 5 owners with highest number of establishments, which owner has the highest number of high risk violations? Give the name of the owner.
SELECT T4.owner_name FROM violations AS T3 INNER JOIN businesses AS T4 ON T3.business_id = T4.business_id INNER JOIN ( SELECT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.owner_name ORDER BY COUNT(T1.business_id) DESC LIMIT 5 ) AS T5 ON T4.owner_name = T5.owner_name WHERE T3.risk_category = 'High Risk' GROUP BY T4.owner_name ORDER BY COUNT(T3.risk_category) DESC LIMIT 1
What was the total amount of Value ($M), when the Country was Spain, the Rank was 19, and the Debt as % of value was larger than 159?
SELECT COUNT(value__) AS $m_ FROM table_name_54 WHERE country = "spain" AND rank = 19 AND debt_as__percentageof_value > 159
Which problems were reported by the staff named Dameon Frami or Jolie Weber? Give me the ids of the problems.
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_last_name = "Weber"
What was the score when the time was 14:00?
SELECT score FROM table_name_86 WHERE time = "14:00"
what is the debut when the play er is radoslava topalova and the years played is less than 2?
SELECT AVG(debut) FROM table_name_33 WHERE player = "radoslava topalova" AND years_played < 2
How many no votes from Alaska in 1998?
SELECT no_vote FROM table_name_31 WHERE date = "1998" AND state = "alaska"
What is the Away team when the FootyTAB winner was st. george?
SELECT away_team FROM table_name_13 WHERE footytab_winner = "st. george"
Name the jury of 10 points
SELECT professional_jury FROM table_14977252_2 WHERE points = 10
How many cinema do we have?
SELECT count(*) FROM cinema
How many legislators have not been registered in Federal Election Commission data?
SELECT COUNT(*) FROM current WHERE fec_id IS NULL OR fec_id = ''
Which place has points larger than 1, a bmw machine, and a time of 1:18.47.6?
SELECT MIN(place) FROM table_name_44 WHERE points > 1 AND machine = "bmw" AND time = "1:18.47.6"
List all headquarters and the number of companies in each headquarter.
SELECT headquarters , count(*) FROM company GROUP BY headquarters
What year was the League the malaysian super league, and a Malaysia Cup of group stage?
SELECT year FROM table_name_73 WHERE league = "malaysian super league" AND malaysia_cup = "group stage"
How many airports do we have?
SELECT count(*) FROM AIRPORTS
What is the Venue with a Result that is lost?
SELECT venue FROM table_name_40 WHERE result = "lost"
For the earlier table with sorted counts, can you give me the first name associted with each teacher_id?
SELECT T2.first_name, T1.teacher_id , count ( * ) 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
Which Owner(s) has a Description of hunslet engine company 0-6-0st?
SELECT owner_s_ FROM table_name_18 WHERE description = "hunslet engine company 0-6-0st"
What was the name of the airplane from flight 99 ?
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
What are the names of perpetrators whose country is not "China"?
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country != "China";
How many Losses have South West DFL of coleraine, and an Against smaller than 891?
SELECT COUNT(losses) FROM table_name_51 WHERE south_west_dfl = "coleraine" AND against < 891
List the brand IDs of the beers whose star rating is more than 3.
SELECT BrandID FROM rootbeerreview WHERE StarRating > 3
How many students are there?
SELECT count(*) FROM Student
Calculate the difference between the total sales in the East superstore and the total sales in the West superstore.
SELECT SUM(T1.Sales) - SUM(T2.Sales) AS difference FROM east_superstore AS T1 INNER JOIN west_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID`
Thank you very much! Could you add the Opening Hours to that list for each of the tourist attractions?
SELECT T2.Name, t2.Tourist_Attraction_ID, t2.Opening_Hours FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "660 Shea Crescent" OR T2.How_to_Get_There = "walk"
How many of the cities are in a Bay Area?
SELECT COUNT(city) FROM geographic WHERE region = 'bay area'
In what county is the entry that has a Construction Completed date of 07/19/2000 and a Listed date of 09/21/1984 located?
SELECT county FROM table_name_68 WHERE listed = "09/21/1984" AND construction_completed = "07/19/2000"
Which journalist has worked the 2nd most amount of years?
SELECT journalist_ID FROM journalist where journalist_ID not in ( SELECT journalist_ID FROM journalist ORDER BY Years_working DESC LIMIT 1 ) ORDER BY Years_working DESC LIMIT 1
What was the preliminary average for the one who had a semifinal average of 8.966 (3)?
SELECT preliminary_average FROM table_16323766_3 WHERE semifinal_average = "8.966 (3)"
Show the ids of students whose advisors are professors.
SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = "Professor"
Which region has the second most clients?
SELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division ORDER BY COUNT(T2.division) DESC LIMIT 1, 1
What is the highest profits in billions of the company headquartered in the USA with a market value of 194.87 billions and less than 76.66 billions in sales?
SELECT MAX(profits__billion_) AS $_ FROM table_name_87 WHERE headquarters = "usa" AND market_value__billion_$_ = 194.87 AND sales__billion_$_ < 76.66
What is the label with the most albums?
SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1