instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_262514_1 (
institution VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every institution with a nickname of Ravens?
| SELECT institution FROM table_262514_1 WHERE nickname = "Ravens" | sql_create_context |
CREATE TABLE table_name_85 (
driver VARCHAR,
nor_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has 22 as nor 1?
| SELECT driver FROM table_name_85 WHERE nor_1 = "22" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 12938 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of ... | mimic_iii |
CREATE TABLE table_21136 (
"Species" text,
"Species common name" text,
"NCBI Accession Number (mRNA/Protein)" text,
"Length (bp/aa)" text,
"Protein Identity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the species with the common name 'mo... | SELECT COUNT("Species") FROM table_21136 WHERE "Species common name" = 'Mouse' | wikisql |
CREATE TABLE table_66634 (
"Town" text,
"Population (2001)" real,
"Population rank" real,
"County" text,
"Municipality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What county is the town with a rank of 205 located in?
| SELECT "County" FROM table_66634 WHERE "Population rank" = '205' | wikisql |
CREATE TABLE table_32847 (
"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 away team did Carlton play?
| SELECT "Away team" FROM table_32847 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(15),
shipping_method_code VARCHAR(15),
order_placed_datetime DATETIME,
order_delivered_datetime DATETIME,
order_shipping_charges VARCHAR(255)
)
CREATE TABLE Mailshot_Campaigns (
mailshot_id I... | SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mixed acid-base bal dis')) | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age < "51" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT demographic.marital_status, demographic.gender FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_14637853_3 (
written_by VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who wrote with original air date being september23,1995
| SELECT written_by FROM table_14637853_3 WHERE original_air_date = "September23,1995" | sql_create_context |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the first names of students in ro... | SELECT firstname FROM list WHERE classroom = 108 | spider |
CREATE TABLE table_name_85 (
state___territory VARCHAR,
building VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state/territory has lovett tower as the building?
| SELECT state___territory FROM table_name_85 WHERE building = "lovett tower" | sql_create_context |
CREATE TABLE table_22703 (
"Producer" text,
"Product" text,
"Samples taken" real,
"Samples failed" real,
"Melamine content(mg/kg)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many samples were taken of 2 ?
| SELECT COUNT("Samples taken") FROM table_22703 WHERE "Product" = '嬰幼兒配方乳粉2段基粉' | wikisql |
CREATE TABLE table_93 (
"Season" real,
"Driver" text,
"Team" text,
"Engine" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Points" text,
"Margin of defeat" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons was clay r... | SELECT COUNT("Season") FROM table_93 WHERE "Driver" = 'Clay Regazzoni' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35970')) AND intakeoutput.cellpath LIKE '%output%' AND S... | eicu |
CREATE TABLE table_train_266 (
"id" int,
"active_infection" bool,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"neuropathy" bool,
"severe_diabetic_complication" bool,
"hba1c" float,
"active_malignancy" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questio... | SELECT * FROM table_train_266 WHERE active_infection = 1 | criteria2sql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT Score, PostTypeId FROM Posts WHERE Id = 20403490 | sede |
CREATE TABLE table_53799 (
"Conference" text,
"Division" text,
"Appearances" real,
"Wins" real,
"Losses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses did the East Division have who appeared 18 times and lost 8?
| SELECT MIN("Wins") FROM table_53799 WHERE "Division" = 'east' AND "Losses" = '8' AND "Appearances" < '18' | wikisql |
CREATE TABLE table_74239 (
"No" real,
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the constructor for b. bira
| SELECT "Constructor" FROM table_74239 WHERE "Driver" = 'B. Bira' | wikisql |
CREATE TABLE table_10816 (
"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.
-- In the game where the away team was Carlton and ... | SELECT "Venue" FROM table_10816 WHERE "Crowd" > '25,000' AND "Away team" = 'carlton' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "79" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_61760 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
)
-- Using valid SQLite, answer t... | SELECT "2:00 pm" FROM table_61760 WHERE "3:30 pm" = 'animaniacs (mon-thu) pinky and the brain (fri)' | wikisql |
CREATE TABLE table_25730209_2 (
extra_points VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many extra points did Stanfield Wells make?
| SELECT COUNT(extra_points) FROM table_25730209_2 WHERE player = "Stanfield Wells" | sql_create_context |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_204_590 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text,
"avg. attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which year did this team... | SELECT "year" FROM table_204_590 WHERE "year" <> 2004 AND "open cup" = (SELECT "open cup" FROM table_204_590 WHERE "year" = 2004) | squall |
CREATE TABLE table_train_277 (
"id" int,
"gender" string,
"cholesterol" float,
"blood_platelet_counts" int,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"severe_dyslipidemia" bool,
"fasting_triglyceride" int,
"body_mass_index_bmi" float,
"trig... | SELECT * FROM table_train_277 WHERE body_mass_index_bmi > 45 | criteria2sql |
CREATE TABLE table_name_82 (
venue VARCHAR,
margin_of_victory VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At what venue is the margin of victory 7 strokes?
| SELECT venue FROM table_name_82 WHERE margin_of_victory = "7 strokes" | sql_create_context |
CREATE TABLE table_20722805_1 (
mccain_percentage VARCHAR,
obama_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was McCain's percentage when Obama had 64.39% of the vote?
| SELECT mccain_percentage FROM table_20722805_1 WHERE obama_percentage = "64.39%" | sql_create_context |
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 t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '陈宛白' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-02-28' AND '2014-04-04' | css |
CREATE TABLE table_name_22 (
sideline_reporter_s_ VARCHAR,
year VARCHAR,
network VARCHAR,
play_by_play VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the sideline reporter(s) on NBC with al michaels on the play-by-play after 2013?
| SELECT sideline_reporter_s_ FROM table_name_22 WHERE network = "nbc" AND play_by_play = "al michaels" AND year > 2013 | sql_create_context |
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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31325)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dextrose 10%... | mimic_iii |
CREATE TABLE table_20341 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT W... | SELECT "Score" FROM table_20341 WHERE "Game" = '31' | wikisql |
CREATE TABLE table_2144863_1 (
miles__km_ VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the miles for jeff gordon
| SELECT miles__km_ FROM table_2144863_1 WHERE driver = "Jeff Gordon" | sql_create_context |
CREATE TABLE table_name_61 (
pick INTEGER,
round VARCHAR,
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of Pick with a Position of n/a and Greg Wendt as Player with a Round less than 6?
| SELECT SUM(pick) FROM table_name_61 WHERE position = "n/a" AND player = "greg wendt" AND round < 6 | sql_create_context |
CREATE TABLE table_20760802_1 (
played VARCHAR,
lost VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of played where lost equals 4 and drawn equals 1?
| SELECT played FROM table_20760802_1 WHERE lost = "4" AND drawn = "1" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
item... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40707 AND admissions.dischtime IS NULL) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '05238824503' | css |
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,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '喻星海' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeou... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'intravenous diuretic' AND DATETIME(treatment.treatmenttime) <= DATETIME(C... | eicu |
CREATE TABLE table_name_53 (
react VARCHAR,
time VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total react number with a time less than 20.05 and a lane less than 6?
| SELECT COUNT(react) FROM table_name_53 WHERE time < 20.05 AND lane < 6 | sql_create_context |
CREATE TABLE table_204_183 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many countries won more than 3 bronze metals ?
| SELECT COUNT("nation") FROM table_204_183 WHERE "bronze" > 3 | squall |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND intakeoutput.celllabel = 'urina... | eicu |
CREATE TABLE table_name_60 (
crowd INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people were in attendance at Hawthorn's home match?
| SELECT MIN(crowd) FROM table_name_60 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.admityear >= "2176" | mimicsql_data |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city ORDER BY AVG(Age) DESC | nvbench |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5586017' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-12-26' AND '2014-05-19' | css |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '赵星波' AND jybg... | css |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDe... | SELECT U.DisplayName AS "name", TIME_TO_STR(P.CreationDate, '%YEAR') AS "year", SUM(CASE WHEN P.PostTypeId = 2 THEN 1 ELSE 0 END) AS "number_of_answers", COUNT(P.Id) AS "number_of_posts", CAST(SUM(P.Score) AS FLOAT(6, 2)) / COUNT(P.Id) AS "average_score", MAX(P.Score) AS "max_score", SUM(CASE WHEN P.PostTypeId = 2 THEN... | sede |
CREATE TABLE table_21501565_1 (
original_artist VARCHAR,
theme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the original artist with a theme of N/A?
| SELECT original_artist FROM table_21501565_1 WHERE theme = "N/A" | sql_create_context |
CREATE TABLE table_203_150 (
id number,
"season" number,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"f/laps" number,
"podiums" number,
"points" number,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT COUNT(*) FROM table_203_150 WHERE "position" = 1 | squall |
CREATE TABLE table_65866 (
"Municipality" text,
"Inhabitants" real,
"Mayor" text,
"Party" text,
"Election" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which municipality has a party of Lega Friuli-VG that won elections before 2011?
| SELECT "Municipality" FROM table_65866 WHERE "Party" = 'lega friuli-vg' AND "Election" < '2011' | wikisql |
CREATE TABLE table_name_33 (
event VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event had a record of 8 5 1?
| SELECT event FROM table_name_33 WHERE record = "8–5–1" | sql_create_context |
CREATE TABLE field (
fieldid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY CO... | scholar |
CREATE TABLE table_60704 (
"Position" real,
"Club" text,
"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.... | SELECT AVG("Wins") FROM table_60704 WHERE "Played" < '30' | wikisql |
CREATE TABLE table_75805 (
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number listed under against when there were less than 13 losses and less than 2 byes?
| SELECT COUNT("Against") FROM table_75805 WHERE "Losses" < '13' AND "Byes" < '2' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Survey Research Techniques%' OR name LIKE '%Survey Research Techniques%') AND credits = 7 | advising |
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 diagnoses.short_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "11221" | mimicsql_data |
CREATE TABLE table_203_203 (
id number,
"year" number,
"majors" number,
"atp wins" number,
"total wins" number,
"earnings (us$)" number,
"money list rank" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last year mario an i had... | SELECT MAX("year") FROM table_203_203 WHERE "atp wins" > 0 | squall |
CREATE TABLE table_name_2 (
record VARCHAR,
h_a_n VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Record, when H/A/N is 'A', and when Date is 'February 1'?
| SELECT record FROM table_name_2 WHERE h_a_n = "a" AND date = "february 1" | sql_create_context |
CREATE TABLE table_name_86 (
points INTEGER,
goals_for VARCHAR,
goal_difference VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average points when the goal difference is less than 17, the club is getafe cf and the goals for ... | SELECT AVG(points) FROM table_name_86 WHERE goal_difference < 17 AND club = "getafe cf" AND goals_for > 30 | sql_create_context |
CREATE TABLE table_2562572_52 (
dominant_religion__2002_ VARCHAR,
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is the settlement karlov i ?
| SELECT COUNT(dominant_religion__2002_) FROM table_2562572_52 WHERE settlement = "Karlovčić" | sql_create_context |
CREATE TABLE table_train_37 (
"id" int,
"severe_sepsis" bool,
"mechanical_ventilation" bool,
"surgery" bool,
"receiving_vasopressor" bool,
"sepsis" bool,
"organ_failure" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following question... | SELECT * FROM table_train_37 WHERE mechanical_ventilation = 1 AND (severe_sepsis = 1 OR septic_shock = 1) | criteria2sql |
CREATE TABLE table_16527640_2 (
location VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What locations did sid o'neill play football?
| SELECT location FROM table_16527640_2 WHERE player = "Sid O'Neill" | sql_create_context |
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 mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name | nvbench |
CREATE TABLE table_name_15 (
result VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game that had 56,500 in attendance?
| SELECT result FROM table_name_15 WHERE attendance = "56,500" | sql_create_context |
CREATE TABLE table_203_637 (
id number,
"player" text,
"for" text,
"against" text,
"result" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players were for leeds united ?
| SELECT COUNT("player") FROM table_203_637 WHERE "for" = 'leeds united' | squall |
CREATE TABLE table_27374004_4 (
date_of_vacancy VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did outgoing manager Bart de Roover vacated a position?
| SELECT COUNT(date_of_vacancy) FROM table_27374004_4 WHERE outgoing_manager = "Bart De Roover" | sql_create_context |
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Student_Addresses (
stu... | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_19283982_4 (
_number_of_candidates VARCHAR,
_number_of_seats_won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of candidates for # of seats won being 43
| SELECT _number_of_candidates FROM table_19283982_4 WHERE _number_of_seats_won = 43 | sql_create_context |
CREATE TABLE table_name_70 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest grid when the race was retired due to the gearbox after 67 laps?
| SELECT MAX(grid) FROM table_name_70 WHERE time_retired = "gearbox" AND laps > 67 | sql_create_context |
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 OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2502709' GROUP BY OUT_DIAG_DIS_CD | css |
CREATE TABLE table_21870 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired ... | SELECT "Time/Retired" FROM table_21870 WHERE "Driver" = 'Ed Carpenter' | wikisql |
CREATE TABLE table_22879323_9 (
record VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the record for l 90 100 (ot)
| SELECT record FROM table_22879323_9 WHERE score = "L 90–100 (OT)" | sql_create_context |
CREATE TABLE table_name_12 (
release_date VARCHAR,
company VARCHAR,
writer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release date of the album written by Ford, Phil Phil Ford under BBC Audio?
| SELECT release_date FROM table_name_12 WHERE company = "bbc audio" AND writer = "ford, phil phil ford" | sql_create_context |
CREATE TABLE table_name_37 (
goals INTEGER,
games VARCHAR,
assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of goals of the player with 9 (0) games and less than 0 assists?
| SELECT MIN(goals) FROM table_name_37 WHERE games = "9 (0)" AND assists < 0 | sql_create_context |
CREATE TABLE table_78641 (
"Battle" text,
"Date" text,
"Bulgarian Commander" text,
"Latin Commander" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Latin Commander of the Siege of Constantinople?
| SELECT "Latin Commander" FROM table_78641 WHERE "Battle" = 'siege of constantinople' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserID AND (Votes.CreationDate < Posts.CommunityOwnedDate OR Posts.CommunityOwnedDa... | sede |
CREATE TABLE table_name_35 (
independent_socialist_ticket VARCHAR,
office VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Independent Socialist candidate for the office of comptroller?
| SELECT independent_socialist_ticket FROM table_name_35 WHERE office = "comptroller" | sql_create_context |
CREATE TABLE table_14496232_2 (
mens_singles VARCHAR,
womens_singles VARCHAR,
mixed_doubles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the mens singles when womens singles is wang lin and mixed doubles is joachim fischer nielsen christinna peder... | SELECT mens_singles FROM table_14496232_2 WHERE womens_singles = "Wang Lin" AND mixed_doubles = "Joachim Fischer Nielsen Christinna Pedersen" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_name_32 (
release_date INTEGER,
music_label VARCHAR,
media VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release date of the CD by EG Records in the UK?
| SELECT SUM(release_date) FROM table_name_32 WHERE media = "cd" AND country = "uk" AND music_label = "eg records" | sql_create_context |
CREATE TABLE artist (
artist_name VARCHAR,
country VARCHAR
)
CREATE TABLE song (
artist_name VARCHAR,
song_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name and country of origin of the artist who released a song that has 'love' i... | SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '022-158475' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '022-158475' AND patient.hospitaldischargetime IS NULL)) AND ... | eicu |
CREATE TABLE table_train_176 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"blood_glucose" int,
"hypoglycemia" bool,
"total_cholesterol" int,
"low_density_lipoprotein_ldl_cholesterol" int,
"triglyceride_t... | SELECT * FROM table_train_176 WHERE systolic_blood_pressure_sbp < 140 | criteria2sql |
CREATE TABLE table_68688 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Losing bonus" FROM table_68688 WHERE "Points against" = '546' | wikisql |
CREATE TABLE table_54322 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest code associated with ... | SELECT MIN("Code") FROM table_54322 WHERE "Type" = 'm' AND "Name" = 'saint-sylvère' AND "Region" < '17' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'K94.890' AND jyjgzbb.JCZBDM = '397278' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE table_29735 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High assists" FROM table_29735 WHERE "Team" = 'Houston' | wikisql |
CREATE TABLE table_70741 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visiting team when the record was 28 14 6 2?
| SELECT "Visitor" FROM table_70741 WHERE "Record" = '28–14–6–2' | wikisql |
CREATE TABLE table_name_50 (
result VARCHAR,
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result at valley parade on 4/7/02?
| SELECT result FROM table_name_50 WHERE venue = "valley parade" AND date = "4/7/02" | sql_create_context |
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,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '水高超' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 8518.36) | css |
CREATE TABLE table_204_546 (
id number,
"year" number,
"film" text,
"song" text,
"language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which of the languages mentioned was used in the most films ?
| SELECT "language" FROM table_204_546 GROUP BY "language" ORDER BY COUNT("film") DESC LIMIT 1 | squall |
CREATE TABLE table_203_406 (
id number,
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text,
"driver" text,
"rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the average tyre used in the race ?
| SELECT DISTINCT "tyre" FROM table_203_406 | squall |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '1791' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-04-24' AND '2007-04-05' AND t_kc21.IN_DIAG_DIS_NM = '前列腺增生' AND t_kc21.CLINIC_TYPE = '住院' | css |
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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" | mimicsql_data |
CREATE TABLE table_24993 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("Miles (km)") FROM table_24993 WHERE "Manufacturer" = 'Dodge' | wikisql |
CREATE TABLE table_72433 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the election featuring william madison whittingto... | SELECT "Result" FROM table_72433 WHERE "Incumbent" = 'William Madison Whittington' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.