sentence
stringlengths
3
347
sql
stringlengths
18
804
What was the date of the show titled Beat the Star?
SELECT date_aired FROM table_name_54 WHERE title = "beat the star"
Calculate the percentage of countries that belong to the American region.
SELECT CAST(SUM(IIF(T1.r_name = 'America', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey
Among all the crimes that had happened in Central Chicago, how many of them were cases of domestic violence?
SELECT COUNT(*) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Central' AND T1.domestic = 'TRUE'
How many students are on scholarships?
SELECT count ( distinct stuid ) FROM SportsInfo WHERE OnScholarship = "Y"
How many urgent orders did Clerk#000000001 handle in 1997?
SELECT COUNT(o_orderkey) FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1997' AND o_clerk = 'Clerk#000000001' AND o_orderpriority = '1-URGENT'
What country is Alain Labrecque from?
SELECT nationality FROM table_1965650_10 WHERE player = "Alain Labrecque"
What are names of customers who have both mailshots in "order" outcome? | Do you want the names of customers who have mailshot with an outcome code "Order"? | Yes
SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order'
1980 smaller than 719, and a 1960 smaller than 205, and a 1996[2] smaller than 364, and a 1970 larger than 251 is what 1990 highest?
SELECT MAX(1990) FROM table_name_94 WHERE 1980 < 719 AND 1960 < 205 AND 1996[2] < 364 AND 1970 > 251
Who was the jockey in 7th position?
SELECT jockey FROM table_22265261_1 WHERE position = "7th"
Find the emails of customers who has filed a complaints of the product with the most complaints.
SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) LIMIT 1
Calculate the average age of patients with prediabetes care plan.
SELECT CAST(SUM(CASE WHEN T1.deathdate IS NULL THEN strftime('%Y', T2.STOP) - strftime('%Y', T1.birthdate) ELSE strftime('%Y', T1.deathdate) - strftime('%Y', T1.birthdate) END) AS REAL) / COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Prediabetes'
Show the names of roles with role code..
SELECT role_code,role_name FROM ROLES
What is the accrediation for united tribes technical college?
SELECT accreditation FROM table_2076522_2 WHERE school = "United Tribes Technical College"
Identify all the restaurants in Marin County by their id.
SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county'
What is average age of male for different job title?
SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job
List the name of ships that are not involved in any mission
SELECT Name FROM ship WHERE Ship_ID NOT IN ( SELECT Ship_ID FROM mission )
Show the first name, last name, and phone number for all female faculty members.
SELECT Fname , Lname , phone FROM Faculty WHERE Sex = 'F'
What is the record for November 26, with the decision made by Prusek?
SELECT record FROM table_name_44 WHERE decision = "prusek" AND date = "november 26"
Name the most total
SELECT MAX(total) FROM table_22360_3
Which school, club team, or country played for the rockets in the years 2000-01?
SELECT school_club_team_country FROM table_11734041_3 WHERE years_for_rockets = "2000-01"
How many sales representitives are based in the offices in the USA?
SELECT COUNT(t1.employeeNumber) FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.country = 'USA' AND t1.jobTitle = 'Sales Rep'
What class has less than 12 numbers built operated by southern?
SELECT class FROM table_name_1 WHERE no_built < 12 AND operator = "southern"
What is the name of the team that won match ID 336000?
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Id = 336000
Tell me the county for mariano castro
SELECT county FROM table_name_48 WHERE grantee = "mariano castro"
How many wins had less than 91 points in 25th rank?
SELECT wins FROM table_name_44 WHERE points < 91 AND rank = "25th"
What is the set 5 with a 19-25 set 1?
SELECT set_5 FROM table_name_44 WHERE set_1 = "19-25"
List down the locations of menu sponsored by Norddeutscher Lloyd Bremen.
SELECT location FROM Menu WHERE sponsor = 'Norddeutscher Lloyd Bremen'
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
SELECT flno , origin , destination FROM Flight ORDER BY origin
What are the names of players who had been man of the match more than 5 times in season year 2008?
SELECT CASE WHEN COUNT(T2.Man_of_the_Match) > 5 THEN T1.Player_Name ELSE 0 END FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008
What is 1987, when 1986 is "1R"?
SELECT 1987 FROM table_name_15 WHERE 1986 = "1r"
What player was drafted 252?
SELECT player FROM table_name_52 WHERE pick = 252
What is the total number of played for the entry with a position of less than 1?
SELECT SUM(played) FROM table_name_65 WHERE position < 1
What is the name of the person who is the oldest?
SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)
List the official names of cities that have not held any competition.
SELECT Official_Name FROM city WHERE City_ID NOT IN (SELECT Host_city_ID FROM farm_competition)
Show distinct names of singers that have songs with sales more than 300000.
SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID = T2.Singer_ID WHERE T2.Sales > 300000
What was the score of the game when the attendance was 1,644?
SELECT score FROM table_name_38 WHERE attendance = "1,644"
What is the total revenue of each manufacturer?
SELECT sum(revenue) , name FROM manufacturers GROUP BY name
Please list the IDs of all the menus that are DIYs of the restaurant.
SELECT id FROM Menu WHERE sponsor IS NULL
What district is incumbent jack hightower from?
SELECT district FROM table_1341598_44 WHERE incumbent = "Jack Hightower"
What is the sum of the ranks for the film, eddie murphy raw?
SELECT SUM(rank) FROM table_name_19 WHERE title = "eddie murphy raw"
When David E. Finley was the incumbent what was the result?
SELECT result FROM table_name_8 WHERE incumbent = "david e. finley"
Which claim had the highest claim value? Please list the date the claim was made and the claim id.
SELECT T1.Date_Claim_Made , T1.Claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id order by T1.Amount_Claimed desc limit 1
Show the average and maximum damage for all storms with max speed higher than 1000.
SELECT avg(damage_millions_USD) , max(damage_millions_USD) FROM storm WHERE max_speed > 1000;
Indicate the fax of the company Blondesddsl pre et fils in Strasbourg city.
SELECT Fax FROM Customers WHERE CompanyName = 'Blondesddsl pre et fils' AND City = 'Strasbourg'
Who directed the episode that aired on july15,2012?
SELECT directed_by FROM table_20704243_6 WHERE original_air_date = "July15,2012"
Show different builders of railways, along with the corresponding number of railways using each builder.
SELECT Builder , COUNT(*) FROM railway GROUP BY Builder
What is the name of the team when the stadium is listed as Edward Jones Dome?
SELECT team FROM table_28884858_1 WHERE stadium = "Edward Jones Dome"
How many movies did Universal Studios release?
SELECT COUNT(T2.movie_id) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id WHERE T1.company_name = 'Universal Studios'
What was the total number of A scores for Japan when the T score was more than 4?
SELECT COUNT(a_score) FROM table_name_63 WHERE nation = "japan" AND t_score > 4
For club Swansea Uplands RFC, what is the amount of tries against?
SELECT tries_against FROM table_17675675_2 WHERE club = "Swansea Uplands RFC"
What is the name of the player with the largest number of votes?
SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1
How many advisors are there?
SELECT count(DISTINCT advisor) FROM Student
Which team had 7 losses and 55 goals?
SELECT team FROM table_name_80 WHERE losses = "7" AND goals_for = 55
What is the sum of Wins when draws shows 0 in 1964?
SELECT SUM(wins) FROM table_name_46 WHERE draws = 0 AND season = 1964
Which away team plays at Arden Street Oval?
SELECT away_team FROM table_name_89 WHERE venue = "arden street oval"
What is the USN 2013 ranking with a BW 2013 ranking less than 1000, a Forbes 2011 ranking larger than 17, and a CNN 2011 ranking less than 13?
SELECT SUM(usn_2013) FROM table_name_63 WHERE bw_2013 < 1000 AND forbes_2011 > 17 AND cnn_2011 < 13
What album was the song Shimmy Jimmy from the episode titled Toy to the world on?
SELECT album_s_ FROM table_23667534_1 WHERE episode_title = "Toy to the World" AND song_s__title = "Shimmy Jimmy"
Find the number of people who is under 40 for each gender.
SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender
List the hardware model name and company name for the phone whose screen mode type is "Graphics."
SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics";
What was the score on April 21?
SELECT score FROM table_name_12 WHERE date = "april 21"
What's the year in 5th position that happened in Osaka, Japan?
SELECT MIN(year) FROM table_name_92 WHERE position = "5th" AND venue = "osaka, japan"
What score did the home team of north melbourne get?
SELECT home_team AS score FROM table_name_59 WHERE home_team = "north melbourne"
Tell me class code for class room BUS311 ?
SELECT class_code FROM CLASS where CLASS_ROOM = 'BUS311'
What's the total of Games with a Lost that's larger than 2, and has Points that's smaller than 0?
SELECT SUM(games) FROM table_name_75 WHERE lost > 2 AND points < 0
What are the names of the two directors who have multiple show times?
SELECT distinct T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id where T1.show_times_per_day>1
What is the area of the appelation that produces the highest number of wines before the year of 2010?
SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY count(*) DESC LIMIT 1
During st kilda's home game, what was the number of people in the crowd?
SELECT crowd FROM table_name_12 WHERE home_team = "st kilda"
what are the shops? | Do you want the names of all the shops? | yes
select shop_name from shop
Find the title and star rating of the movie that got the least rating star for each reviewer.
SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID
Among the cities with alias St Thomas, provide the type of postal point for each city.
SELECT DISTINCT T2.type FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'St Thomas'
Find the top price?
SELECT Product_Price FROM Products ORDER BY Product_PRICE DESC LIMIT 1
Who has been coached by Jameson Tomas?
SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Coach_name = "Jameson Tomas"
Return the average age across all gymnasts.
SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID
Which Week has Points For larger than 19, and an Opponent of philadelphia eagles, and Points Against larger than 7?
SELECT MAX(week) FROM table_name_17 WHERE points_for > 19 AND opponent = "philadelphia eagles" AND points_against > 7
How many Points have an Against smaller than 43, and a Position smaller than 1?
SELECT SUM(points) FROM table_name_49 WHERE against < 43 AND position < 1
Which Country has azeri tv tower?
SELECT country FROM table_name_61 WHERE name = "azeri tv tower"
What are the names of races that were held after 2017 and the circuits were in the country of Spain?
SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
What's the sum of the games that had paul (9) for high assists?
SELECT SUM(game) FROM table_name_61 WHERE high_assists = "paul (9)"
What are the first and last name for those employees who works either in department 70 or 90?
SELECT first_name , last_name FROM employees WHERE department_id = 70 OR department_id = 90
Which Airport has a Carrier of malaysia airlines?
SELECT airport FROM table_name_52 WHERE carriers = "malaysia airlines"
What tournament was on Jan 29, 2012?
SELECT tournament FROM table_name_8 WHERE date = "jan 29, 2012"
Find the model of the car whose weight is below the average weight.
SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T2.Weight < (SELECT avg(Weight) FROM CARS_DATA)
When river ness is the hr name what is the hr number?
SELECT hr_no FROM table_1886270_1 WHERE hr_name = "River Ness"
Name the year for hercules
SELECT year_made FROM table_name_52 WHERE class = "hercules"
What's the general classification of Ignatas Konovalovas when the mountains classification was Stefano Garzelli and points classification was Danilo Di Luca?
SELECT general_classification FROM table_name_36 WHERE mountains_classification = "stefano garzelli" AND points_classification = "danilo di luca" AND winner = "ignatas konovalovas"
On what date was James P. Buchanan (d)'s successor seated?
SELECT date_successor_seated FROM table_2159547_3 WHERE vacator = "James P. Buchanan (D)"
List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.
SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name
How many of the patients who underwent a 'bone immobilization' procedure have a driver's license?
SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Bone immobilization' AND T1.drivers IS NOT NULL
In what Season were there 86 Assists in the WCJHL League?
SELECT season FROM table_name_53 WHERE league = "wcjhl" AND assists = 86
How many types of products have Rodrick Heaney bought in total?
SELECT count(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney"
Which flag is most widely used among all ships?
SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
Which tournament did the opponent Guillermo Carry play?
SELECT tournament FROM table_name_60 WHERE opponent = "guillermo carry"
what is the average tournaments played when cuts made is 14?
SELECT AVG(tournaments_played) FROM table_name_63 WHERE cuts_made = 14
what educational institute does wes swinson attend
SELECT college_junior_club_team FROM table_2781227_10 WHERE player = "Wes Swinson"
Which major has least number of students? List the major and the number of students.
SELECT Major , count(*) FROM Student GROUP BY Major ORDER BY count(Major) ASC LIMIT 1;
Who was the original artist for First Solo?
SELECT original_artist FROM table_26250176_1 WHERE theme = "First Solo"
What are the names and arrival times of trains?
SELECT Name , Arrival FROM train
Which opponent has a loss of trout (7-4)?
SELECT opponent FROM table_name_53 WHERE loss = "trout (7-4)"
How many different instruments are used in the song "Badlands"?
SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands"
What are the dates for the documents with both 'GV' type and 'SF' type expenses?
SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'