sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What are the different customer ids, and how many cards does each one hold?
|
SELECT customer_id , count(*) FROM Customers_cards GROUP BY customer_id
|
State the player ID and coach ID of person who have become coach after retirement.
|
SELECT playerID, coachID FROM Master WHERE playerID IS NOT NULL AND coachID IS NOT NULL
|
What is the # when conroe, tx is the hometown?
|
SELECT MIN(_number) FROM table_22496344_1 WHERE home_town = "Conroe, TX"
|
What year had more than 2 goals and 11 (2) games?
|
SELECT years FROM table_name_36 WHERE goals > 2 AND games = "11 (2)"
|
On which dates did the episodes directed by TR Babu Subramaniam air?
|
SELECT original_air_date FROM table_17355820_1 WHERE directed_by = "TR Babu Subramaniam"
|
Which episode was N/A in region 1
|
SELECT episodes FROM table_15823956_1 WHERE region_1 = "N/A"
|
Which tournament was played on 12 February 2001?
|
SELECT tournament FROM table_name_21 WHERE date = "12 february 2001"
|
What are the distinct Famous release dates?
|
SELECT DISTINCT (Famous_Release_date) FROM artist
|
What are the names of all students who tried out in alphabetical order?
|
SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName
|
How many TFR were there in 2006 when the GFR was 53.8?
|
SELECT tfr_2006 FROM table_12251936_1 WHERE gfr_2006 = "53.8"
|
What division has finalist playoffs and was 3rd round Open Cup?
|
SELECT division FROM table_name_73 WHERE playoffs = "finalist" AND open_cup = "3rd round"
|
What is the description of the service type which offers both the photo product and the film product?
|
SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film'
|
Which Position has Goals against smaller than 43, and Wins larger than 14, and Played larger than 38?
|
SELECT SUM(position) FROM table_name_28 WHERE goals_against < 43 AND wins > 14 AND played > 38
|
What was the outcome of the match against Stacy Margolin?
|
SELECT outcome FROM table_name_79 WHERE opponent = "stacy margolin"
|
What is the total number for long when there are 19 attempts?
|
SELECT COUNT(long) FROM table_name_52 WHERE attempts = 19
|
Find the total revenue created by the companies whose headquarter is located at Austin.
|
SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin'
|
What is the Team in Game 38?
|
SELECT team FROM table_name_46 WHERE game = 38
|
What is the stadium for the city of Braga?
|
SELECT stadium FROM table_name_88 WHERE city = "braga"
|
What are the opening hours of the haunted mansion?
|
SELECT Opening_Hours FROM Tourist_Attractions where Name = "haunted mansion"
|
What operating system was needed for 2D games?
|
SELECT required_os FROM table_name_91 WHERE type = "2d"
|
Which venue was used on 12 September 1998?
|
SELECT venue FROM table_name_10 WHERE date = "12 september 1998"
|
What is the highest Money ( $ ), when To Par is less than 2?
|
SELECT MAX(money___) AS $__ FROM table_name_11 WHERE to_par < 2
|
What is Name (Birth-Death), when Left Office is 7 October 1958?
|
SELECT name__birth_death_ FROM table_name_79 WHERE left_office = "7 october 1958"
|
Find and list the id and geographic ID of the elderly customers with an education level below 3.
|
SELECT ID, GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND age > 65
|
Show all distinct template type codes for all templates.
|
SELECT DISTINCT template_type_code FROM Templates
|
What is the highest number of wins that has a top-25 of 13 and events less than 32?
|
SELECT MAX(wins) FROM table_name_76 WHERE top_25 = 13 AND events < 32
|
Who was the host team for the game on December 27?
|
SELECT host_team FROM table_name_55 WHERE date = "december 27"
|
What are the employee ids and job ids for employees who make less than the lowest earning employee with title MK_MAN?
|
SELECT employee_id , job_id FROM employees WHERE salary < ( SELECT min(salary) FROM employees WHERE job_id = 'MK_MAN' )
|
Which district has the least area?
|
SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1
|
Which professionals have done at least two treatments? List the professional's id, role, and first name.
|
SELECT T1.professional_id , T1.role_code , T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING count(*) >= 2
|
Show the premise type and address type code for all customer addresses.
|
SELECT T2.premises_type , T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id
|
What type of currency has a code of SEK?
|
SELECT currency FROM table_name_34 WHERE code = "sek"
|
What is the lowest crowd when essendon is the away team?
|
SELECT MIN(crowd) FROM table_name_78 WHERE away_team = "essendon"
|
What was the winning score of the Masters Tournament?
|
SELECT winning_score FROM table_13026799_1 WHERE championship = "Masters Tournament"
|
Who is the user who created the list titled 'Sound and Vision'? Was he a subcriber when he created the list?
|
SELECT T1.user_id, T1.user_subscriber FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Sound and Vision'
|
Show the distinct position of players from college UCLA or Duke.
|
SELECT DISTINCT POSITION FROM match_season WHERE College = "UCLA" OR College = "Duke"
|
What is the name of the home captain when the result was Aus by 32 runs?
|
SELECT home_captain FROM table_name_55 WHERE result = "aus by 32 runs"
|
Which country produced the car with the lowest mileage per gallon?
|
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg ASC LIMIT 1
|
What is the name of the department with the fewest professors?
|
SELECT T2.dept_name FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) LIMIT 1
|
Which friend of Zach has the longest-lasting friendship?
|
SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')
|
Name the most bits 14-12 for output from accumulator to character bus
|
SELECT MIN(bits_14_12) FROM table_14249278_1 WHERE description = "Output from accumulator to character bus"
|
What's about Captain Sir Henry Langford?
|
select rank from captain where name = "Captain Henry Dumaresq"
|
List the most common type of artworks.
|
SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
|
What is the total number on roll for Shelly Park school?
|
SELECT COUNT(roll) FROM table_name_7 WHERE name = "shelly park school"
|
On what date did Fantasy Records release a CD format of catalog FCD-4513-2?
|
SELECT date FROM table_name_54 WHERE label = "fantasy records" AND format = "cd" AND catalog = "fcd-4513-2"
|
Which leagues have Raiders as their mascot?
|
SELECT league FROM table_11044765_1 WHERE mascot = "Raiders"
|
What's the hometown of rachel muyot soriano?
|
SELECT hometown FROM table_name_67 WHERE delegate = "rachel muyot soriano"
|
What are the names of the sea that can be found on the island with the biggest area?
|
SELECT T2.Name FROM islandIn AS T1 INNER JOIN sea AS T2 ON T2.Name = T1.Sea WHERE T1.Island = ( SELECT Name FROM island ORDER BY Area DESC LIMIT 1 )
|
What are the names of the rivers in Canada?
|
SELECT DISTINCT T1.River FROM located AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Canada' AND T1.River IS NOT NULL
|
When Payne Stewart of the United States scored higher than 69, what was the To Par?
|
SELECT to_par FROM table_name_43 WHERE country = "united states" AND score > 69 AND player = "payne stewart"
|
What is the zip code of the address in the city Port Chelsea?
|
SELECT zip_postcode FROM Addresses WHERE city = 'Port Chelsea'
|
Hello! Can you show me a list of all company IDs, with their names and headquarters locations?
|
SELECT Company_ID,Name,Headquarters FROM company
|
How many users have more than 100 followers in the list created by users in 2009?
|
SELECT COUNT(T1.user_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers > 100 AND T1.list_creation_date_utc LIKE '2009%'
|
Find the first name of the band mate that has performed in most songs.
|
SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1
|
What is the largest gold with a Total of 2, and a Rank smaller than 2?
|
SELECT MAX(gold) FROM table_name_91 WHERE total = 2 AND rank < 2
|
Of the times the Broncos played the Cincinnati Bengals, what was the highest attendance?
|
SELECT MAX(attendance) FROM table_17294353_1 WHERE opponent = "Cincinnati Bengals"
|
display the employee id and salary of all employees who report to Payam (first name).
|
SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam')
|
Name the D 47 O with D 48 O of r 9
|
SELECT d_47_o FROM table_name_80 WHERE d_48_o = "r 9"
|
What is the user avatar url for user 41579158? What is the latest movie rated by him / her?
|
SELECT T3.user_avatar_image_url, T3.rating_date_utc FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T3.user_id = T2.user_id WHERE T3.user_id = 41579158 ORDER BY T3.rating_date_utc DESC LIMIT 1
|
What was the attendance when Hawthorn played as the away team?
|
SELECT AVG(crowd) FROM table_name_54 WHERE away_team = "hawthorn"
|
Which publisher published Overwatch?
|
SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = 'Overwatch'
|
What are the product names with average product price smaller than 1000000?
|
SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000
|
How many rooms whose capacity is less than 50 does the Lamberton building have?
|
SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
|
What is Authors, when Novelty is Gen Et Sp Nov, and when Name is Lanthanocephalus?
|
SELECT authors FROM table_name_13 WHERE novelty = "gen et sp nov" AND name = "lanthanocephalus"
|
What is the name of the subcategory to which the gray product with the lowest safety stock level belongs?
|
SELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN Product AS T2 USING (ProductSubcategoryID) WHERE T2.Color = 'Grey' GROUP BY T1.Name
|
How much in total has customer with first name as Carole and last name as Bernhard paid?
|
SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"
|
what is the first name and the last name of the customer who made the earliest rental ?
|
SELECT T1.first_name , T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
|
What is the score where Saint-Amant lost the match?
|
SELECT score FROM table_name_42 WHERE opponent = "saint-amant" AND result = "lost"
|
How many students does Ogdon Zywicki advise?
|
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
|
What's the Nordbayern with a Württemberg of Union Böckingen in the year before 1932?
|
SELECT nordbayern FROM table_name_92 WHERE year < 1932 AND württemberg = "union böckingen"
|
What is the value of Ends Lost when Blank Ends is 9.
|
SELECT Ends AS lost FROM table_1505809_2 WHERE blank_ends = 9
|
What is the outcome on June 9, 1997?
|
SELECT outcome FROM table_name_57 WHERE date = "june 9, 1997"
|
How many Yelp businesses are there in 'AZ' with less than "3" stars?
|
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars < 3
|
Name the manufacturer for cale yarborough for 1984
|
SELECT manufacturer FROM table_2266230_1 WHERE driver = "Cale Yarborough" AND year = "1984"
|
What is Date (Closing), when Year is greater than 2011?
|
SELECT date__closing_ FROM table_name_83 WHERE year > 2011
|
What is the score for set 3 with a time at 15:04?
|
SELECT set_3 FROM table_name_46 WHERE time = "15:04"
|
Which team had the highest number of attendance?
|
SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id group by T1.team_id ORDER BY sum ( T1.attendance ) desc limit 1
|
What is the name of the player who is a wr and has a weight of 197?
|
SELECT name FROM table_name_83 WHERE position = "wr" AND weight = 197
|
list all department code and department name
|
SELECT dept_code, dept_name FROM department
|
What song is later than place 2 and has a draw number of 1?
|
SELECT song FROM table_name_77 WHERE place > 2 AND draw = 1
|
List all the document names which contains "CV".
|
SELECT document_name FROM documents WHERE document_name LIKE "%CV%"
|
What are the id and details of the customers who have at least 3 events?
|
SELECT T1.customer_id, T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 3
|
What is the highest Attendance with a Result that is w 24-21?
|
SELECT MAX(attendance) FROM table_name_50 WHERE result = "w 24-21"
|
What are the total scores of the body builders whose birthday contains the string "January" ?
|
SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.Birth_Date LIKE "%January%";
|
What was the score on December 3 when Detroit was the home team and Legace took the decision?
|
SELECT score FROM table_name_52 WHERE home = "detroit" AND decision = "legace" AND date = "december 3"
|
Among the repository "3", how many methods whose comments is XML format?
|
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 3 AND T2.CommentIsXml = 1
|
List all the order numbers along with its product name for each order under the sales team of 'Douglas Tucker'.
|
SELECT DISTINCT T1.ProductID, T1.`Product Name` FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T3.`Sales Team` = 'Douglas Tucker'
|
What is the product description of the product booked with an amount of 102.76?
|
SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76
|
What is the name of the algorithm with a directed/undirected of both and a subgraph-centric basis?
|
SELECT name FROM table_name_12 WHERE directed___undirected = "both" AND basis = "subgraph-centric"
|
I want to know the store chains with the largest department stores
|
SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count ( * ) DESC LIMIT 1
|
How many times the number of adults and kids staying in a room reached the maximum capacity of the room?
|
SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids;
|
Show the names of the countries that have more than one roller coaster.
|
SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT ( * ) > 1
|
Wha is the rank for 52 574 avg. att?
|
SELECT rank FROM table_name_49 WHERE avgatt = "52 574"
|
Which player played 2004-05
|
SELECT player FROM table_11545282_18 WHERE years_for_jazz = "2004-05"
|
Show name, address road, and city for all branches sorted by open year.
|
SELECT name , address_road , city FROM branch ORDER BY open_year
|
find the names of programs whose origin is not in Beijing.
|
SELECT name FROM program WHERE origin != 'Beijing'
|
Calculate the average salary for employees who did inspection on License Re-Inspection.
|
SELECT AVG(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_type = 'License Re-Inspection'
|
What lane did the rank 3 swimmer use?
|
SELECT MAX(lane) FROM table_name_57 WHERE rank = 3
|
what was the score of the game at pro player stadium on june 14?
|
SELECT score FROM table_name_9 WHERE venue = "pro player stadium" AND date = "june 14"
|
What is the name of the product with the lowest quantity?
|
SELECT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.Quantity LIMIT 1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.