instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_40 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the crowd size of the match featuring North Melbourne as the away team?
| SELECT MIN(crowd) FROM table_name_40 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_... | 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, date_day, days, flight, state AS STATE_0, state AS STATE_1 WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time)... | atis |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '6929712' AND JZKSRQ BETWEEN '2014-03-17' AND '2014-10-14' AND TXBZ > 0 | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRG... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl... | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Obesity, unspecified" AND prescriptions.route = "PR" | mimicsql_data |
CREATE TABLE table_name_28 (
team VARCHAR,
recopa_sudamericana_1992 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team has a Recopa Sudamericana 1992 of runner-up?
| SELECT team FROM table_name_28 WHERE recopa_sudamericana_1992 = "runner-up" | sql_create_context |
CREATE TABLE table_19613 (
"Hand" text,
"1 credit" real,
"2 credits" real,
"3 credits" real,
"4 credits" real,
"5 credits" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the hand for 1 credit 200
| SELECT "Hand" FROM table_19613 WHERE "1 credit" = '200' | wikisql |
CREATE TABLE table_name_51 (
pick INTEGER,
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was chuck morris, back, drafted?
| SELECT MIN(pick) FROM table_name_51 WHERE position = "back" AND player = "chuck morris" | sql_create_context |
CREATE TABLE table_23281862_9 (
record VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record where aaron brooks (6) is high assists?
| SELECT record FROM table_23281862_9 WHERE high_assists = "Aaron Brooks (6)" | sql_create_context |
CREATE TABLE table_10104 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team at Essendon?... | SELECT "Away team score" FROM table_10104 WHERE "Away team" = 'essendon' | wikisql |
CREATE TABLE table_name_71 (
winner VARCHAR,
week_of VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winner in the week listed as 26 June 2 weeks, when the runner-up is Arantxa S nchez Vicario?
| SELECT winner FROM table_name_71 WHERE week_of = "26 june 2 weeks" AND runner_up = "arantxa sánchez vicario" | sql_create_context |
CREATE TABLE table_11857 (
"Client" text,
"Windows" text,
"GNU/Linux" text,
"Mac OS X" text,
"Haiku" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which client had no GNU/Linux?
| SELECT "Client" FROM table_11857 WHERE "GNU/Linux" = 'no' | wikisql |
CREATE TABLE table_name_89 (
grand_rapids__grr_ VARCHAR,
detroit__dtw_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the passenger fare for Grand Rapids, when the passenger fare for Detroit was $378.55?
| SELECT grand_rapids__grr_ FROM table_name_89 WHERE detroit__dtw_ = "$378.55" | sql_create_context |
CREATE TABLE table_name_4 (
density__hab__km²__ VARCHAR,
population_censo_2007_hab_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the density (hab/km ) with a population censo 2007(hab) of 336.293*?
| SELECT density__hab__km²__ FROM table_name_4 WHERE population_censo_2007_hab_ = "336.293*" | sql_create_context |
CREATE TABLE table_204_736 (
id number,
"party" text,
"candidate" text,
"votes" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which candidate of the citizens committee has the most votes ?
| SELECT "candidate" FROM table_204_736 WHERE "party" = "citizens' committee" ORDER BY "votes" DESC LIMIT 1 | squall |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) | nvbench |
CREATE TABLE table_4993 (
"Version" text,
"Length" text,
"Album" text,
"Remixed by" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Year that has an Album of Remixes?
| SELECT SUM("Year") FROM table_4993 WHERE "Album" = 'remixes' | wikisql |
CREATE TABLE table_70621 (
"Team" text,
"Truck(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text,
"Rounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most number of rounds that the Team... | SELECT MAX("Rounds") FROM table_70621 WHERE "Truck(s)" = 'chevrolet silverado' AND "Team" = 'rbr enterprises' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id num... | SELECT AVG(CAST(ROUND(Reputation, -FLOOR(LOG(10, Reputation))) AS INT)) AS UserReputation, AVG(CAST(Posts.Score AS FLOAT)) AS AverageAnswerScore FROM Posts INNER JOIN Users ON (Users.Id = Posts.OwnerUserId) WHERE PostTypeId = 2 AND Reputation < 10000 GROUP BY ROUND(Reputation, -FLOOR(LOG(10, Reputation))) ORDER BY User... | sede |
CREATE TABLE table_56593 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what average grid has laps larger than 52 and contains the driver of andrea de adamich?
| SELECT AVG("Grid") FROM table_56593 WHERE "Laps" > '52' AND "Driver" = 'andrea de adamich' | wikisql |
CREATE TABLE table_name_11 (
debut VARCHAR,
position VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round was the debut of defender Stephen Laybutt?
| SELECT debut FROM table_name_11 WHERE position = "defender" AND name = "stephen laybutt" | sql_create_context |
CREATE TABLE table_26493 (
"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
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Written by" FROM table_26493 WHERE "Directed by" = 'Shannon Flynn' | wikisql |
CREATE TABLE table_203_491 (
id number,
"year" number,
"title" text,
"us hot 100" number,
"us modern rock" number,
"us mainstream rock" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the only single from 2009 ?
| SELECT "title" FROM table_203_491 WHERE "year" = 2009 | squall |
CREATE TABLE table_33952 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Arkansas State's total pick number with an overal lower than 242?
| SELECT COUNT("Pick #") FROM table_33952 WHERE "College" = 'arkansas state' AND "Overall" < '242' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" | mimicsql_data |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_INV_ITEM_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '09967594504' AND SOC_SRT_DIRE_CD = '3338' | css |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60219)) AND STRFTIME('%y-%m-%d', outputeve... | mimic_iii |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJL... | css |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '创伤骨科' AND STA_DATE BETWEEN '2001-12-15' AND '2006-08-16' AND SOC_SRT_DIRE_CD = '4859' | css |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '55664' AND zyb.IN_HOSP_DAYS BETWEEN '2016-03-08' AND '2016-07-24' AND zyb.IN_HOSP_DATE = '糖尿病' | css |
CREATE TABLE table_16306 (
"Village (German)" text,
"Village (Slovenian)" text,
"Number of people 1991" real,
"Percent of Slovenes 1991" text,
"Percent of Slovenes 1951" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the slovenian names of ... | SELECT "Village (Slovenian)" FROM table_16306 WHERE "Percent of Slovenes 1951" = '65.9%' | wikisql |
CREATE TABLE table_12960 (
"Year" real,
"Delegate" text,
"Hometown" text,
"Placement in Miss World" text,
"Other awards" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the latest year with a hometown of san carlos, pangasinan?
| SELECT MAX("Year") FROM table_12960 WHERE "Hometown" = 'san carlos, pangasinan' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-60951')) AND NOT vitalperiodic.respiration IS NULL ... | eicu |
CREATE TABLE table_name_93 (
college VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which College has a Name of hardy brown?
| SELECT college FROM table_name_93 WHERE name = "hardy brown" | sql_create_context |
CREATE TABLE table_71333 (
"Country" text,
"Currency" text,
"1 Euro =" real,
"1 USD =" real,
"Central bank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1USD= that has the Uruguayan Peso (uyu) and 1 Euro is greater than 25.3797?
| SELECT SUM("1 USD =") FROM table_71333 WHERE "Currency" = 'uruguayan peso (uyu)' AND "1 Euro =" > '25.3797' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hepatic encephalopathy') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admis... | mimic_iii |
CREATE TABLE table_name_98 (
score VARCHAR,
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Country is 'United States', and when Player is 'Raymond Floyd'?
| SELECT score FROM table_name_98 WHERE country = "united states" AND player = "raymond floyd" | sql_create_context |
CREATE TABLE table_12551 (
"Position" real,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT MIN("Goals for") FROM table_12551 WHERE "Draws" < '4' AND "Points" < '27' | wikisql |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
P... | SELECT Took_office, COUNT(Took_office) FROM party ORDER BY COUNT(Took_office) DESC | nvbench |
CREATE TABLE table_55505 (
"PRR Class" text,
"Builder\u2019s Model" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Service" text,
"Power output" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who built the train i... | SELECT "Builder\u2019s Model" FROM table_55505 WHERE "Total produced" > '40' AND "Build date" = '1966' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE department (
dno number,
division text,
dname text,
room text,
building text,
dphone number
)
CREATE TABLE faculty (
... | SELECT fname FROM student ORDER BY age DESC | spider |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND diagnoses.long_title = "Poisoning by other opiates and related narcotics" | mimicsql_data |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE adm... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE i... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mechanical ventilation' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT patient.un... | eicu |
CREATE TABLE table_name_88 (
method VARCHAR,
round VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Round of 1, and a Record of 10 2 had what method?
| SELECT method FROM table_name_88 WHERE round = "1" AND record = "10–2" | sql_create_context |
CREATE TABLE table_53568 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score June 22?
| SELECT "Loss" FROM table_53568 WHERE "Date" = 'june 22' | wikisql |
CREATE TABLE table_203_639 (
id number,
"year" text,
"number" text,
"name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long was w.b. kingsmill club president ?
| SELECT "year" - "year" FROM table_203_639 WHERE "name" = 'w.b. kingsmill' | squall |
CREATE TABLE table_1199219_2 (
successor VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many successors were seated in the New York 20th district?
| SELECT COUNT(successor) FROM table_1199219_2 WHERE district = "New York 20th" | sql_create_context |
CREATE TABLE table_7336 (
"Tournament" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"Career SR" text,
"Career Win-Loss" text
)
-- Using valid... | SELECT "1997" FROM table_7336 WHERE "1987" = '2r' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Coun... | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality | nvbench |
CREATE TABLE table_name_48 (
height VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is the player from Chicago, IL?
| SELECT height FROM table_name_48 WHERE hometown = "chicago, il" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label 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 number,
intime time,
outtime ti... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 20 AND 29 | mimic_iii |
CREATE TABLE table_32428 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the home side when the away side score is... | SELECT "Home team" FROM table_32428 WHERE "Away team score" = '11.14 (80)' | wikisql |
CREATE TABLE table_65162 (
"HR no." text,
"HR name" text,
"CR no." real,
"LMS no." real,
"Built" text,
"Works" text,
"Withdrawn" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the built date when the CR number is more than 940 and the... | SELECT "Built" FROM table_65162 WHERE "CR no." > '940' AND "LMS no." = '14760' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2529055' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-09-30' AND '2012-12-13' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 2796.97) AS T | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_NM = '王芳茵' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0 | css |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_name_78 (
european_cup VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which European Cup is in the 1990-91 season?
| SELECT european_cup FROM table_name_78 WHERE season = "1990-91" | sql_create_context |
CREATE TABLE table_name_1 (
attendance VARCHAR,
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Attendance for Opponent Boston Patriots and Week is greater than 14?
| SELECT COUNT(attendance) FROM table_name_1 WHERE opponent = "boston patriots" AND week > 14 | sql_create_context |
CREATE TABLE customers (
town_city VARCHAR,
customer_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has the least number of customers whose type code is 'Good Credit Rating'?
| SELECT town_city FROM customers WHERE customer_type_code = "Good Credit Rating" GROUP BY town_city ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
CREATE TABLE table_name_15 (
income_inequality_1994_2011__latest_available_ VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the current income inequality for the country of Seychelles?
| SELECT income_inequality_1994_2011__latest_available_ FROM table_name_15 WHERE country = "seychelles" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '44017290' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-10-18' AND '2012-02-28' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_72852 (
"Game" real,
"Date" text,
"Opponent" text,
"Score/Time" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Arena/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT COUNT("Opponent") FROM table_72852 WHERE "Record" = '9-2' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '67164533' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5269.15) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '67164533' AN... | css |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_67339 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me what is FCC info for harmony township, new jersey?
| SELECT "FCC info" FROM table_67339 WHERE "City of license" = 'harmony township, new jersey' | wikisql |
CREATE TABLE table_name_13 (
match VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the match number for Start Gniezno?
| SELECT match FROM table_name_13 WHERE team = "start gniezno" | sql_create_context |
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id... | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_83 (
runs INTEGER,
name VARCHAR,
inns VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name of clem hill, and Inns larger than 126 has the lowest runs?
| SELECT MIN(runs) FROM table_name_83 WHERE name = "clem hill" AND inns > 126 | sql_create_context |
CREATE TABLE table_name_44 (
time_retired VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Riccardo Patrese's time/retired?
| SELECT time_retired FROM table_name_44 WHERE driver = "riccardo patrese" | sql_create_context |
CREATE TABLE table_32225 (
"Network" text,
"Origin of Programming" text,
"Language" text,
"Genre" text,
"Service" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language is the moviein that is on UMP movies network through Sky service?
| SELECT "Language" FROM table_32225 WHERE "Genre" = 'movies' AND "Service" = 'sky' AND "Network" = 'ump movies' | wikisql |
CREATE TABLE table_7105 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest top-5 of the tournament with less than 1 top-1... | SELECT MIN("Top-5") FROM table_7105 WHERE "Top-10" < '1' AND "Top-25" < '1' | wikisql |
CREATE TABLE table_41913 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Centerfold model on 5-88?
| SELECT "Centerfold model" FROM table_41913 WHERE "Date" = '5-88' | wikisql |
CREATE TABLE table_name_69 (
location_attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location and attendance when the record was 19-17?
| SELECT location_attendance FROM table_name_69 WHERE record = "19-17" | sql_create_context |
CREATE TABLE player (
Player VARCHAR,
Years_Played VARCHAR,
Team VARCHAR
)
CREATE TABLE team (
Team_id VARCHAR,
Name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the players and years played for players from team 'Columbus Crew'.
| SELECT T1.Player, T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" | sql_create_context |
CREATE TABLE table_34160 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "1997" FROM table_34160 WHERE "1999" = 'grand slams' | wikisql |
CREATE TABLE table_name_77 (
conceded VARCHAR,
wins VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Conceded has Wins smaller than 3, and Points larger than 11?
| SELECT COUNT(conceded) FROM table_name_77 WHERE wins < 3 AND points > 11 | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6281887' AND t_kc21.IN_DIAG_DIS_CD = 'J30.696') | css |
CREATE TABLE table_26820 (
"Rank" real,
"Senator" text,
"Date of birth" text,
"Entered Senate" text,
"Left Senate" text,
"State served" text,
"Party" text,
"Time since entry" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date di... | SELECT "Entered Senate" FROM table_26820 WHERE "Senator" = 'Joseph Tydings' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_... | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.long_title = "Percutaneous aspiration of liver" | mimicsql_data |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
C... | SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId INNER JOIN Posts AS q ON a.Paren... | sede |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Gentamicin Sulfate" | mimicsql_data |
CREATE TABLE table_30073089_2 (
date VARCHAR,
season VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for 2011 and position larger than 2.0
| SELECT date FROM table_30073089_2 WHERE season = 2011 AND position > 2.0 | sql_create_context |
CREATE TABLE table_37387 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the segment c with episode less than 179 and ... | SELECT "Segment C" FROM table_37387 WHERE "Episode" < '179' AND "Segment B" = 's sticker' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Heparin, LMW" | mimicsql_data |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2194" | mimicsql_data |
CREATE TABLE table_16751596_12 (
democrat VARCHAR,
lead_margin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the lead margin was 35, what were the Democrat: Vivian Davis Figures?
| SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE lead_margin = 35 | sql_create_context |
CREATE TABLE table_203_28 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did they participate in the olympic games ?
| SELECT COUNT(*) FROM table_203_28 WHERE "competition" = 'olympic games' | squall |
CREATE TABLE table_name_74 (
type VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type of station for ESPN International Sports?
| SELECT type FROM table_name_74 WHERE name = "espn international sports" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Private" | mimicsql_data |
CREATE TABLE table_13888 (
"Draw" real,
"Song" text,
"Artist" text,
"Points" real,
"Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the Song by Artist Rosie Hunter with a Draw of 1 or larger?
| SELECT COUNT("Place") FROM table_13888 WHERE "Artist" = 'rosie hunter' AND "Draw" > '1' | wikisql |
CREATE TABLE table_name_47 (
draw INTEGER,
match INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of draws for teams with more than 10 matches?
| SELECT AVG(draw) FROM table_name_47 WHERE match > 10 | sql_create_context |
CREATE TABLE table_11621915_1 (
winner VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the winner with tournament value of kroger senior classic
| SELECT winner FROM table_11621915_1 WHERE tournament = "Kroger Senior Classic" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench |
CREATE TABLE table_name_27 (
result VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result on week 1?
| SELECT result FROM table_name_27 WHERE week = 1 | sql_create_context |
CREATE TABLE table_12325 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did Trinidad and Tobago play?
| SELECT "Place" FROM table_12325 WHERE "Country" = 'trinidad and tobago' | wikisql |
CREATE TABLE table_55467 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the time/retired when the laps is less than 4?
| SELECT "Time/Retired" FROM table_55467 WHERE "Laps" < '4' | wikisql |
CREATE TABLE table_name_67 (
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the laps for 3 grids
| SELECT laps FROM table_name_67 WHERE grid = 3 | sql_create_context |
CREATE TABLE table_17425749_1 (
colorado VARCHAR,
alaska VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the colorado when alaska is connecticut
| SELECT colorado FROM table_17425749_1 WHERE alaska = "Connecticut" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.