instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_12288 (
"Season" real,
"Year(s)" real,
"Winner" text,
"Runner-Up" text,
"3rd Place" text,
"Host" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the earliest with 4 seasons?
| SELECT MIN("Year(s)") FROM table_12288 WHERE "Season" = '4' | wikisql |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '84760350' AND MED_SER_ORG_NO = '9310059' AND NOT OUT_DIAG_DIS_NM LIKE '%睡眠%' | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT MAX(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 = '021-248902')) AND intakeoutput.celllabel = 'i.v.... | eicu |
CREATE TABLE table_name_95 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the away team when the home team is Footscray?
| SELECT away_team AS score FROM table_name_95 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_24621 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record achieved in the gamed played at BC Place ... | SELECT "Record" FROM table_24621 WHERE "Location" = 'BC Place Stadium' | wikisql |
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 * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '褚昊天' AND hz_info.YLJGDM = '2197506' AND NOT wdmzjzjlb.JZKSMC LIKE '%眼外伤%' UNION SELECT * FROM person_info J... | css |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number... | SELECT cooccurs.TagName AS cooccurs FROM Tags AS occurs, PostTags AS pto, Tags AS cooccurs, PostTags AS ptc WHERE ptc.TagId = cooccurs.Id AND ptc.PostId = pto.PostId AND pto.TagId = occurs.Id AND occurs.TagName = 'c#' INTERSECT SELECT cooccurs.TagName AS cooccurs FROM Tags AS occurs, PostTags AS pto, Tags AS cooccurs, ... | sede |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- 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 ORDER BY T1.Name | nvbench |
CREATE TABLE table_63820 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins had a podium larger than 6 after seas... | SELECT COUNT("Wins") FROM table_63820 WHERE "Season" > '2008' AND "Podiums" > '6' | wikisql |
CREATE TABLE table_test_24 (
"id" int,
"history_of_bleeding_diathesis" bool,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"blood_draw" bool,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"allergy_to_clopidogrel" bool,
"cardiogenic_shock" boo... | SELECT * FROM table_test_24 WHERE allergy_to_aspirin = 1 OR allergy_to_clopidogrel = 1 OR allergy_to_prasugrel = 1 | criteria2sql |
CREATE TABLE table_72401 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in the voting district Kentucky 2?
| SELECT "Result" FROM table_72401 WHERE "District" = 'Kentucky 2' | 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 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.IN_DIAG_DIS_NM = '瘙痒症' | css |
CREATE TABLE table_name_95 (
hanzi VARCHAR,
population__2004_est_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Hanzi has a suburban population in 2004?
| SELECT hanzi FROM table_name_95 WHERE population__2004_est_ = "suburban" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9833)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'... | mimic_iii |
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_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5365915' GROUP BY gwyjzb.MED_ORG_DEPT_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI... | css |
CREATE TABLE table_31102 (
"Week of" text,
"Tournament" text,
"Champion" text,
"Runner-up" text,
"Semifinalists" text,
"Quarterfinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the semifinalists when the runner-up was Peter Feig... | SELECT "Semifinalists" FROM table_31102 WHERE "Runner-up" = 'Peter Feigl' | wikisql |
CREATE TABLE table_7753 (
"Rank" text,
"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 average Total, when Gold is less than 0?
| SELECT AVG("Total") FROM table_7753 WHERE "Gold" < '0' | wikisql |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) > 0 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 = 14982)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'impact w... | mimic_iii |
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 hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '葛歌韵' AND jybgb.BGRQ BETWEEN '2019-12-22' AND '2020-12-16' ... | css |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.language = "SPAN" AND procedures.long_title = "Incision of vessel, abdominal arteries" | mimicsql_data |
CREATE TABLE table_name_21 (
name VARCHAR,
moving_to VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is moving to Triestina?
| SELECT name FROM table_name_21 WHERE moving_to = "triestina" | sql_create_context |
CREATE TABLE table_name_43 (
silver INTEGER,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest number of silver for 9 bronze and less than 27 total?
| SELECT MAX(silver) FROM table_name_43 WHERE bronze = 9 AND total < 27 | sql_create_context |
CREATE TABLE table_51496 (
"Rank" real,
"Engine" text,
"Wins" real,
"First win" text,
"Latest win" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank 6 lowest win who's first win was at the 1950 British Grand Prix?
| SELECT MIN("Wins") FROM table_51496 WHERE "Rank" > '6' AND "First win" = '1950 british grand prix' | wikisql |
CREATE TABLE table_25485 (
"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.
-- How ma... | SELECT COUNT("High rebounds") FROM table_25485 WHERE "Date" = 'April 7' | wikisql |
CREATE TABLE table_72358 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the candidates in the election where Saxby Chambliss was the i... | SELECT "Candidates" FROM table_72358 WHERE "Incumbent" = 'Saxby Chambliss' | wikisql |
CREATE TABLE table_41183 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for Unit with a status of nomen oblitum?
| SELECT "Unit" FROM table_41183 WHERE "Status" = 'nomen oblitum' | wikisql |
CREATE TABLE table_name_58 (
record VARCHAR,
visitor VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a Visitor of quebec nordiques with a Score of 4 5?
| SELECT record FROM table_name_58 WHERE visitor = "quebec nordiques" AND score = "4–5" | sql_create_context |
CREATE TABLE table_name_33 (
outcome VARCHAR,
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Surface of indoor/carpet Outcome on 13 October 1996
| SELECT outcome FROM table_name_33 WHERE surface = "indoor/carpet" AND date = "13 october 1996" | sql_create_context |
CREATE TABLE category (
id int,
business_id varchar,
category_name varchar
)
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE checkin (
cid int,
business_id varchar,
count int,
day varchar
)
CREATE TABLE business (
bid int,
business_id varchar,... | SELECT business.name FROM business, category WHERE business.city = 'Los Angeles' AND business.rating > 3 AND business.review_count > 30 AND category.business_id = business.business_id AND category.category_name = 'Bars' | yelp |
CREATE TABLE table_name_45 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Tom Purtzer from?
| SELECT country FROM table_name_45 WHERE player = "tom purtzer" | 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_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '吕宏达' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '盐酸阿米替林片(薄膜)') | css |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | (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.RYBH = ... | css |
CREATE TABLE screen_mode (
graphics_mode number,
char_cells text,
pixels text,
hardware_colours number,
used_kb number,
map text,
type text
)
CREATE TABLE phone (
company_name text,
hardware_model_name text,
accreditation_type text,
accreditation_level text,
date text,
... | SELECT MAX(used_kb), MIN(used_kb), AVG(used_kb) FROM screen_mode | spider |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT * FROM jybgb WHERE JZLSH = '67597975665' | css |
CREATE TABLE table_8206 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when the result was 1-1?
| SELECT "Attendance" FROM table_8206 WHERE "Result" = '1-1' | wikisql |
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 AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pneumonia - opportunistic')) AND DATETIME(co... | eicu |
CREATE TABLE table_27155243_3 (
total__number VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different episode numbers are there for the episodes directed by Sheri Elwood?
| SELECT COUNT(total__number) FROM table_27155243_3 WHERE directed_by = "Sheri Elwood" | sql_create_context |
CREATE TABLE table_20841 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" text,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" rea... | SELECT "Oblast\\Age" FROM table_20841 WHERE "50 to 54" = '2054' | wikisql |
CREATE TABLE table_68075 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least points for chassis of kurtis kraft 500a
| SELECT MIN("Points") FROM table_68075 WHERE "Chassis" = 'kurtis kraft 500a' | 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 SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '鲁丽泽' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2017-06-24' AND '2017-11-06' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - metronidazo... | eicu |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_24427210_1 (
payout___us$__ VARCHAR,
tv VARCHAR,
bowl_game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the payout for espn for music city bowl
| SELECT payout___us$__ FROM table_24427210_1 WHERE tv = "ESPN" AND bowl_game = "Music City Bowl" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
Creati... | SELECT COUNT(*) FROM Posts AS p, PostTags AS pt, Tags AS t WHERE p.Id = pt.PostId AND pt.TagId = t.Id AND t.Id = 4087 AND NOT p.Tags LIKE '%compiler-warnings%' /* SELECT count(*) from Posts p, PostTags pt, Tags t where p.id = pt.PostId and pt.TagId = t.id and t.id = 18348 and p.Tags NOT like '%compiler-errors%' */ /* S... | sede |
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE affected_region (
region_id number,
storm_id nu... | SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10 | spider |
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_100 | nvbench |
CREATE TABLE table_name_70 (
score VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the Rangers' attendance was 23,493?
| SELECT score FROM table_name_70 WHERE attendance = "23,493" | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Heart valve replac NEC" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number ... | 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENI... | atis |
CREATE TABLE table_144 (
"Player" text,
"Games Played" real,
"Attempts" real,
"Yards" real,
"Touchdowns" real,
"Longest run" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attempts did Charles White make?
| SELECT MIN("Attempts") FROM table_144 WHERE "Player" = 'Charles White' | wikisql |
CREATE TABLE table_22521 (
"Year (Ceremony)" text,
"Actor/Actress" text,
"Category" text,
"Film title used in nomination" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What category was the movie Working Girl nominated?
| SELECT "Category" FROM table_22521 WHERE "Film title used in nomination" = 'Working Girl' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE ... | WITH test1 AS (SELECT DISTINCT u.Id, DisplayName, Reputation, Location, COUNT(p.Id) OVER (PARTITION BY u.Id) AS "questions_answered" FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE LOWER(Location) LIKE '%visak%') /* Select row_number() over(order by 'questions_answered' desc) as rownum,*,sum(reputati... | sede |
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 demographic.dod FROM demographic WHERE demographic.subject_id = "3343" | mimicsql_data |
CREATE TABLE invoice (
invoiceid number,
customerid number,
invoicedate time,
billingaddress text,
billingcity text,
billingstate text,
billingcountry text,
billingpostalcode text,
total number
)
CREATE TABLE mediatype (
mediatypeid number,
name text
)
CREATE TABLE artist (... | SELECT AVG(unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Jazz" | spider |
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE T... | SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE dept_name = "Accounting" | spider |
CREATE TABLE table_name_35 (
player VARCHAR,
penalty VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has a penalty of holding on the DET team?
| SELECT player FROM table_name_35 WHERE penalty = "holding" AND team = "det" | sql_create_context |
CREATE TABLE table_15783 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week was the game held at Kingdome on October 13, 1991?
| SELECT MIN("Week") FROM table_15783 WHERE "Game site" = 'kingdome' AND "Date" = 'october 13, 1991' | wikisql |
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 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 = 'hx-female genit malg nec')) | mimic_iii |
CREATE TABLE table_41957 (
"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 average amount of gold medals for a country with more than 12 total medals?
| SELECT AVG("Gold") FROM table_41957 WHERE "Total" > '12' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '60273857020' GROUP BY zyjybgb.SQRGH HAVING COUNT(*) > 23 UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '60273857020' GROUP BY mzjybgb.SQRGH HAVING COUNT(*) > 23 | css |
CREATE TABLE Ref_Attraction_Types (
Attraction_Type_Code CHAR(15),
Attraction_Type_Description VARCHAR(255)
)
CREATE TABLE Visits (
Visit_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Tourist_ID INTEGER,
Visit_Date DATETIME,
Visit_Details VARCHAR(40)
)
CREATE TABLE Shops (
Shop_ID INTEGER... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... | eicu |
CREATE TABLE table_20449 (
"Country" text,
"Name" text,
"Host" text,
"Channel" text,
"First Premiere" text,
"Regular Judge" text,
"Seasons" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the host when first premiere is august 3, 2007
| SELECT "Host" FROM table_20449 WHERE "First Premiere" = 'August 3, 2007' | wikisql |
CREATE TABLE table_24939 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT MIN("No. in series") FROM table_24939 WHERE "Production code" = '3X7554' | wikisql |
CREATE TABLE Settlements (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many settlements are there in total?
| SELECT COUNT(*) FROM Settlements | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
... | SELECTtopN AS int | sede |
CREATE TABLE table_76336 (
"District" text,
"Population" real,
"Area" real,
"Pop. Dens." real,
"No.of Settlements" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest population density of Strakonice (st) with more than 112 settlements... | SELECT MIN("Pop. Dens.") FROM table_76336 WHERE "District" = 'strakonice (st)' AND "No.of Settlements" > '112' | wikisql |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_N... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) DESC | nvbench |
CREATE TABLE table_26199130_1 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the episode with production code 2alf03?
| SELECT title FROM table_26199130_1 WHERE production_code = "2ALF03" | sql_create_context |
CREATE TABLE fzzmzjzjlb (
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,
MZZYZD... | SELECT (SELECT COUNT(*) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '80429036' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-09-04' AND '2005-11-28' UNION SELECT COUNT(*) FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjz... | css |
CREATE TABLE table_79491 (
"Season" real,
"Network" text,
"Episodes" real,
"Premiered" text,
"Ended" text,
"DVD set release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When dis cbs release the DVD set?
| SELECT "DVD set release date" FROM table_79491 WHERE "Network" = 'cbs' | wikisql |
CREATE TABLE table_name_89 (
winner VARCHAR,
_number_of_weeks VARCHAR,
third_place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won when robert kudelski finished with under 13 weeks?
| SELECT winner FROM table_name_89 WHERE _number_of_weeks < 13 AND third_place = "robert kudelski" | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 550 | advising |
CREATE TABLE table_204_267 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which game had a higher total number of goals scored , 1 or 16 ?
| SELECT "tie no" FROM table_204_267 WHERE "tie no" IN (1, 16) ORDER BY "score" + "score" DESC LIMIT 1 | squall |
CREATE TABLE table_65801 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score of the friendly competition?
| SELECT "Score" FROM table_65801 WHERE "Competition" = 'friendly' | wikisql |
CREATE TABLE table_78572 (
"Year" real,
"Single" text,
"Chart" text,
"Position" real,
"Appeared on album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- After 1996, what is the average position?
| SELECT AVG("Position") FROM table_78572 WHERE "Year" > '1996' | wikisql |
CREATE TABLE table_16452 (
"1932 (before recount)" text,
"party" text,
"Manhattan" text,
"The Bronx" text,
"Brooklyn" text,
"Queens" text,
"Richmond [Staten Is.]" text,
"Total" real,
"%" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT MIN("Total") FROM table_16452 | wikisql |
CREATE TABLE table_name_72 (
total INTEGER,
silver VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Total, when Silver is 0, and when Gold is 1?
| SELECT SUM(total) FROM table_name_72 WHERE silver = 0 AND gold = 1 | sql_create_context |
CREATE TABLE table_54603 (
"Year" real,
"Date" text,
"Type" text,
"President" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Type with a Year larger than 2010, and a Location with justus lipsius building, brussels, and a... | SELECT "Type" FROM table_54603 WHERE "Year" > '2010' AND "Location" = 'justus lipsius building, brussels' AND "President" = 'herman van rompuy (2nd term)' AND "Date" = '28–29 june' | 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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7983940' AND t_kc21.IN_HOSP_DATE BETWEEN '2018-04-25' AND '2019-07-26' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2' | css |
CREATE TABLE table_50440 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when 2441 people were in attendance?
| SELECT "Score" FROM table_50440 WHERE "Attendance" = '2441' | wikisql |
CREATE TABLE table_44902 (
"Game" real,
"Team" text,
"Score" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game was played at the Forum and led to a series result of 0-1?
| SELECT "Game" FROM table_44902 WHERE "Location Attendance" = 'the forum' AND "Series" = '0-1' | wikisql |
CREATE TABLE table_name_57 (
silver_medals VARCHAR,
gold_medals VARCHAR,
total_medals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silvers for a school with 2 golds and over 2 total?
| SELECT silver_medals FROM table_name_57 WHERE gold_medals = 2 AND total_medals > 2 | sql_create_context |
CREATE TABLE table_15257 (
"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
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "Club" FROM table_15257 WHERE "Points against" = '556' | wikisql |
CREATE TABLE table_203_355 (
id number,
"year" number,
"total" number,
"romanians" text,
"hungarians" text,
"roma" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in what year was there the largest percentage of hungarians ?
| SELECT "year" FROM table_203_355 ORDER BY "hungarians" DESC LIMIT 1 | squall |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462) AND prescriptions.drug = 'albumin 25% (12.5gm)' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 mont... | mimic_iii |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
... | SELECT TIME_TO_STR(CreationDate, '%A') AS "date", PostTypeId, COUNT(*) AS "posted" FROM Posts WHERE DeletionDate IS NULL AND ClosedDate IS NULL AND AnswerCount > 0 AND CreationDate >= '2020-01-01T00:00:00' GROUP BY TIME_TO_STR(CreationDate, '%A'), PostTypeId ORDER BY PostTypeId, Posted | sede |
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 employees (
EMPLOYEE_ID decimal(6,0... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) | nvbench |
CREATE TABLE table_203_214 (
id number,
"member" text,
"party" text,
"electorate" text,
"state" text,
"first elected" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which party was elected the least ?
| SELECT "party" FROM table_203_214 GROUP BY "party" ORDER BY COUNT(*) LIMIT 1 | squall |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_f... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'CO' | atis |
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Ar... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result | nvbench |
CREATE TABLE Has_allergy (
Allergy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all allergies with number of students affected.
| SELECT Allergy, COUNT(*) FROM Has_allergy GROUP BY Allergy | sql_create_context |
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 (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55247) AND prescriptions.drug = 'senna' AND STRFTIME('%y', prescriptions.startdate) <= '2104' | mimic_iii |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" | mimicsql_data |
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 mzjzjlb.JZZTDM, mzjzjlb.JZZTMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '36916045402' | css |
CREATE TABLE table_20684 (
"!Simple Present/Future" text,
"Probable Future" text,
"Simple Past" text,
"Past Habitual" text,
"Injunctive" text,
"Imperative" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the past habitual for garcha 'he does... | SELECT "Past Habitual" FROM table_20684 WHERE "Probable Future" = 'गर्छ garcha ''he does' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | SELECT (SELECT SUM(CASE WHEN DERIVED_TABLEalias0.FRIDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.MONDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.SATURDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.SUNDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalia... | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.