answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT lost FROM table_17941032_1 WHERE tries_for = "55"
When 55 is the tries for what is the lost?
CREATE TABLE table_17941032_1 (lost VARCHAR, tries_for VARCHAR)
SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser"
Which contact channel has been used by the customer with name "Tillman Ernser"?
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (customer_id VARCHAR)
SELECT week_12_nov_16 FROM table_name_6 WHERE week_3_sept_14 = "south florida (3-0)"
What is the week 12 opponent for the year that had a week 3 opponent of South Florida (3-0)?
CREATE TABLE table_name_6 ( week_12_nov_16 VARCHAR, week_3_sept_14 VARCHAR )
SELECT points_against FROM table_17941032_1 WHERE tries_for = "17"
When 17 is the tries for what is the points against?
CREATE TABLE table_17941032_1 (points_against VARCHAR, tries_for VARCHAR)
SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser"
What is the "active to date" of the latest contact channel used by "Tillman Ernser"?
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (active_to_date INTEGER, customer_id VARCHAR)
SELECT surface FROM table_22834834_3 WHERE score_in_the_final = "6–1, 6–7 (2–7) , 7–6 (7–5) , 7–6 (10–8)"
Which surfaces have the final score of 6 1, 6 7 (2 7) , 7 6 (7 5) , 7 6 (10 8)?
CREATE TABLE table_22834834_3 ( surface VARCHAR, score_in_the_final VARCHAR )
SELECT drawn FROM table_17941032_2 WHERE "played" = "played"
How many draws were there in played games?
CREATE TABLE table_17941032_2 (drawn VARCHAR)
SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels
What is the average time span of contact channels in the database?
CREATE TABLE customer_contact_channels (active_to_date VARCHAR, active_from_date VARCHAR)
SELECT boxscore FROM table_name_32 WHERE attendance = "54,773"
Which box score has an Attendance of 54,773?
CREATE TABLE table_name_32 ( boxscore VARCHAR, attendance VARCHAR )
SELECT club FROM table_17941032_2 WHERE drawn = "1" AND won = "2"
Which club had 2 wins and 1 draw?
CREATE TABLE table_17941032_2 (club VARCHAR, drawn VARCHAR, won VARCHAR)
SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
What is the channel code and contact number of the customer contact channel that was active for the longest time?
CREATE TABLE customer_contact_channels (channel_code VARCHAR, contact_number VARCHAR, active_to_date VARCHAR, active_from_date VARCHAR)
SELECT COUNT(running) FROM table_12407546_2 WHERE athlete = "Pamela Zapata"
What is the numberof running wiht pamela zapata?
CREATE TABLE table_12407546_2 ( running VARCHAR, athlete VARCHAR )
SELECT played FROM table_17941032_2 WHERE tries_for = "56"
How many times were there plays with a try of 56?
CREATE TABLE table_17941032_2 (played VARCHAR, tries_for VARCHAR)
SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'
Find the name and active date of the customer that use email as the contact channel.
CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_contact_channels (active_from_date VARCHAR, customer_id VARCHAR, channel_code VARCHAR)
SELECT holmenkollen FROM table_name_22 WHERE country = "norway" AND winner = "tom sandberg"
Which Holmenkollen has a Country of norway, and a Winner of tom sandberg?
CREATE TABLE table_name_22 ( holmenkollen VARCHAR, country VARCHAR, winner VARCHAR )
SELECT tries_against FROM table_17941032_2 WHERE points_for = "150"
How many tries against were there with points of 150?
CREATE TABLE table_17941032_2 (tries_against VARCHAR, points_for VARCHAR)
SELECT t1.customer_name 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 t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)
What is the name of the customer that made the order with the largest quantity?
CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (order_quantity INTEGER); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
SELECT AVG("Administrative Panel") FROM table_7115 WHERE "Agricultural Panel" < '11' AND "Industrial and Commercial Panel" = '3' AND "Labour Panel" < '4'
How many are on the administrative panel with an agricultural panel of fewer than 11 and an industrial and commercial panel of 3, with fewer than 4 on the labor panel?
CREATE TABLE table_7115 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, ...
SELECT losing_bonus FROM table_17941032_2 WHERE points = "53"
What was the losing bonus that had 53 points?
CREATE TABLE table_17941032_2 (losing_bonus VARCHAR, points VARCHAR)
SELECT t1.customer_name 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 GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1
What is the name of the customer that has purchased the most items?
CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
SELECT "Result" FROM table_68960 WHERE "Episode" = 'top 8'
What was the result of the singer with the top 8?
CREATE TABLE table_68960 ( "Episode" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
SELECT points_against FROM table_17941032_2 WHERE try_bonus = "0" AND points_for = "150"
List all points against with a 0 try bonus and points for of 150.
CREATE TABLE table_17941032_2 (points_against VARCHAR, try_bonus VARCHAR, points_for VARCHAR)
SELECT t1.payment_method 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 GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) LIMIT 1
What is the payment method of the customer that has purchased the least quantity of items?
CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (payment_method VARCHAR, customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
SELECT Date, SUM(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY SUM(Price) DESC
For each record in schedule, show sum of price for each day in a bar chart, and could you list y-axis in desc order?
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT tries_against FROM table_17941032_3 WHERE tries_for = "30"
Name the tries against when tries for is 30
CREATE TABLE table_17941032_3 (tries_against VARCHAR, tries_for VARCHAR)
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"
How many types of products have Rodrick Heaney bought in total?
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1800 AND flight.departure_time >= 1400) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight...
display flights from DALLAS to ATLANTA which depart between 1400 and 1800
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fligh...
SELECT points FROM table_17941032_3 WHERE tries_for = "49"
Name the points when tries for is 49
CREATE TABLE table_17941032_3 (points VARCHAR, tries_for VARCHAR)
SELECT SUM(t3.order_quantity) 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"
What is the total quantity of products purchased by "Rodrick Heaney"?
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
SELECT name FROM table_name_3 WHERE total = "116 (22)"
Which player had a total of 116 (22)?
CREATE TABLE table_name_3 ( name VARCHAR, total VARCHAR )
SELECT try_bonus FROM table_17941032_3 WHERE lost = "11" AND losing_bonus = "6"
Name the try bonus for lost being 11 and losing bonus is 6
CREATE TABLE table_17941032_3 (try_bonus VARCHAR, lost VARCHAR, losing_bonus VARCHAR)
SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = "Cancelled"
How many customers have at least one order with status "Cancelled"?
CREATE TABLE customer_orders (customer_id VARCHAR, order_status VARCHAR)
SELECT COUNT("Points") FROM table_79265 WHERE "Constructor" = 'citroën total world rally team' AND "Wins" < '7'
what is the total number of points when the constructor is citro n total world rally team and the wins is less than 7?
CREATE TABLE table_79265 ( "Constructor" text, "Chassis" text, "Starts" real, "Finishes" real, "Wins" real, "Podiums" real, "Stage wins" real, "Points" real )
SELECT 1 AS st_leg FROM table_17968229_1 WHERE home__2nd_leg_ = "River Plate"
For home of River Plate, what is the first leg listed?
CREATE TABLE table_17968229_1 (home__2nd_leg_ VARCHAR)
SELECT COUNT(*) FROM customer_orders WHERE order_details = "Second time"
How many orders have detail "Second time"?
CREATE TABLE customer_orders (order_details VARCHAR)
SELECT MIN(wins) FROM table_name_15 WHERE byes < 2
What is the lowest wins with less than 2 Byes?
CREATE TABLE table_name_15 ( wins INTEGER, byes INTEGER )
SELECT home__2nd_leg_ FROM table_17968229_1 WHERE aggregate = "0-2"
With an aggregate of 0-2, what is listed for home?
CREATE TABLE table_17968229_1 (home__2nd_leg_ VARCHAR, aggregate VARCHAR)
SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered"
Find the customer name and date of the orders that have the status "Delivered".
CREATE TABLE customer_orders (order_date VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)
SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY id DESC
Draw a bar chart for what are the different ids and names of the stations that have had more than 12 bikes available?, and I want to rank by the Y in desc please.
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, d...
SELECT 1 AS st_leg FROM table_17968229_1 WHERE home__2nd_leg_ = "Atlético Tucumán"
If the home is Atlético Tucumán, what is the name of the first leg?
CREATE TABLE table_17968229_1 (home__2nd_leg_ VARCHAR)
SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = "Cancelled"
What is the total number of products that are in orders with status "Cancelled"?
CREATE TABLE customer_orders (order_id VARCHAR, order_status VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR)
SELECT QuestionUpVotes = COUNT(*) * 5 FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND v.VoteTypeId = 2 AND p.OwnerUserId = '##UserId##'
Rep Earned after Change in the weight of Question Upvote. This is just an estimation and doesn't take rep cap into account.
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryT...
SELECT 1 AS st_leg FROM table_17968229_1 WHERE home__2nd_leg_ = "Newell's Old Boys"
If second leg is Newell's Old Boys, what name is first leg?
CREATE TABLE table_17968229_1 (home__2nd_leg_ VARCHAR)
SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < "2018-03-17 07:13:53"
Find the total amount of products ordered before 2018-03-17 07:13:53.
CREATE TABLE customer_orders (order_id VARCHAR, order_date INTEGER); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "8847"
provide the number of patients whose insurance is private and procedure icd9 code is 8847?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT chinese_name FROM table_17964087_2 WHERE romanised_name = "Chan Chi-yuen, Paul"
What is the chinese name for whom chan chi-yuen, paul is listed as the romanised name?
CREATE TABLE table_17964087_2 (chinese_name VARCHAR, romanised_name VARCHAR)
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1
Who made the latest order?
CREATE TABLE customer_orders (customer_id VARCHAR, order_date VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)
SELECT Id AS "post_link", Title, Tags AS NotTags FROM Posts WHERE (Tags LIKE '%<dhtml>%') AND NOT (Tags LIKE '%<html>%') AND NOT (Tags LIKE '%<javascript>%') AND NOT (Tags LIKE '%<css>%')
DHTML Questions not tagged HTML, Javascript or CSS:.
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT foreign_nationality FROM table_17964087_2 WHERE romanised_name = "Cheung, Raymond Man-to"
The name cheung, raymond man-to is listed as a romanised name is cheung, raymond man-to?
CREATE TABLE table_17964087_2 (foreign_nationality VARCHAR, romanised_name VARCHAR)
SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1
Which product has been ordered most number of times?
CREATE TABLE products (product_details VARCHAR, product_id VARCHAR); CREATE TABLE order_items (product_id VARCHAR)
SELECT "Pens" FROM table_52574 WHERE "Tries" = '1' AND "Player" = 'matt alexander' AND "Conv" = '4'
Which pens has 1 tries and matt alexander as a player with conv of 4?
CREATE TABLE table_52574 ( "Player" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Venue" text, "Date" text )
SELECT COUNT(govt_salary) FROM table_17964087_2 WHERE chinese_name = "盧奕基"
For the chinese name 盧奕基 how many in total is the govt salary?
CREATE TABLE table_17964087_2 (govt_salary VARCHAR, chinese_name VARCHAR)
SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1
Find the name and ID of the product whose total order quantity is the largest.
CREATE TABLE order_items (product_id VARCHAR, order_quantity INTEGER); CREATE TABLE products (product_details VARCHAR, product_id VARCHAR)
SELECT COUNT(*) AS Volume, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE (Tags LIKE '%<surface%') AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO_STR(P.CreationDate, '%YEAR'), TIME_TO_STR(P.CreationDate, '%-mONT%-H...
SQL Server related thread volume by month.
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( ...
SELECT COUNT(foreign_nationality) FROM table_17964087_2 WHERE romanised_name = "Lo Yik-kee, Victor"
For the name romanised name is lo yik-kee, victor what is the total number foreign nationality that is listed?
CREATE TABLE table_17964087_2 (foreign_nationality VARCHAR, romanised_name VARCHAR)
SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona"
Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
CREATE TABLE addresses (address_content VARCHAR, city VARCHAR, state_province_county VARCHAR)
SELECT "No. in season" FROM table_22970 WHERE "Original air date" = 'October 14, 2008'
What's the season number of the episode originally aired on October 14, 2008?
CREATE TABLE table_22970 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
SELECT romanised_name FROM table_17964087_2 WHERE prior_occupation = "Assistant Police Commissioner (ret'd)"
For the prior occupation listed as assistant police commissioner (ret'd) what are the entire list of romanised name.
CREATE TABLE table_17964087_2 (romanised_name VARCHAR, prior_occupation VARCHAR)
SELECT customer_name FROM customers WHERE payment_method <> 'Cash'
Find the name of customers who did not pay with Cash.
CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR)
SELECT no9 FROM table_name_96 WHERE no7 = "joana" AND final = "pedro"
Who was number 9 that had a number 7 of Joana and a Final of Pedro?
CREATE TABLE table_name_96 ( no9 VARCHAR, no7 VARCHAR, final VARCHAR )
SELECT MAX(played) FROM table_17968282_1 WHERE points = 105
Name the most played when points is 105
CREATE TABLE table_17968282_1 (played INTEGER, points VARCHAR)
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name 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 JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'
Find the names of customers who never ordered product Latte.
CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)
SELECT score FROM table_name_57 WHERE home_team = "burnley"
What is the Score of the Burnley Home game?
CREATE TABLE table_name_57 ( score VARCHAR, home_team VARCHAR )
SELECT COUNT(points) FROM table_17968282_1 WHERE team = "Newell's Old Boys"
Name the total number of points for newell's old boys
CREATE TABLE table_17968282_1 (points VARCHAR, team VARCHAR)
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id
Find the names of customers who never placed an order.
CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)
SELECT COUNT(grand_prix) FROM table_1139087_2 WHERE constructor = "McLaren - Honda" AND fastest_lap = "Nigel Mansell"
How many events did nigel mansell drive the fastest and a mclaren - honda win?
CREATE TABLE table_1139087_2 ( grand_prix VARCHAR, constructor VARCHAR, fastest_lap VARCHAR )
SELECT home__1st_leg_ FROM table_17968233_2 WHERE aggregate = "3-4"
If the aggregate is 3-4, what is the first leg?
CREATE TABLE table_17968233_2 (home__1st_leg_ VARCHAR, aggregate VARCHAR)
SELECT t1.customer_name 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 JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orde...
Find the names of customers who ordered both products Latte and Americano.
CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
SELECT director FROM table_name_93 WHERE release_date = "2004-03-31" AND characters = "daffy (as duck dodgers)"
What director has 2004-03-31 as the release date, with daffy (as duck dodgers) as the character?
CREATE TABLE table_name_93 ( director VARCHAR, release_date VARCHAR, characters VARCHAR )
SELECT COUNT(aggregate) FROM table_17968233_2 WHERE home__2nd_leg_ = "Instituto"
If the second leg is Instituto, what is the total number of aggregate?
CREATE TABLE table_17968233_2 (aggregate VARCHAR, home__2nd_leg_ VARCHAR)
SELECT Age FROM artist
List the age of all music artists.
CREATE TABLE artist (Age VARCHAR)
SELECT MAX(crowd) FROM table_16387653_1 WHERE away_team = "St Kilda"
What was the maximum crowd size against St Kilda?
CREATE TABLE table_16387653_1 ( crowd INTEGER, away_team VARCHAR )
SELECT 1989 AS _90 FROM table_17968274_2 WHERE team = "Vélez Sársfield"
How many games were played by the Vélez Sársfield team from 1989-90?
CREATE TABLE table_17968274_2 (team VARCHAR)
SELECT AVG(Age) FROM artist
What is the average age of all artists?
CREATE TABLE artist (Age INTEGER)
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LATIN' AND course.number = 802 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering....
Can you tell me the professor who is teaching LATIN 802 ?
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, ...
SELECT team FROM table_17968274_2 WHERE points = 122
What was the team that scored 122 points?
CREATE TABLE table_17968274_2 (team VARCHAR, points VARCHAR)
SELECT Famous_Title FROM artist WHERE Artist = "Triumfall"
What are the famous titles of the artist "Triumfall"?
CREATE TABLE artist (Famous_Title VARCHAR, Artist VARCHAR)
SELECT AVG(league_cup_goals) FROM table_name_78 WHERE position = "df" AND total_goals > 4
what is the average league cup goals when the position is df and total goals is more than 4?
CREATE TABLE table_name_78 ( league_cup_goals INTEGER, position VARCHAR, total_goals VARCHAR )
SELECT opponent FROM table_17972136_1 WHERE date = "October 4"
What is the opponent played on October 4?
CREATE TABLE table_17972136_1 (opponent VARCHAR, date VARCHAR)
SELECT DISTINCT (Famous_Release_date) FROM artist
What are the distinct Famous release dates?
CREATE TABLE artist (Famous_Release_date VARCHAR)
SELECT Service_Type_Description, COUNT(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_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description
What are the number of the descriptions of the service types with product price above 100?, order by the X-axis in ascending.
CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, ...
SELECT MIN(week) FROM table_17972136_1 WHERE game_site = "Riverfront Stadium"
Where is riverfront stadium the game site for the week?
CREATE TABLE table_17972136_1 (week INTEGER, game_site VARCHAR)
SELECT Date_of_ceremony, RESULT FROM music_festival
Return the dates of ceremony and the results of all music festivals
CREATE TABLE music_festival (Date_of_ceremony VARCHAR, RESULT VARCHAR)
SELECT player FROM table_name_18 WHERE jersey_number_s_ = "2"
Which player wears the number 2 on his jersey?
CREATE TABLE table_name_18 ( player VARCHAR, jersey_number_s_ VARCHAR )
SELECT MIN(_number_s_lake_and_gnis_query_link) FROM table_17978052_2 WHERE borough_or_census_area = "Valdez-Cordova (CA)"
How many number of lakes are there in the Valdez-Cordova (CA) area?
CREATE TABLE table_17978052_2 (_number_s_lake_and_gnis_query_link INTEGER, borough_or_census_area VARCHAR)
SELECT Category FROM music_festival WHERE RESULT = "Awarded"
What are the category of music festivals with result "Awarded"?
CREATE TABLE music_festival (Category VARCHAR, RESULT VARCHAR)
SELECT "dpi" FROM table_20792 WHERE "max page size" = '216mm x 355mm'
What is the dpi for the scanner with a max page size of 216mm x 355mm?
CREATE TABLE table_20792 ( "product" text, "dimensions (mm)" text, "dpi" real, "pages per minute (color)" real, "max page size" text, "interface" text )
SELECT comment FROM table_17978052_2 WHERE borough_or_census_area = "Denali"
What was the comment on the Denali area?
CREATE TABLE table_17978052_2 (comment VARCHAR, borough_or_census_area VARCHAR)
SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume
What are the maximum and minimum week on top of all volumes?
CREATE TABLE volume (Weeks_on_Top INTEGER)
SELECT "Date" FROM table_49863 WHERE "Away team" = 'perth wildcats'
On what date were Perth Wildcats the away team?
CREATE TABLE table_49863 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
SELECT MAX(_number_s_dam_and_gnis_query_link) FROM table_17978052_2 WHERE borough_or_census_area = "Lake and Peninsula"
How many dams are there in the Lake and Peninsula area?
CREATE TABLE table_17978052_2 (_number_s_dam_and_gnis_query_link INTEGER, borough_or_census_area VARCHAR)
SELECT Song FROM volume WHERE Weeks_on_Top > 1
What are the songs in volumes with more than 1 week on top?
CREATE TABLE volume (Song VARCHAR, Weeks_on_Top INTEGER)
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY Country_name DESC
Show the country names and the corresponding number of players Show bar chart, could you order in desc by the x axis?
CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, ...
SELECT MIN(_number_s_dam_and_gnis_query_link) FROM table_17978052_2 WHERE borough_or_census_area = "Nome (CA)"
How many dams are there in the Nome (CA) area?
CREATE TABLE table_17978052_2 (_number_s_dam_and_gnis_query_link INTEGER, borough_or_census_area VARCHAR)
SELECT Song FROM volume ORDER BY Song
Please list all songs in volumes in ascending alphabetical order.
CREATE TABLE volume (Song VARCHAR)
SELECT MAX(weeks_at__number1) FROM table_27441210_12 WHERE artist = "K.Maro"
How many weeks was K.Maro at #1?
CREATE TABLE table_27441210_12 ( weeks_at__number1 INTEGER, artist VARCHAR )
SELECT COUNT(comment) FROM table_17978052_2 WHERE borough_or_census_area = "Bethel (CA)"
How many comments are there in the Bethel (CA) Borough area?
CREATE TABLE table_17978052_2 (comment VARCHAR, borough_or_census_area VARCHAR)
SELECT COUNT(DISTINCT Artist_ID) FROM volume
How many distinct artists do the volumes associate to?
CREATE TABLE volume (Artist_ID VARCHAR)
SELECT "Producer/Director" FROM table_35328 WHERE "Film" = 'fear beneath'
Who was the Producer/Director of Fear Beneath?
CREATE TABLE table_35328 ( "Year" real, "Film" text, "Role" text, "Producer/Director" text, "Notes" text )
SELECT COUNT(attendance) FROM table_17972193_1 WHERE date = "October 27"
How many total numbers of attendance are there during the game in October 27?
CREATE TABLE table_17972193_1 (attendance VARCHAR, date VARCHAR)