sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
List the name of products in ascending order of price. | SELECT Product_Name FROM Products ORDER BY Product_Price |
What is game 34's record? | SELECT record FROM table_name_11 WHERE game = 34 |
Which team has the most victories as the home team in matches of the Bundesliga division? | SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'H' GROUP BY T1.HomeTeam ORDER BY COUNT(T1.FTR) DESC LIMIT 1 |
Find the phone number of all the customers and staff. | SELECT phone_number FROM customers UNION SELECT phone_number FROM staff |
Which Surname has Throws of r, and a Position of p, and a DOB of 26 april 1989? | SELECT surname FROM table_name_64 WHERE throws = "r" AND position = "p" AND dob = "26 april 1989" |
How many points does g a vandervell have? | SELECT points FROM table_name_95 WHERE entrant = "g a vandervell" |
List all company names with a book published by Alyson. | SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson' |
What is the name of the integrated where the component are customers? | SELECT integrated FROM table_11944282_1 WHERE component = "Customers" |
State the country and its population with population growth greater than 2% but infant mortality rate less than 5%. | SELECT T1.Name, T1.Population FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T2.Population_Growth > 2 AND T2.Infant_Mortality < 5 |
How many universities are located in Japan? | SELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Japan' |
Name the poles for avg start being 4.7 | SELECT poles FROM table_2308381_2 WHERE avg_start = "4.7" |
What are the population, name and leader of the country with the largest area? | SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1 |
How many times does the word "riu" appears in the biwords pair? | SELECT COUNT(T1.wid) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.word = 'riu' |
Who was the Centerfold model when O.J. Simpson was the Interview Subject? | SELECT centerfold_model FROM table_name_72 WHERE interview_subject = "o.j. simpson" |
Please list the titles of all the recipes that are salt/sodium-free. | SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.sodium < 5 |
How many albums does the artist "Metallica" have? | SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica" |
What is the theme and artist name for the exhibition with a ticket price higher than the average? | SELECT T1.theme , T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT avg(ticket_price) FROM exhibition) |
What was the final score in the game against the Cincinnati Bengals? | SELECT final_score FROM table_name_78 WHERE visiting_team = "cincinnati bengals" |
How many participants belong to the type 'Organizer'? | SELECT count(*) FROM participants WHERE participant_type_code = 'Organizer' |
What is the average household income in the city known as "Danzig"? | SELECT T2.avg_income_per_household FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Danzig' |
What is the average number of authors for all titles? | SELECT paperID,avg ( authOrder ) FROM authorship group by paperID |
How many years have had the position of 2nd? | SELECT COUNT(year) FROM table_name_66 WHERE position = "2nd" |
Find the first name, last name and id for the top three players won the most player awards. | SELECT T1.name_first , T1.name_last , T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 3; |
which week had an attendance of 53,677? | SELECT COUNT(week) FROM table_name_43 WHERE attendance = "53,677" |
If there are 28 points, what is the time/retired? | SELECT time_retired FROM table_17330069_1 WHERE points = "28" |
Show all distinct positions of matches. | SELECT DISTINCT POSITION FROM match_season |
What is the average age of your drivers? | SELECT avg ( Age ) FROM driver |
What is the name of the Olympic game with the most competitors held in Barcelona? | SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Barcelona' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1 |
Who is the jockey for the winning horse Rafael Bejarano? | SELECT winning_horse FROM table_name_81 WHERE winning_jockey = "rafael bejarano" |
Name the sum To par for score of 71-74-71-72=288 | SELECT SUM(to_par) FROM table_name_26 WHERE score = 71 - 74 - 71 - 72 = 288 |
what is the name of the actor that starred in most films? | SELECT T2.first_name , T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY count ( * ) DESC LIMIT 1 |
Who was the director where the role was Fred Ayres? | SELECT director FROM table_name_13 WHERE role = "fred ayres" |
How many restaurants in Broadway, Oakland received a review of no more than 3? | SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.street_name = 'broadway' AND T2.review < 3 AND T1.city = 'oakland' |
What is the highest number of points before 1954? | SELECT MAX(points) FROM table_name_5 WHERE year < 1954 |
What is the latitude, longitude, city of the station from which the shortest trip started? | SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration LIMIT 1 |
What sales channels are used the most in the 3 places with the highest median income? | SELECT `Sales Channel` FROM ( SELECT T1.`Sales Channel` FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY T2.`Median Income` DESC LIMIT 3 ) GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1 |
How many events were held at coordinate 97,40? | SELECT COUNT(event_id) FROM `events` WHERE latitude = 40 AND longitude = 97 |
How many lessons taught by staff whose first name has letter 'a' in it? | SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%" |
What is the Film title used in nomination of Cilvēka Bērns? | SELECT film_title_used_in_nomination FROM table_name_91 WHERE original_title = "cilvēka bērns" |
Name the scientific name for veiled chameleon | SELECT scientific_name FROM table_175442_1 WHERE common_name = "Veiled chameleon" |
Please list all the years in which the car model Chevrolet Impala was introduced in the market. | SELECT DISTINCT T1.model_year FROM production AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.car_name = 'chevrolet impala' |
What is the average attendance at a game held at Firhill for the 5(r) round? | SELECT AVG(attendance) FROM table_name_26 WHERE venue = "firhill" AND round = "5(r)" |
Please show the employee first names and ids of employees who serve at least 10 customers. | SELECT T1.FirstName , T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) >= 10 |
how many course id in the table? | Select count ( distinct course_id ) from student_course_registrations |
LIST ALL THE COUNTRIES WITH ORIGINS OF LEAST PLAYERS | Isn't it the same question as the last one? | NO, LIST THREE COUNTRIES WHICH ARE THE ORIGINS OF THE LEAST PLAYERS | SELECT birth_country FROM player GROUP BY birth_country ORDER BY count ( * ) ASC LIMIT 3 |
Could you please provide the total tracks on each top 5 genres by number of tracks? | SELECT T1.id,COUNT ( * ) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count ( * ) DESC LIMIT 5 |
What is the highest possible level? | SELECT MAX(level) FROM table_1751142_2 |
How many coaches of the Montreal Canadiens have gotten in the Hall of Fame? | SELECT COUNT(DISTINCT hofID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens' |
What are the details for the projects which were launched by the organization with the most projects? | SELECT project_details FROM Projects WHERE organisation_id IN ( SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY count(*) DESC LIMIT 1 ) |
Frequency MHz of 93.7 has what class? | SELECT class FROM table_name_4 WHERE frequency_mhz = 93.7 |
Which last names are both used by customers and staff? | SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff |
Tell me the Shuji Kondo for MAZADA of X with Ryuji Hijikata of hijikata (14:24) | SELECT shuji_kondo FROM table_name_90 WHERE mazada = "x" AND ryuji_hijikata = "hijikata (14:24)" |
what is the height of Boardwalk Bullet | SELECT Height FROM roller_coaster where Name = 'Boardwalk Bullet' |
Which Chief Judge has Active service of 1873–1875? | SELECT chief_judge FROM table_name_23 WHERE active_service = "1873–1875" |
What is the status of the Hamaoka-3 unit? | SELECT status FROM table_name_33 WHERE unit = "hamaoka-3" |
What is 2010 when 2003 is 5.6? | SELECT 2010 FROM table_27146868_1 WHERE 2003 = "5.6" |
What is the GDP and population of Nanjing (Jiangsu)? | SELECT distinct t1.gdp , t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city where t1.city = 'Nanjing ( Jiangsu ) ' |
Which titles have the content "love" but the category is art produced between 2018 and 2019. | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE (T2.created_at LIKE '2018-%' AND T1.category = 'arts' AND T2.content LIKE '%love%') OR (T2.created_at LIKE '2019-%' AND T1.category = 'arts' AND T2.content LIKE '%love%') |
Show the card type codes and the number of transactions. | SELECT T2.card_type_code , count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code |
Write the name of the player who was the man of the series more than one time. | SELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Man_of_the_Series > 1 |
In what Week was the Attendance 17,737? | SELECT COUNT(week) FROM table_name_19 WHERE attendance = "17,737" |
Who directed hamateur night? | SELECT director FROM table_name_2 WHERE title = "hamateur night" |
What were the dates of those transactions? | Do you mean the transactions with share count equal to or larger than 10? | Yes please, if you don't mind? | SELECT T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count > = 10 |
What city had a rank before 3 and primary carrier JetBlue Airways? | SELECT city FROM table_name_78 WHERE rank < 3 AND carriers = "jetblue airways" |
In what Venue was Surrey the Opposition in the 2nd Wicket? | SELECT venue FROM table_name_45 WHERE opposition = "surrey" AND wicket = "2nd" |
How many types of work is хромая судьба? | SELECT COUNT(type_of_work) FROM table_207795_1 WHERE russian_title = "Хромая судьба" |
How many matches did team Kings XI Punjab win in season year 2008? | SELECT COUNT(DISTINCT T2.Match_Id) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Kings XI Punjab' AND T4.Season_Year = 2008 |
Show me the name of the aircraft with the fewest people who have its certificate | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count ( * ) ASC LIMIT 1 |
What is Tyler Swift's email? | SELECT email FROM user_profiles where name = "Tyler Swift" |
What is the total number of degrees granted after 2000 for each Orange county campus? | 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 |
What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents? | SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id; |
What is the highest round that has an overall of 143 and a pick greater than 6? | SELECT MAX(round) FROM table_name_36 WHERE overall = 143 AND pick > 6 |
What is the birthday of the staff member with the first and last name as Janessa and Sawayn? | SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn" |
How many movies were added to the list with the most number of movies? Indicate whether the user was a paying subscriber or not when he created the list. | SELECT T1.list_movie_number, T2.user_has_payment_method FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id ORDER BY T1.list_movie_number DESC LIMIT 1 |
What is the goal difference sum that has goals against smaller than 33, draws larger than 13? | SELECT SUM(goal_difference) FROM table_name_27 WHERE goals_against < 33 AND draws > 13 |
ok, name the body builders whose total score is higher than 250 | SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 250 |
What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s? | SELECT AVG(cuts_made) FROM table_name_93 WHERE top_10 = 11 AND wins < 1 |
What is the total price including optional support received by the teacher who posted the essay titled "Recording Rockin' Readers"? | SELECT SUM(T1.total_price_including_optional_support) FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title = 'Recording Rockin'' Readers' |
how many different author logins are there? | SELECT count ( distinct login_name ) from Course_Authors_and_Tutors |
What language is the film Marion Bridge? | SELECT language FROM table_name_46 WHERE film = "marion bridge" |
What's the average damage in millions usd for all storms? | SELECT avg ( Damage_millions_USD ) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id |
How many golds were there when there was more than 11 bronze and 29 in total? | SELECT COUNT(gold) FROM table_name_92 WHERE bronze > 11 AND total = 29 |
How many directed have the product code of 2.8? | SELECT COUNT(directed_by) FROM table_20124413_2 WHERE prod_code = "2.8" |
Which Score has a Set 2 of 25–17, and a Time of 16:00? | SELECT score FROM table_name_9 WHERE set_2 = "25–17" AND time = "16:00" |
List out the full name and URL link of ICCI? | SELECT FullName, HomePage FROM Conference WHERE ShortName = 'ICCI' |
How many race 3 winners were there when Mitch Evans won race 2? | SELECT COUNT(race_3_winner) FROM table_22905641_2 WHERE race_2_winner = "Mitch Evans" |
List all countries of markets in descending order of number of cities. | SELECT Country FROM market ORDER BY Number_cities DESC |
Which distinct car models are the produced after 1980? | SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model = T2.model JOIN CARS_DATA AS T3 ON T2.MakeId = T3.id WHERE T3.year > 1980; |
Provide the order comments for at least 5 orders made by customers in the furniture segment. | SELECT T1.o_comment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'Furniture' LIMIT 5 |
how many chroma format with name being high profile | SELECT COUNT(chroma_format) FROM table_1376890_2 WHERE name = "High profile" |
Indicate the name of the parts without discount. | SELECT T3.p_name FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T2.l_discount = 0.0000 |
What is that student's personal name? | select personal_name from Students where family_name = "Zieme" |
What is the date of the game where the line judge was Bob Beeks, the head linesman was Jerry Bergman, and Paul Baetz was the back judge? | SELECT date FROM table_name_61 WHERE line_judge = "bob beeks" AND head_linesman = "jerry bergman" AND back_judge = "paul baetz" |
How many tracks do we have? | SELECT COUNT(*) FROM track |
For each stadium, how many concerts play there? | SELECT T2.name , count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id |
How many of the complaints are longer than 15 minutes? | SELECT COUNT(ser_time) FROM callcenterlogs WHERE strftime('%M', ser_time) > '15' |
List the names of the directors whose films grossed over $100 million. | SELECT DISTINCT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name INNER JOIN movies_total_gross AS T3 ON T1.movie_title = T3.movie_title WHERE CAST(REPLACE(trim(T3.total_gross, '$'), ',', '') AS REAL) > 100000000 |
Which Province has a IATA of aku? | SELECT province FROM table_name_62 WHERE iata = "aku" |
List 5 customers in the West region who had their item shipped 'Second Class.' | SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' AND T1.`Ship Mode` = 'Second Class' LIMIT 5 |
Tell me the date for original week less than 16 and result of l 23–22 | SELECT date FROM table_name_81 WHERE original_week < 16 AND result = "l 23–22" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.