answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | What is the name of the customer who has the most orders? | CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) |
SELECT captain FROM table_18461635_1 WHERE location = "Southampton" | Who is the captain of the team in Southampton? | CREATE TABLE table_18461635_1 (
captain VARCHAR,
location VARCHAR
) |
SELECT actor_actress FROM table_18638067_1 WHERE film_title_used_in_nomination = "Mrs. Miniver" | In the film Mrs. Miniver, what is the actresses name? | CREATE TABLE table_18638067_1 (actor_actress VARCHAR, film_title_used_in_nomination VARCHAR) |
SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | What is the customer id of the customer who has the most orders? | CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR) |
SELECT "Director" FROM table_19324 WHERE "Original Air Date (ATV)" = '26 October 1969' | Who was the director of the episode originally aired on 26 October 1969? | CREATE TABLE table_19324 (
"Episode no." real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original Air Date (ATV)" text,
"Production no." real
) |
SELECT year__ceremony_ FROM table_18638067_1 WHERE actor_actress = "Teresa Wright" AND category = "Best Supporting Actress" | What year was Teresa Wright nominated best supporting actress? | CREATE TABLE table_18638067_1 (year__ceremony_ VARCHAR, actor_actress VARCHAR, category VARCHAR) |
SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | Give me a list of id and status of orders which belong to the customer named "Jeramie". | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE orders (order_id VARCHAR, order_status VARCHAR, customer_id VARCHAR) |
SELECT MIN(laps) FROM table_name_20 WHERE grid > 6 AND driver = "henri pescarolo" | What is the low lap total for henri pescarolo with a grad larger than 6? | CREATE TABLE table_name_20 (
laps INTEGER,
grid VARCHAR,
driver VARCHAR
) |
SELECT category FROM table_18638067_1 WHERE film_title_used_in_nomination = "Working Girl" | What category was the movie Working Girl nominated? | CREATE TABLE table_18638067_1 (category VARCHAR, film_title_used_in_nomination VARCHAR) |
SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | Find the dates of orders which belong to the customer named "Jeramie". | CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE orders (date_order_placed VARCHAR, customer_id VARCHAR) |
SELECT "Record" FROM table_21197 WHERE "High rebounds" = 'Gerald Wallace (14)' | What was the final score of the game with gerald wallace (14) as the High Rebound? | CREATE TABLE table_21197 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) |
SELECT actor_actress FROM table_18638067_1 WHERE film_title_used_in_nomination = "Going My Way" AND category = "Best Supporting Actor" | Who was nominated for best supporting actor in the movie Going My Way? | CREATE TABLE table_18638067_1 (actor_actress VARCHAR, film_title_used_in_nomination VARCHAR, category VARCHAR) |
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01" | Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01. | CREATE TABLE orders (customer_id VARCHAR, date_order_placed VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) |
SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'DANCE' AND course.number = 335 AND program_course.course_id = course.course_id AND program_course.workload > 3 | Is DANCE 335 a hard course ? | CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
... |
SELECT series__number FROM table_18646432_1 WHERE original_air_date = "November 11, 1996" | Name the series number that aired on november 11, 1996 | CREATE TABLE table_18646432_1 (series__number VARCHAR, original_air_date VARCHAR) |
SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= "1975-01-01" AND T1.date_order_placed <= "1976-01-01" | Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01? | CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) |
SELECT "Weight" FROM table_24924 WHERE "Name" = 'Stuart Craig' | What is the weight is the name is Stuart Craig? | CREATE TABLE table_24924 (
"Name" text,
"Position" text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Home Team" text
) |
SELECT written_by FROM table_18646432_4 WHERE original_air_date = "September 29, 1999" | Who wrote the episode originally aired on September 29, 1999? | CREATE TABLE table_18646432_4 (written_by VARCHAR, original_air_date VARCHAR) |
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped" | Find the names of the customers who have order status both "On Road" and "Shipped". | CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) |
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, I want to sort by the the average of code in desc. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) |
SELECT title FROM table_18646432_4 WHERE original_air_date = "September 29, 1999" | What is the name of the episode originally aired on September 29, 1999? | CREATE TABLE table_18646432_4 (title VARCHAR, original_air_date VARCHAR) |
SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped" | Find the id of the customers who have order status both "On Road" and "Shipped". | CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR) |
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday. | CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... |
SELECT horizontal_bar FROM table_18662026_1 WHERE rings = "58.975" | If the rings is 58.975, what is the number for the horizontal bar? | CREATE TABLE table_18662026_1 (horizontal_bar VARCHAR, rings VARCHAR) |
SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452 | When was the order placed whose shipment tracking number is 3452? Give me the date. | CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR); CREATE TABLE orders (date_order_placed VARCHAR, order_id VARCHAR) |
SELECT result FROM table_name_3 WHERE film_title_used_in_nomination = "firedancer" | WHAT IS THE RESULT WITH A FILM TITLE FIREDANCER? | CREATE TABLE table_name_3 (
result VARCHAR,
film_title_used_in_nomination VARCHAR
) |
SELECT COUNT(position) FROM table_18662026_1 WHERE country = "United States" | How many positions was the United States in? | CREATE TABLE table_18662026_1 (position VARCHAR, country VARCHAR) |
SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10 | What is the placement date of the order whose invoice number is 10? | CREATE TABLE orders (date_order_placed VARCHAR, order_id VARCHAR); CREATE TABLE shipments (order_id VARCHAR, invoice_number VARCHAR) |
SELECT MIN(demographic.age) FROM demographic WHERE demographic.language = "RUSS" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | what is minimum age of patients whose language is russ and primary disease is st elevated myocardial infarction\cardiac cath? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... |
SELECT parallel_bars FROM table_18662026_1 WHERE rings = "60.500" | If the rings are 60.500, what is the parallel bars number? | CREATE TABLE table_18662026_1 (parallel_bars VARCHAR, rings VARCHAR) |
SELECT COUNT(*), T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id | List the count and id of each product in all the orders. | CREATE TABLE orders (order_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE products (product_id VARCHAR) |
SELECT "Soccer" FROM table_44557 WHERE "School" = 'detroit' | Does Detroit have a soccer team? | CREATE TABLE table_44557 (
"School" text,
"Bask" text,
"Golf" text,
"Soccer" text,
"Soft" text,
"Swimming" text,
"Tennis" text,
"Indoor track" text,
"Volleyball" text
) |
SELECT COUNT(vault) FROM table_18662026_1 WHERE rings = "60.000" | If the rings number is 60.000, what is the number for the vault? | CREATE TABLE table_18662026_1 (vault VARCHAR, rings VARCHAR) |
SELECT T3.product_name, COUNT(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id | List the name and count of each product in all orders. | CREATE TABLE orders (order_id VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR) |
SELECT name FROM table_name_54 WHERE town_city = "anchorage" AND type = "multiple" | What is the Name of the Multiple Type museum in Anchorage? | CREATE TABLE table_name_54 (
name VARCHAR,
town_city VARCHAR,
type VARCHAR
) |
SELECT COUNT(floor) FROM table_18662026_1 WHERE parallel_bars = "61.500" | If the parallel bars numbers is 61.500, what is the total number for the flood? | CREATE TABLE table_18662026_1 (floor VARCHAR, parallel_bars VARCHAR) |
SELECT order_id FROM shipments WHERE shipment_date > "2000-01-01" | Find the ids of orders which are shipped after 2000-01-01. | CREATE TABLE shipments (order_id VARCHAR, shipment_date INTEGER) |
SELECT "total" FROM table_204_784 WHERE "player" = 'ismail isa' | how many goals did ismail isa score this season ? | CREATE TABLE table_204_784 (
id number,
"player" text,
"league" number,
"cup" number,
"europa league" number,
"total" number
) |
SELECT most_recent_date FROM table_18676973_3 WHERE country = "United Kingdom" | When united kingdom is the country what is the most recent date? | CREATE TABLE table_18676973_3 (most_recent_date VARCHAR, country VARCHAR) |
SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments) | Find the id of the order which is shipped most recently. | CREATE TABLE shipments (order_id VARCHAR, shipment_date INTEGER) |
SELECT "Character" FROM table_5918 WHERE "Italian voice actor" = 'emanuela damasio' | What character does Italian voice actor Emanuela Damasio play? | CREATE TABLE table_5918 (
"Character" text,
"French voice actor" text,
"Italian voice actor" text,
"German voice actor" text,
"Spanish voice actor" text
) |
SELECT MAX(combo) FROM table_18676973_3 WHERE rank = "3" | When 3 is the rank what is the highest combo? | CREATE TABLE table_18676973_3 (combo INTEGER, rank VARCHAR) |
SELECT DISTINCT product_name FROM products ORDER BY product_name | List the names of all distinct products in alphabetical order. | CREATE TABLE products (product_name VARCHAR) |
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17669')) AND vitalperiodic.heartrate < 116.0 AND NOT vitalperiod... | since 102 months ago patient 016-17669's heartrate was less than 116.0? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... |
SELECT most_recent_cyclist FROM table_18676973_3 WHERE rank = "12" | When 12 is the rank who is the most recent cyclist? | CREATE TABLE table_18676973_3 (most_recent_cyclist VARCHAR, rank VARCHAR) |
SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed | List the ids of all distinct orders ordered by placed date. | CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) |
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | until 2 years ago, what were the top five most frequent specimen tests ordered for patients during the same month after they were diagnosed with angio stm/dudn w hmrhg? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... |
SELECT MAX(different_holders) FROM table_18676973_3 WHERE jerseys = 155 | When 155 is the jersey what is the highest amount of different holders? | CREATE TABLE table_18676973_3 (different_holders INTEGER, jerseys VARCHAR) |
SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1 | What is the id of the order which has the most items? | CREATE TABLE orders (order_id VARCHAR); CREATE TABLE order_items (order_id VARCHAR) |
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17950' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | when's the last time that patient 010-17950 had a vasopressors - vasopressin in the last hospital visit? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... |
SELECT upper_index_kcal__nm_3 FROM table_1868929_1 WHERE lower_index_mj__nm_3 = "62.47" | Name the upper index kcal/nm3 for 62.47 | CREATE TABLE table_1868929_1 (upper_index_kcal__nm_3 VARCHAR, lower_index_mj__nm_3 VARCHAR) |
SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25" | Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25. | CREATE TABLE invoices (invoice_number VARCHAR, invoice_date VARCHAR) |
SELECT "Tries against" FROM table_59235 WHERE "Tries for" = '67' | How many tries against for the team with 67 tries for? | CREATE TABLE table_59235 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) |
SELECT fuel_gas FROM table_1868929_1 WHERE upper_index_mj__nm_3 = "92.32" | Name the fuel gas for upper index mj/nm3 for 92.32 | CREATE TABLE table_1868929_1 (fuel_gas VARCHAR, upper_index_mj__nm_3 VARCHAR) |
SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25" | Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25. | CREATE TABLE invoices (invoice_details VARCHAR, invoice_date VARCHAR) |
SELECT company_name FROM table_name_13 WHERE accreditation_level = "joyn hot fixes" AND accreditation_status = "approved (awarded 17.05.13)" | What is the Company Name, when the Accreditation Level is Joyn Hot Fixes, and when the Accreditation Status is Approved (Awarded 17.05.13)? | CREATE TABLE table_name_13 (
company_name VARCHAR,
accreditation_level VARCHAR,
accreditation_status VARCHAR
) |
SELECT lower_index_kcal__nm_3 FROM table_1868929_1 WHERE upper_index_mj__nm_3 = "61.32" | Name the lower index kcal/ nm3 for 61.32 | CREATE TABLE table_1868929_1 (lower_index_kcal__nm_3 VARCHAR, upper_index_mj__nm_3 VARCHAR) |
SELECT T2.customer_name, COUNT(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) >= 2 | For each customer who has at least two orders, find the customer name and number of orders made. | CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) |
SELECT country_of_origin FROM table_name_27 WHERE year_of_intro > 1985 AND primary_cartridge = "125mm" | What is Country of Origin, when Year of Intro is greater than 1985, and when Primary Cartridge is 125mm? | CREATE TABLE table_name_27 (
country_of_origin VARCHAR,
year_of_intro VARCHAR,
primary_cartridge VARCHAR
) |
SELECT qb_rating FROM table_18686317_1 WHERE comp__percentage = "62.0" | What is the Quarterback rating of the player who got a comp percentage of 62.0? | CREATE TABLE table_18686317_1 (qb_rating VARCHAR, comp__percentage VARCHAR) |
SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2 | Find the name of the customers who have at most two orders. | CREATE TABLE orders (customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) |
SELECT demographic.gender, demographic.admission_location FROM demographic WHERE demographic.name = "Jane Dillard" | let me know the location of admission and gender of patient jane dillard. | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... |
SELECT rank FROM table_18686317_1 WHERE yardage = 58179 | What is the rank of the player who got 58179 in yardage? | CREATE TABLE table_18686317_1 (rank VARCHAR, yardage VARCHAR) |
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = "food" GROUP BY T1.customer_id HAVING COUNT(*) >= 1 | List the names of the customers who have once bought product "food". | CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR) |
SELECT "date" FROM table_204_130 WHERE id = (SELECT id FROM table_204_130 WHERE "date" = '19 october 2013') - 1 | what is the date above 19 october 2013 ? | CREATE TABLE table_204_130 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) |
SELECT leagues FROM table_18686317_1 WHERE comp__percentage = "54.0" | In which league would you find the player with a comp percentage of 54.0? | CREATE TABLE table_18686317_1 (leagues VARCHAR, comp__percentage VARCHAR) |
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = "Cancel" AND T4.product_name = "food" GROUP BY T1.customer_id HAVING COUNT(*) >= 1 | List the names of customers who have once canceled the purchase of the product "food" (the item status is "Cancel"). | CREATE TABLE orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_item_status VARCHAR, order_id VARCHAR) |
SELECT COUNT(regular_season) FROM table_2361788_1 WHERE year = 2007 | Name the number of regular season for 2007 | CREATE TABLE table_2361788_1 (
regular_season VARCHAR,
year VARCHAR
) |
SELECT nation FROM table_18666752_3 WHERE rider = "Phillip Dutton" | Which nation is where rider phillip dutton from? | CREATE TABLE table_18666752_3 (nation VARCHAR, rider VARCHAR) |
SELECT COUNT(*) FROM architect WHERE gender = 'female' | How many architects are female? | CREATE TABLE architect (gender VARCHAR) |
SELECT AVG(rank) FROM table_name_31 WHERE date = "2007-06-21" AND mark < 91.29 | What is the average rank of the record on 2007-06-21 with a mark less than 91.29? | CREATE TABLE table_name_31 (
rank INTEGER,
date VARCHAR,
mark VARCHAR
) |
SELECT nation FROM table_18666752_3 WHERE horse = "Parkmore Ed" | Which nation is where the horse parkmore ed is? | CREATE TABLE table_18666752_3 (nation VARCHAR, horse VARCHAR) |
SELECT name, nationality, id FROM architect WHERE gender = 'male' ORDER BY name | List the name, nationality and id of all male architects ordered by their names lexicographically. | CREATE TABLE architect (name VARCHAR, nationality VARCHAR, id VARCHAR, gender VARCHAR) |
SELECT MIN(mass__m___) FROM table_10432351_1 WHERE radius__r___ = 10 | If a radius is 10, what is the lowest possible mass? | CREATE TABLE table_10432351_1 (
mass__m___ INTEGER,
radius__r___ VARCHAR
) |
SELECT total_team_penalties FROM table_18666752_3 WHERE cross_country_penalties = "30.40" | How many total team penalties are there when cross country penalties is 30.40? | CREATE TABLE table_18666752_3 (total_team_penalties VARCHAR, cross_country_penalties VARCHAR) |
SELECT MAX(T1.length_meters), T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id | What is the maximum length in meters for the bridges and what are the architects' names? | CREATE TABLE architect (name VARCHAR, id VARCHAR); CREATE TABLE bridge (length_meters INTEGER, architect_id VARCHAR) |
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | among the patients diagnosed with accident in home, calculate the five year survival probability. | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
h... |
SELECT rider FROM table_18666752_3 WHERE horse = "Galan De Sauvagere" | Who is the rider where the horse is galan de sauvagere? | CREATE TABLE table_18666752_3 (rider VARCHAR, horse VARCHAR) |
SELECT AVG(length_feet) FROM bridge | What is the average length in feet of the bridges? | CREATE TABLE bridge (length_feet INTEGER) |
SELECT "2006" FROM table_33984 WHERE "2007" = 'a' | Which 2006 has a 2007 of A? | CREATE TABLE table_33984 (
"Tournament" text,
"2006" text,
"2007" text,
"2008-12" text,
"2013" text
) |
SELECT COUNT(total_penalties) FROM table_18666752_3 WHERE rider = "Eric Vigeanel" | How many penalties are there when Eric Vigeanel is the rider? | CREATE TABLE table_18666752_3 (total_penalties VARCHAR, rider VARCHAR) |
SELECT name, built_year FROM mill WHERE TYPE = 'Grondzeiler' | What are the names and year of construction for the mills of 'Grondzeiler' type? | CREATE TABLE mill (name VARCHAR, built_year VARCHAR, TYPE VARCHAR) |
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31229') | what was the cost to patient 011-31229's hospital stay? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... |
SELECT record_label FROM table_18710512_3 WHERE single = "I Can't Stay" | What record label corresponds to the single "I can't stay"? | CREATE TABLE table_18710512_3 (record_label VARCHAR, single VARCHAR) |
SELECT DISTINCT T1.name, T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id | What are the distinct names and nationalities of the architects who have ever built a mill? | CREATE TABLE mill (Id VARCHAR); CREATE TABLE architect (name VARCHAR, nationality VARCHAR, id VARCHAR) |
SELECT Users.AccountId AS Id, Users.Reputation AS rep, COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId GROUP BY Users.AccountId, Users.Reputation ORDER BY 'reputation' DESC LIMIT 38000 | Average reputation per post by user. | CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... |
SELECT format FROM table_18710512_3 WHERE other_details = "2000 copies" | What format for the release that had 2000 copies? | CREATE TABLE table_18710512_3 (format VARCHAR, other_details VARCHAR) |
SELECT name FROM mill WHERE LOCATION <> 'Donceel' | What are the names of the mills which are not located in 'Donceel'? | CREATE TABLE mill (name VARCHAR, LOCATION VARCHAR) |
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') | count the number of people who had been admitted until 1 year ago to hospital. | CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... |
SELECT single FROM table_18710512_3 WHERE date = 2008 AND other_details = "4000 copies" | What single(s) released in 2008 and had 4000 copies? | CREATE TABLE table_18710512_3 (single VARCHAR, date VARCHAR, other_details VARCHAR) |
SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian' | What are the distinct types of mills that are built by American or Canadian architects? | CREATE TABLE architect (Id VARCHAR); CREATE TABLE mill (type VARCHAR, architect_id VARCHAR) |
SELECT "player" FROM table_203_676 ORDER BY "pick #" DESC LIMIT 1 | who was the last pick in round four ? | CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
) |
SELECT other_details FROM table_18710512_3 WHERE single = "My Love Will Follow Me" | What were the "other details" (number released) for "is my love will follow me"? | CREATE TABLE table_18710512_3 (other_details VARCHAR, single VARCHAR) |
SELECT T1.id, T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) >= 3 | What are the ids and names of the architects who built at least 3 bridges ? | CREATE TABLE architect (id VARCHAR, name VARCHAR); CREATE TABLE bridge (architect_id VARCHAR) |
SELECT q.Id AS Id, q.Score AS Score, q.Id AS "post_link" FROM Posts AS q INNER JOIN PostHistory AS h ON q.Id = h.PostId WHERE h.PostHistoryTypeId = 10 AND h.Comment = '102' AND NOT q.ClosedDate IS NULL ORDER BY q.ViewCount DESC | What is off-topic in aviation?. | CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... |
SELECT date FROM table_18710512_3 WHERE single = "Moped Girls" | What year was "moped girls" released? | CREATE TABLE table_18710512_3 (date VARCHAR, single VARCHAR) |
SELECT T1.id, T1.name, T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1 | What is the id, name and nationality of the architect who built most mills? | CREATE TABLE architect (id VARCHAR, name VARCHAR, nationality VARCHAR); CREATE TABLE mill (architect_id VARCHAR) |
SELECT "Winner" FROM table_20457 WHERE "Match Date" = 'Nov 5, 1987' | Name the winner for date of nov 5, 1987 | CREATE TABLE table_20457 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
) |
SELECT MIN(losses) FROM table_18703133_1 WHERE points = 23 | Name the least amount of losses for 23 points | CREATE TABLE table_18703133_1 (losses INTEGER, points VARCHAR) |
SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 2 UNION SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 1 | What are the ids, names and genders of the architects who built two bridges or one mill? | CREATE TABLE mill (architect_id VARCHAR); CREATE TABLE architect (id VARCHAR, name VARCHAR, gender VARCHAR); CREATE TABLE bridge (architect_id VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.