instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_18 (
original_title VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What original title has a year of 1978?
| SELECT original_title FROM table_name_18 WHERE year = "1978" | sql_create_context |
CREATE TABLE table_204_314 (
id number,
"pos" number,
"team" text,
"played" number,
"won" number,
"draw" number,
"lost" number,
"goals for" number,
"goals against" number,
"goal difference" number,
"points" number,
"notes" text
)
-- Using valid SQLite, answer the follow... | SELECT "goals for" FROM table_204_314 WHERE "team" = 'ks' | squall |
CREATE TABLE table_1341423_9 (
incumbent VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the incumbent of Florida 9?
| SELECT incumbent FROM table_1341423_9 WHERE district = "Florida 9" | sql_create_context |
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 demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Chandra Schulman" | mimicsql_data |
CREATE TABLE table_16620 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote a... | SELECT "Written by" FROM table_16620 WHERE "U.S. viewers (million)" = '18.73' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '016-9636') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicat... | eicu |
CREATE TABLE table_72405 (
"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.
-- Which district is jamie l. whitten from?
| SELECT "District" FROM table_72405 WHERE "Incumbent" = 'Jamie L. Whitten' | wikisql |
CREATE TABLE table_name_7 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the match against Guillermo Olaso?
| SELECT date FROM table_name_7 WHERE opponent = "guillermo olaso" | sql_create_context |
CREATE TABLE table_14312471_7 (
report VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who made the report when the home team is north Melbourne?
| SELECT report FROM table_14312471_7 WHERE home_team = "North Melbourne" | sql_create_context |
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 demographic.dob, demographic.admission_location FROM demographic WHERE demographic.subject_id = "3343" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT diagnoses.icd9_code, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kenneth Koeller" | mimicsql_data |
CREATE TABLE table_name_95 (
civilian_deaths VARCHAR,
total_casualties VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many civilians died in the conflict that had a total of 1,130 casualties?
| SELECT civilian_deaths FROM table_name_95 WHERE total_casualties = "1,130" | sql_create_context |
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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_10 (
date VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Jamaica Classic Tournament?
| SELECT date FROM table_name_10 WHERE tournament = "the jamaica classic" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-64368')) AND DATETIME(medication.drugstarttime, 'start of year') = DAT... | eicu |
CREATE TABLE table_61923 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What census ranking has an area greater than 578.28 km2?
| SELECT "Census Ranking" FROM table_61923 WHERE "Area km 2" > '578.28' | wikisql |
CREATE TABLE table_name_12 (
week VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of weeks where the result was listed at bye?
| SELECT COUNT(week) FROM table_name_12 WHERE result = "bye" | sql_create_context |
CREATE TABLE table_306 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player went to the college Southern California?
| SELECT "Player" FROM table_306 WHERE "College" = 'Southern California' | wikisql |
CREATE TABLE table_name_8 (
assets__billion_ INTEGER,
market_value__billion_$_ VARCHAR,
industry VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Assets (billion $) has an Industry of oil and gas, and a Rank of 9, and a Market Va... | SELECT SUM(assets__billion_) AS $_ FROM table_name_8 WHERE industry = "oil and gas" AND rank = 9 AND market_value__billion_$_ > 121.7 | sql_create_context |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88180) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-01' GROUP BY prescriptions.drug) AS t1 WHERE t1.c... | mimic_iii |
CREATE TABLE table_name_42 (
finish VARCHAR,
start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the finish of the year with start 5?
| SELECT finish FROM table_name_42 WHERE start = "5" | sql_create_context |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "T5 FRACTURE" AND procedures.short_title = "Drsl/dslmb fus post/post" | mimicsql_data |
CREATE TABLE table_train_137 (
"id" int,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"substance_dependence" bool,
"hcv" bool,
"schizophrenia" bool,
"neutrophil_count" int,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"platelet_count"... | SELECT * FROM table_train_137 WHERE renal_disease = 1 OR serum_creatinine > 2 | criteria2sql |
CREATE TABLE table_58295 (
"Team" text,
"Make" text,
"Driver" text,
"Sponsor" text,
"Car Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team is sponsored by chameleon sunglasses?
| SELECT "Team" FROM table_58295 WHERE "Sponsor" = 'chameleon sunglasses' | wikisql |
CREATE TABLE table_name_11 (
total_points VARCHAR,
seasons VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for 1984 for the team with 100 points total and more than 3 seasons?
| SELECT SUM(1984) FROM table_name_11 WHERE total_points = 100 AND seasons > 3 | sql_create_context |
CREATE TABLE table_75135 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Skip has a Third of tony angiboust?
| SELECT "Skip" FROM table_75135 WHERE "Third" = 'tony angiboust' | wikisql |
CREATE TABLE table_52150 (
"Date" text,
"Venue" text,
"Result" text,
"Competition" text,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of Goals on 1950-05-30?
| SELECT COUNT("Goals") FROM table_52150 WHERE "Date" = '1950-05-30' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kochi%' AND (LOWER(AboutMe) LIKE '%android%') ORDER BY Reputation DESC LIMIT 50 | sede |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT BGRGH, BGRXM FROM jybgb WHERE BGDH = '26946687277' | css |
CREATE TABLE fires (
fire_year number,
discovery_date number,
discovery_doy number,
discovery_time text,
stat_cause_code number,
stat_cause_descr text,
cont_date text,
cont_doy text,
cont_time text,
fire_size number,
fire_size_class text,
latitude number,
longitude nu... | SELECT AVG(discovery_date) FROM fires WHERE fire_year BETWEEN 2000 AND 2004 | uswildfires |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_name_24 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance of week 8?
| SELECT attendance FROM table_name_24 WHERE week = 8 | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | SELECT DisplayName, Reputation, Location FROM Users WHERE UPPER(Location) LIKE '%DENVER%' ORDER BY Reputation DESC | sede |
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.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '33964912' AND gwyjzb.MED_SER_ORG_NO = '6431931' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%咽炎%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '33964912' AND fgwyjzb.MED_SER_ORG_NO = '6431931' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%咽炎... | css |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | css |
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '31549527' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-04-16') | css |
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 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.JZZDSM = '过敏性皮炎' AND jyjgzbb.JCZBDM = '675208' UNION SELECT jyjgzbb.CKZFWXX,... | css |
CREATE TABLE table_name_94 (
player VARCHAR,
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player from the United States with a 75-70-68=211 score?
| SELECT player FROM table_name_94 WHERE country = "united states" AND score = 75 - 70 - 68 = 211 | sql_create_context |
CREATE TABLE table_45514 (
"Rank" text,
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Run 4 has Athletes of hubert stevens & curtis stev... | SELECT "Run 4" FROM table_45514 WHERE "Athletes" = 'hubert stevens & curtis stevens' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
... | 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 = 'analgesics - oral analgesics') AS t1 JOIN (SELECT patient.uniquepid, trea... | eicu |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TAB... | SELECT Id AS "post_link", Body FROM Posts WHERE PostTypeId = 2 AND Body LIKE '<p>##keyword##%' ORDER BY LENGTH(Body) | sede |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE table_12837_1 (
rain VARCHAR,
sunlight_hours VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rain figures are provided for sunlight hours in 1966?
| SELECT COUNT(rain) FROM table_12837_1 WHERE sunlight_hours = 1966 | sql_create_context |
CREATE TABLE table_77784 (
"Round" real,
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Winning Constructor" FROM table_77784 WHERE "Winning Driver" = 'riccardo patrese' | wikisql |
CREATE TABLE table_46516 (
"Model Number" text,
"sSpec Number" text,
"Frequency" text,
"L2 Cache" text,
"Mult" text,
"Voltage" text,
"Socket" text,
"Release Date" text,
"Part Number(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "sSpec Number" FROM table_46516 WHERE "Frequency" = '1ghz' | wikisql |
CREATE TABLE table_name_95 (
one_mora VARCHAR,
gloss VARCHAR,
accented_mora VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the one mora for a low tone mora with a gloss of / okiru/ [ k ]?
| SELECT one_mora FROM table_name_95 WHERE NOT accented_mora = "low tone" AND gloss = "/˩okiru/ [òkìɽɯ́]" | sql_create_context |
CREATE TABLE table_name_30 (
time VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time of the match with a Record of 3-3?
| SELECT time FROM table_name_30 WHERE record = "3-3" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-58787' AND patient.hospitaldischargetime IS NULL)) ORDER BY t... | eicu |
CREATE TABLE table_72183 (
"Route Name" text,
"Direction" text,
"Termini" text,
"Junctions" text,
"Length" text,
"Population Area" text,
"Remarks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which population areas have 'replaced by us 83'... | SELECT "Population Area" FROM table_72183 WHERE "Remarks" = 'Replaced by US 83' | wikisql |
CREATE TABLE table_name_63 (
species VARCHAR,
threat_level VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Species has a medium Threat Level?
| SELECT species FROM table_name_63 WHERE threat_level = "medium" | sql_create_context |
CREATE TABLE table_1454 (
"Official #" real,
"TF1 #" real,
"French title" text,
"English title" text,
"Air date (France)" text,
"Original Beechwood Bunny Tale / Source material" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the air date fr... | SELECT "Air date (France)" FROM table_1454 WHERE "French title" = 'La pêche au trésor' | wikisql |
CREATE TABLE table_name_92 (
total VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was the finish t32?
| SELECT COUNT(total) FROM table_name_92 WHERE finish = "t32" | 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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '55507351' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-09-12' AND '2008-02-03' | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 40 AND 49 | eicu |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diag... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '031-17834' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_22355_62 (
rank INTEGER,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum rank of the nation that won 4 gold medals?
| SELECT MAX(rank) FROM table_22355_62 WHERE gold = 4 | sql_create_context |
CREATE TABLE table_15128839_22 (
solo VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the solo when name is briggs, diyral
| SELECT solo FROM table_15128839_22 WHERE name = "Briggs, Diyral" | sql_create_context |
CREATE TABLE table_77963 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the full amount of Total for Austria when the number of gold is less than 0?
| SELECT SUM("Total") FROM table_77963 WHERE "Nation" = 'austria' AND "Gold" < '0' | wikisql |
CREATE TABLE table_204_517 (
id number,
"name" text,
"date of birth" text,
"club" text,
"division" text,
"appointed" text,
"time as manager" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total managers has there been ?
| SELECT COUNT("name") FROM table_204_517 | squall |
CREATE TABLE table_9562 (
"Name" text,
"Mi from Kingston" real,
"Km from Kingston" real,
"Parish" text,
"Length feet" real,
"Length meters" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Km From Kingston, when Mi From Kingsto... | SELECT MAX("Km from Kingston") FROM table_9562 WHERE "Mi from Kingston" < '108' AND "Length meters" = '260.6' | wikisql |
CREATE TABLE table_12338595_1 (
interview VARCHAR,
state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the interview score for the state of Virginia?
| SELECT interview FROM table_12338595_1 WHERE state = "Virginia" | sql_create_context |
CREATE TABLE Staff (
staff_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
product_category_code VARCHAR(20),
date_product_... | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name | nvbench |
CREATE TABLE table_10644 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winner for majorca
| SELECT "Winner" FROM table_10644 WHERE "Tournament" = 'majorca' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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,
H... | SELECT COUNT(*) 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_ID = '29201885' AND t_kc22.STA_DATE BETWEEN '2014-05-23' AND '2016-12-27' AND t_kc22.SOC_SRT_DIRE_NM = '香砂养胃丸' | css |
CREATE TABLE table_63018 (
"Artist" text,
"Song" text,
"Lyrics (l) / Music (m)" text,
"Votes" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the Lyrics (l) / Music (m) for the song in 23 Place?
| SELECT "Lyrics (l) / Music (m)" FROM table_63018 WHERE "Place" = '23' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-232560' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ... | eicu |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, COUNT(*) FROM ship GROUP BY Type ORDER BY Type | nvbench |
CREATE TABLE table_name_15 (
format_s_ VARCHAR,
label VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the formats associated with the Atlantic Records label, catalog number 512336?
| SELECT format_s_ FROM table_name_15 WHERE label = "atlantic records" AND catalog = "512336" | sql_create_context |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcit... | SELECT DISTINCT COUNT(1), paper.venueid FROM author, paper, writes WHERE author.authorname = 'Noah A. Smith' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.venueid ORDER BY COUNT(1) DESC | scholar |
CREATE TABLE guests (
guest_id number,
gender_code text,
guest_first_name text,
guest_last_name text,
date_of_birth time
)
CREATE TABLE view_unit_status (
apt_id number,
apt_booking_id number,
status_date time,
available_yn others
)
CREATE TABLE apartment_buildings (
building_i... | SELECT T1.apt_number FROM apartments AS T1 JOIN view_unit_status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM apartments AS T1 JOIN view_unit_status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1 | spider |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId ... | SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate, LastActivityDate, Score, ViewCount, Body FROM Posts WHERE (Body LIKE '%##string1##%') AND NOT (Body LIKE '%##string2##%') ORDER BY CreationDate DESC LIMIT 100 | sede |
CREATE TABLE table_test_26 (
"id" int,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"left_main_coronary_artery_disease" bool,
"uncontrolled_diabetes" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hepatitis_b_infection" bool,
"renal_disease" bool,
"u... | SELECT * FROM table_test_26 WHERE body_mass_index_bmi <= 40 | criteria2sql |
CREATE TABLE table_name_34 (
series VARCHAR,
team_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Series has a Team Name of sunred engineering?
| SELECT series FROM table_name_34 WHERE team_name = "sunred engineering" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | SELECT CAST(TIME_TO_STR(CreationDate, '%H') AS TEXT) + ':00' AS "hourutc", SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS numQuestions, RANK() OVER (ORDER BY SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) DESC) AS rankQuestions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS numAnswers, RANK() OVER (ORDER BY S... | sede |
CREATE TABLE BOOKINGS (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bookings do we have?
| SELECT COUNT(*) FROM BOOKINGS | sql_create_context |
CREATE TABLE table_58928 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of medals a country with more than 14 silver has?
| SELECT MIN("Total") FROM table_58928 WHERE "Silver" > '14' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | SELECT Questions.Id AS "post_link", Questions.Title, Questions.Score, Questions.AcceptedAnswerId, Tags.TagName AS TagName FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN PostTags ON PostTags.PostId = Answers.ParentId INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tag... | sede |
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 demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Erik Dickerson" | mimicsql_data |
CREATE TABLE table_9848 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" text,
"Song" text,
"Artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Volume:Issue 67:3-11 had how many weeks on top?
| SELECT "Weeks on Top" FROM table_9848 WHERE "Volume:Issue" = '67:3-11' | wikisql |
CREATE TABLE table_name_75 (
eccentricity VARCHAR,
semimajor_axis___au__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the eccentricity when the semimajor axis is 20 au?
| SELECT eccentricity FROM table_name_75 WHERE semimajor_axis___au__ = "20 au" | 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.
-- true or false . percy abbot has more votes than james findlay .
| SELECT (SELECT "votes" FROM table_204_736 WHERE "candidate" = 'percy abbott') > (SELECT "votes" FROM table_204_736 WHERE "candidate" = 'james findlay') | squall |
CREATE TABLE table_62338 (
"Year" real,
"Drivers" text,
"Team" text,
"Duration/Distance" text,
"Race Title" text,
"Championship" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Was the Grand Prix Watkins GLen that Miles Collier raced in before 19... | SELECT "Championship" FROM table_62338 WHERE "Year" < '1952' AND "Race Title" = 'grand prix watkins glen' AND "Drivers" = 'miles collier' | wikisql |
CREATE TABLE table_train_184 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"renal_disease" bool,
"hematocrit_hct" float,
"allergy_to_insulin_lispro" bool,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"hypertension" bool,
... | SELECT * FROM table_train_184 WHERE (gender = 'female' AND hematocrit_hct < 36) OR (gender = 'male' AND hematocrit_hct < 38) | criteria2sql |
CREATE TABLE table_75257 (
"Team" text,
"City" text,
"Arena" text,
"Founded" real,
"First AF2 season" real,
"Final AF2 season" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mean Founded number when the team is the Baton Rouge Blaze?... | SELECT AVG("Founded") FROM table_75257 WHERE "Team" = 'baton rouge blaze' | wikisql |
CREATE TABLE table_name_67 (
year VARCHAR,
waterford_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What yeae has 6-08 (24) as a waterford score?
| SELECT year FROM table_name_67 WHERE waterford_score = "6-08 (24)" | 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 DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '04201709947' AND SOC_SRT_DIRE_NM = '连花清瘟胶囊' | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '40108491' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2011-09-11') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE table_20657 (
"Year" text,
"Total matches" real,
"Total W-L-H" text,
"Singles W-L-H" text,
"Foursomes W-L-H" text,
"Fourballs W-L-H" text,
"Points won" text,
"Points %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was... | SELECT "Foursomes W-L-H" FROM table_20657 WHERE "Year" = '2002' | wikisql |
CREATE TABLE table_23366 (
"N\u00ba" real,
"Ep" real,
"Huckleberry Hound" text,
"Pixie and Dixie" text,
"Hokey Wolf" text,
"Air date" text,
"Credited Animators" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who animated 'Science Friction
| SELECT "Credited Animators" FROM table_23366 WHERE "Huckleberry Hound" = 'Science Friction' | wikisql |
CREATE TABLE table_204_968 (
id number,
"squad #" number,
"position" text,
"player" text,
"transferred to" text,
"fee" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the first player listed ?
| SELECT "player" FROM table_204_968 WHERE id = 1 | squall |
CREATE TABLE table_name_35 (
municipal_code INTEGER,
party VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Municipal code of the FRP Party with an area of 100?
| SELECT SUM(municipal_code) FROM table_name_35 WHERE party = "frp" AND area = 100 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructo... | SELECT COUNT(*) > 0 FROM course, course_offering, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ENGR' AND course.number = 591 AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'WN' AND semester.semester_id = course_offer... | advising |
CREATE TABLE table_name_29 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Venue had Carlton has the Away team?
| SELECT venue FROM table_name_29 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '18337912' AND gwyjzb.MED_SER_ORG_NO = '5431049' AND gwyjzb.OUT_DIAG_DIS_NM LIKE '%情感性%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '18337912' AND fgwyjzb.MED_SER_ORG_NO = '5431049' AND fgwyjzb.OUT_DIAG_DIS_NM LIKE '%情感性%' | css |
CREATE TABLE table_10682862_68 (
standard INTEGER,
first_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the standard of the country who won its first title in 1992?
| SELECT MAX(standard) FROM table_10682862_68 WHERE first_title = 1992 | sql_create_context |
CREATE TABLE table_2562572_20 (
dominant_religion__2002_ VARCHAR,
type VARCHAR,
cyrillic_name_other_names VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the dominant religion for village for
| SELECT dominant_religion__2002_ FROM table_2562572_20 WHERE type = "village" AND cyrillic_name_other_names = "Бачко Добро Поље" | sql_create_context |
CREATE TABLE table_name_48 (
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silvers for finland?
| SELECT silver FROM table_name_48 WHERE nation = "finland" | sql_create_context |
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 microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'nasopharynx' ORDER BY mi... | eicu |
CREATE TABLE table_5773 (
"Name" text,
"Nationality" text,
"Position [A ]" text,
"Oxford United career [B ]" text,
"Appearances" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which OU career [b] had Position [A] as a forward when ... | SELECT "Oxford United career [B ]" FROM table_5773 WHERE "Position [A ]" = 'forward' AND "Appearances" = '56' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.