answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT COUNT(*) FROM railway | How many railways are there? | CREATE TABLE railway (Id VARCHAR) |
SELECT date FROM table_17118657_10 WHERE high_assists = "Dupree (6)" | On which date is high assists Dupree (6)? | CREATE TABLE table_17118657_10 (
date VARCHAR,
high_assists VARCHAR
) |
SELECT written_by FROM table_17467578_1 WHERE us_viewers__million_ = "3.96" | Who wrote the episode "The Dream Lover", which was viewed by 3.96 million viewers? | CREATE TABLE table_17467578_1 (written_by VARCHAR, us_viewers__million_ VARCHAR) |
SELECT Builder FROM railway ORDER BY Builder | List the builders of railways in ascending alphabetical order. | CREATE TABLE railway (Builder VARCHAR) |
SELECT SUM(2006) FROM table_name_83 WHERE 2011 > 4113 AND 2008 < 7181 | What is the 2006 value with a 2011 value greater than 4113 and a 2008 value less than 7181? | CREATE TABLE table_name_83 (
Id VARCHAR
) |
SELECT COUNT(original_airdate) FROM table_17467578_1 WHERE episode__number = 8 | What is the original air date of episode 8? Answer: Dec. 21, 2006 | CREATE TABLE table_17467578_1 (original_airdate VARCHAR, episode__number VARCHAR) |
SELECT Wheels, LOCATION FROM railway | List the wheels and locations of the railways. | CREATE TABLE railway (Wheels VARCHAR, LOCATION VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "70" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | how many patients younger than 70 years have got the cerebrospinal fluid (csf) lab test done? | CREATE TABLE diagnoses (
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
)
C... |
SELECT written_by FROM table_17467578_1 WHERE us_viewers__million_ = "3.73" | Who wrote the episode "The Cold Turkey", which was viewed by 3.73 million viewers? | CREATE TABLE table_17467578_1 (written_by VARCHAR, us_viewers__million_ VARCHAR) |
SELECT MAX(LEVEL) FROM manager WHERE Country <> "Australia " | What is the maximum level of managers in countries that are not "Australia"? | CREATE TABLE manager (LEVEL INTEGER, Country VARCHAR) |
SELECT best_player FROM table_2527617_1 WHERE season = 1998 | Who is the best player in the 1998 season? | CREATE TABLE table_2527617_1 (
best_player VARCHAR,
season VARCHAR
) |
SELECT written_by FROM table_17467578_1 WHERE episode__number = 11 | Who wrote episode 11? | CREATE TABLE table_17467578_1 (written_by VARCHAR, episode__number VARCHAR) |
SELECT AVG(Age) FROM manager | What is the average age for all managers? | CREATE TABLE manager (Age INTEGER) |
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 84346 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... | how much patient 84346 has changed in urea nitrogen last measured on the last hospital visit compared to the first value measured on the last hospital visit? | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d... |
SELECT original_airdate FROM table_17467578_1 WHERE us_viewers__million_ = "3.73" | What was the original airdate of the episode "The Cold Turkey", which was viewed by 3.73 million viewers? | CREATE TABLE table_17467578_1 (original_airdate VARCHAR, us_viewers__million_ VARCHAR) |
SELECT Name FROM manager ORDER BY LEVEL | What are the names of managers in ascending order of level? | CREATE TABLE manager (Name VARCHAR, LEVEL VARCHAR) |
SELECT AVG(lower_index_kcal__nm_3) FROM table_name_5 WHERE lower_index_mj__nm_3 = 74.54 AND upper_index_kcal__nm_3 < 19 OFFSET 376 | What is the Lower index Kcal/ Nm 3 entry, for the row with entries of an Upper index Kcal/ Nm 3 smaller than 19,376, and a Lower index MJ/ Nm 3 of 74.54? | CREATE TABLE table_name_5 (
lower_index_kcal__nm_3 INTEGER,
lower_index_mj__nm_3 VARCHAR,
upper_index_kcal__nm_3 VARCHAR
) |
SELECT class FROM table_1745843_9 WHERE part_3 = "boten" | Name the class for boten | CREATE TABLE table_1745843_9 (class VARCHAR, part_3 VARCHAR) |
SELECT Name, Arrival FROM train | What are the names and arrival times of trains? | CREATE TABLE train (Name VARCHAR, Arrival VARCHAR) |
SELECT "Bats" FROM table_75276 WHERE "Surname" = 'baron' | Which player has a last name of baron? | CREATE TABLE table_75276 (
"Surname" text,
"First" text,
"D.O.B." text,
"Uni#" real,
"Bats" text,
"Throws" text,
"Position" text
) |
SELECT part_3 FROM table_1745843_9 WHERE part_1 = "treffen" | Name the part 3 for treffen | CREATE TABLE table_1745843_9 (part_3 VARCHAR, part_1 VARCHAR) |
SELECT Name FROM manager ORDER BY Age DESC LIMIT 1 | What is the name of the oldest manager? | CREATE TABLE manager (Name VARCHAR, Age VARCHAR) |
SELECT "Profit / (Loss) Before Tax (\u20acm)" FROM table_5848 WHERE "Revenue (\u20acm)" > '1,115.8' AND "Year Ended" = '31 december 2012' | What is the Profit / (Loss) Before Tax ( m) that has a Revenue ( m) larger than 1,115.8, and on 31 december 2012? | CREATE TABLE table_5848 (
"Year Ended" text,
"Passengers Flown" real,
"Passenger Load Factor (%)" real,
"Revenue (\u20acm)" real,
"Profit / (Loss) Before Tax (\u20acm)" text,
"Net Profit / (Loss) (\u20acm)" text
) |
SELECT part_1 FROM table_1745843_9 WHERE verb_meaning = "to give" | Name the part one for to give | CREATE TABLE table_1745843_9 (part_1 VARCHAR, verb_meaning VARCHAR) |
SELECT T2.Name, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID | Show the names of trains and locations of railways they are in. | CREATE TABLE railway (Location VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Name VARCHAR, Railway_ID VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "WARF25" | give me the number of patients whose admission type is elective and drug code is warf25? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... |
SELECT class FROM table_1745843_9 WHERE part_3 = "schliefen" | Name the class for schliefen | CREATE TABLE table_1745843_9 (class VARCHAR, part_3 VARCHAR) |
SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = "Andaman Exp" | Show the builder of railways associated with the trains named "Andaman Exp". | CREATE TABLE railway (Builder VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Railway_ID VARCHAR, Name VARCHAR) |
SELECT diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "83678" | what is the diagnosis short title and procedure short title of subject id 83678? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... |
SELECT verb_meaning FROM table_1745843_9 WHERE part_2 = "half drosch" | Name the verb meaning for half drosch | CREATE TABLE table_1745843_9 (verb_meaning VARCHAR, part_2 VARCHAR) |
SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1 | Show id and location of railways that are associated with more than one train. | CREATE TABLE railway (Location VARCHAR, Railway_ID VARCHAR); CREATE TABLE train (Railway_ID VARCHAR) |
SELECT SUM(draw) FROM table_name_18 WHERE artist = "wendy fierce" | How many draws feature artist wendy fierce? | CREATE TABLE table_name_18 (
draw INTEGER,
artist VARCHAR
) |
SELECT directed_by FROM table_17467447_1 WHERE production_code = "2T6267" | If the product code is 2t6267, who was the director? | CREATE TABLE table_17467447_1 (directed_by VARCHAR, production_code VARCHAR) |
SELECT T2.Railway_ID, T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1 | Show the id and builder of the railway that are associated with the most trains. | CREATE TABLE train (Railway_ID VARCHAR); CREATE TABLE railway (Builder VARCHAR, Railway_ID VARCHAR) |
SELECT "Home team score" FROM table_33684 WHERE "Away team" = 'carlton' | How many points did Carlton score? | CREATE TABLE table_33684 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) |
SELECT original_airdate FROM table_17467447_1 WHERE us_viewers__million_ = "5.50" | What is the air date when the U.S. viewers was 5.50 million? | CREATE TABLE table_17467447_1 (original_airdate VARCHAR, us_viewers__million_ VARCHAR) |
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder | Show different builders of railways, along with the corresponding number of railways using each builder. | CREATE TABLE railway (Builder VARCHAR) |
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-3 year') | how many patients had been discharged from the hospital since 3 years ago. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... |
SELECT written_by FROM table_17467447_1 WHERE production_code = "2T6268" | Who were the writers for production code 2t6268? | CREATE TABLE table_17467447_1 (written_by VARCHAR, production_code VARCHAR) |
SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1 | Show the most common builder of railways. | CREATE TABLE railway (Builder VARCHAR) |
SELECT MIN("Super League") FROM table_30280 WHERE "Champions League" = '0' | List the lowest super league for a 0 champion league. | CREATE TABLE table_30280 (
"Position" text,
"Number" real,
"Player" text,
"Super League" real,
"Champions League" real,
"Swiss Cup" real,
"Total" real
) |
SELECT COUNT(builder) FROM table_1748444_1 WHERE number = "96" | Name the number of builders for number 96 | CREATE TABLE table_1748444_1 (builder VARCHAR, number VARCHAR) |
SELECT LOCATION, COUNT(*) FROM railway GROUP BY LOCATION | Show different locations of railways along with the corresponding number of railways at each location. | CREATE TABLE railway (LOCATION VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Other Body Fluid" | Tell me the number of patients who had elective hospital admissions and other body fluid lab tests. | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... |
SELECT builder FROM table_1748444_1 WHERE date_built = "January 1910" | Name the builder for date built is january 1910 | CREATE TABLE table_1748444_1 (builder VARCHAR, date_built VARCHAR) |
SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1 | Show the locations that have more than one railways. | CREATE TABLE railway (LOCATION VARCHAR) |
SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7 | Return the unique name for stations that have ever had 7 bikes available. | CREATE TABLE status (
station_id VARCHAR,
bikes_available VARCHAR
)
CREATE TABLE station (
name VARCHAR,
id VARCHAR
) |
SELECT disposition FROM table_1748444_1 WHERE date_built = "March 1909" | Name the disposition for date built is march 1909 | CREATE TABLE table_1748444_1 (disposition VARCHAR, date_built VARCHAR) |
SELECT ObjectNumber FROM railway WHERE NOT Railway_ID IN (SELECT Railway_ID FROM train) | List the object number of railways that do not have any trains. | CREATE TABLE train (ObjectNumber VARCHAR, Railway_ID VARCHAR); CREATE TABLE railway (ObjectNumber VARCHAR, Railway_ID VARCHAR) |
SELECT wounded FROM table_name_79 WHERE complement = "83 off 9 men" | How many were Wounded while in a Unit with a Complement of 83 off 9 Men? | CREATE TABLE table_name_79 (
wounded VARCHAR,
complement VARCHAR
) |
SELECT title FROM table_17482534_1 WHERE no_in_series = "96" | What is the title of episode number 96 in the series? | CREATE TABLE table_17482534_1 (title VARCHAR, no_in_series VARCHAR) |
SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46 | Show the countries that have both managers of age above 50 and managers of age below 46. | CREATE TABLE manager (Country VARCHAR, Age INTEGER) |
SELECT season FROM table_name_38 WHERE league = "regionalliga süd" AND home = "1-0" AND away = "2-3" | What season has a regionalliga s d league, a 1-0 home, and an away of 2-3? | CREATE TABLE table_name_38 (
season VARCHAR,
away VARCHAR,
league VARCHAR,
home VARCHAR
) |
SELECT no_in_season FROM table_17482534_1 WHERE directed_by = "Gene Stupnitsky" | What number in season is the episode directed by Gene Stupnitsky? | CREATE TABLE table_17482534_1 (no_in_season VARCHAR, directed_by VARCHAR) |
SELECT DISTINCT Country FROM manager | Show the distinct countries of managers. | CREATE TABLE manager (Country VARCHAR) |
SELECT h.UserId AS "user_link", SUM(CASE WHEN PostHistoryTypeId = 6 THEN 1 ELSE 0 END) AS "retags", SUM(CASE WHEN PostHistoryTypeId = 5 THEN 1 ELSE 0 END) AS "body_edits", SUM(CASE WHEN PostHistoryTypeId = 4 THEN 1 ELSE 0 END) AS "title_edits", COUNT(DISTINCT h.CreationDate) AS "total_edits", COUNT(DISTINCT h.PostId) A... | Top editors with type breakdown. Does not count edits to one's own posts.
Does not count rollbacks.
Does not count edits to community wiki posts after they were made CW. | CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... |
SELECT us_viewers__millions_ FROM table_17482534_1 WHERE written_by = "Warren Lieberstein & Halsted Sullivan" | How many viewers did the episode written by Warren Lieberstein & Halsted Sullivan have? | CREATE TABLE table_17482534_1 (us_viewers__millions_ VARCHAR, written_by VARCHAR) |
SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC | Show the working years of managers in descending order of their level. | CREATE TABLE manager (Working_year_starts VARCHAR, LEVEL VARCHAR) |
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | what is the top five most common procedures that followed within 2 months for patients who received ins nondrug elut cor st since 2105? | 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,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid numbe... |
SELECT COUNT(written_by) FROM table_17482534_1 WHERE production_code = "5008" | How many writers are listed for the episode with a production code of 5008? | CREATE TABLE table_17482534_1 (written_by VARCHAR, production_code VARCHAR) |
SELECT Country FROM manager WHERE Age > 50 OR Age < 46 | Show the countries that have managers of age above 50 or below 46. | CREATE TABLE manager (Country VARCHAR, Age VARCHAR) |
SELECT "FA Cup goals" FROM table_76538 WHERE "Euro competitions" = '1' AND "League goals" = '11' | What is FA Cup Goals, when Euro Competitions is 1, and when League Goals is 11? | CREATE TABLE table_76538 (
"Scorer" text,
"Club" text,
"League goals" text,
"FA Cup goals" text,
"League Cup goals" real,
"Texaco Cup goals" text,
"Euro competitions" text,
"Total" real
) |
SELECT no_in_series FROM table_17482534_1 WHERE production_code = "5016/5017" | What number in the series are the episodes with production code 5016/5017? | CREATE TABLE table_17482534_1 (no_in_series VARCHAR, production_code VARCHAR) |
SELECT COUNT(*) FROM addresses WHERE country = 'USA' | How many addresses are there in country USA? | CREATE TABLE addresses (country VARCHAR) |
SELECT "Name" FROM table_9768 WHERE "Position" = 'ot' AND "Round" = '27' | Which player had a position of OT during round 27? | CREATE TABLE table_9768 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) |
SELECT COUNT(location) FROM table_17487395_1 WHERE callsign = "DXJP-FM" | How many locations have the call signs dxjp-fm? | CREATE TABLE table_17487395_1 (location VARCHAR, callsign VARCHAR) |
SELECT DISTINCT city FROM addresses | Show all distinct cities in the address record. | CREATE TABLE addresses (city VARCHAR) |
SELECT SUM(premiere) FROM table_name_59 WHERE chinese_title = "野蠻奶奶大戰戈師奶" AND peak < 41 | What is the premiere rating for a Chinese title of , and a Peak smaller than 41? | CREATE TABLE table_name_59 (
premiere INTEGER,
chinese_title VARCHAR,
peak VARCHAR
) |
SELECT callsign FROM table_17487395_1 WHERE frequency = "90.3MHz" | What is the call sign of the station with the frequency of 90.3mhz | CREATE TABLE table_17487395_1 (callsign VARCHAR, frequency VARCHAR) |
SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county | Show each state and the number of addresses in each state. | CREATE TABLE addresses (state_province_county VARCHAR) |
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND lab.labname = 'cpk-mb index' AND STRFTIME('%y-%m', lab.labresultt... | what is the yearly average amount of cpk-mb index of patient 015-59552 since 01/2105? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... |
SELECT callsign FROM table_17487395_1 WHERE branding = "Mom's Radio 101.5 Tacloban" | What is the call sign for the station that uses the branding, mom's radio 101.5 tacloban? | CREATE TABLE table_17487395_1 (callsign VARCHAR, branding VARCHAR) |
SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_address_history) | Show names and phones of customers who do not have address information. | CREATE TABLE customer_address_history (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR) |
SELECT runner_up FROM table_name_81 WHERE winner = "ilhwa chunma" | Who is the runner-up for Ilhwa Chunma? | CREATE TABLE table_name_81 (
runner_up VARCHAR,
winner VARCHAR
) |
SELECT branding FROM table_17487395_1 WHERE location = "Cebu" | What is the branding for stations located in Cebu? | CREATE TABLE table_17487395_1 (branding VARCHAR, location VARCHAR) |
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | Show the name of the customer who has the most orders. | CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) |
SELECT location FROM table_name_89 WHERE record = "12-5" | Where was the location when the record was 12-5? | CREATE TABLE table_name_89 (
location VARCHAR,
record VARCHAR
) |
SELECT eagle_riders FROM table_17480471_3 WHERE ova__harmony_gold_dub_ = "Dr. Kozaburo Nambu" | Which eagle riders whose ova (harmony gold dub) is dr. kozaburo nambu? | CREATE TABLE table_17480471_3 (eagle_riders VARCHAR, ova__harmony_gold_dub_ VARCHAR) |
SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2 | Show the product type codes which have at least two products. | CREATE TABLE products (product_type_code VARCHAR) |
SELECT date FROM table_name_50 WHERE streak = "won 8" | What is the date when streak was won 8? | CREATE TABLE table_name_50 (
date VARCHAR,
streak VARCHAR
) |
SELECT battle_of_the_planets FROM table_17480471_3 WHERE ova__harmony_gold_dub_ = "Solaris" | Which battle of the planets where ova (harmony gold dub) is solaris? | CREATE TABLE table_17480471_3 (battle_of_the_planets VARCHAR, ova__harmony_gold_dub_ VARCHAR) |
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part' | Show the names of customers who have both an order in completed status and an order in part status. | CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR) |
SELECT score FROM table_name_59 WHERE runners_up = "tsv siegen" | What is the score when TSV Siegen was the runner-up? | CREATE TABLE table_name_59 (
score VARCHAR,
runners_up VARCHAR
) |
SELECT eagle_riders FROM table_17480471_3 WHERE battle_of_the_planets = "Zoltar" | Which eagle riders have battle of the planets as zoltar? | CREATE TABLE table_17480471_3 (eagle_riders VARCHAR, battle_of_the_planets VARCHAR) |
SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC | Show the name, phone, and payment method code for all customers in descending order of customer number. | CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, payment_method_code VARCHAR, customer_number VARCHAR) |
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND DAYS_1.day_name = ... | get SATURDAY fares from WASHINGTON to BOSTON | CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text... |
SELECT gatchaman FROM table_17480471_3 WHERE eagle_riders = "Lukan" | Which gatchaman has eagle riders as lukan? | CREATE TABLE table_17480471_3 (gatchaman VARCHAR, eagle_riders VARCHAR) |
SELECT T1.product_name, SUM(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id | Show the product name and total order quantity for each product. | CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, product_id VARCHAR) |
SELECT name FROM table_name_67 WHERE position = "guard/forward" | Which player is in the position of Guard/Forward? | CREATE TABLE table_name_67 (
name VARCHAR,
position VARCHAR
) |
SELECT eagle_riders FROM table_17480471_3 WHERE ova__harmony_gold_dub_ = "Lord Zortek" | What eagle riders where ova (harmony gold dub) is lord zortek? | CREATE TABLE table_17480471_3 (eagle_riders VARCHAR, ova__harmony_gold_dub_ VARCHAR) |
SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products | Show the minimum, maximum, average price for all products. | CREATE TABLE products (product_price INTEGER) |
SELECT AVG(fall_07) FROM table_name_99 WHERE fall_09 < 296 | What was the average value for Fall 07 when Fall 09 is less than 296? | CREATE TABLE table_name_99 (
fall_07 INTEGER,
fall_09 INTEGER
) |
SELECT pregame_host FROM table_17516922_1 WHERE network = "ESPN" AND color_commentator = "Taylor Twellman" | What pregame host was on espn and had taylor twellman color commentating? | CREATE TABLE table_17516922_1 (pregame_host VARCHAR, network VARCHAR, color_commentator VARCHAR) |
SELECT COUNT(*) FROM products WHERE product_price > (SELECT AVG(product_price) FROM products) | How many products have a price higher than the average? | CREATE TABLE products (product_price INTEGER) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | what is the number of patients whose admission location is clinic referral/premature and primary disease is aortic valve insuffiency\aortic valve replacement /sda? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... |
SELECT pregame_analysts FROM table_17516922_1 WHERE sideline_reporters = "Rob Stone and Monica Gonzalez" AND network = "TSN2" | What pregame analyst(s) had rob stone and monica gonzalez as sideline reporters and were on tsn2? | CREATE TABLE table_17516922_1 (pregame_analysts VARCHAR, sideline_reporters VARCHAR, network VARCHAR) |
SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id | Show the customer name, customer address city, date from, and date to for each customer address history. | CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_address_history (date_from VARCHAR, date_to VARCHAR, customer_id VARCHAR, address_id VARCHAR) |
SELECT COUNT(gold_medals) FROM table_name_43 WHERE total_medals < 1 | How many gold medals for the school with less than 1 total? | CREATE TABLE table_name_43 (
gold_medals VARCHAR,
total_medals INTEGER
) |
SELECT color_commentator FROM table_17516922_1 WHERE year = 2010 | What color commentator(s) were in 2010? | CREATE TABLE table_17516922_1 (color_commentator VARCHAR, year VARCHAR) |
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2 | Show the names of customers who use Credit Card payment method and have more than 2 orders. | CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR, payment_method_code VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.