context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_203_609 (
id number,
"#" number,
"matters" text,
"sections of the constitution allowing their institution" text,
"eligible petitioners" text,
"type" text
) | how many matters require at least one tenth of the existing representatives or senators ? | SELECT COUNT("matters") FROM table_203_609 WHERE "eligible petitioners" = 'at least one tenth of the existing representatives or senators' | squall |
CREATE TABLE table_dev_22 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"cardiovascular_disease" bool,
"esophageal_varices" bool,
"liver_disease" bool,
"diabetes" bool,
"serum_creatinine" float,
"hypertension" bool,
"portal_hypertension" boo... | serum creatinine < 1.5 mg / dl for male , and < 1.4 mg / dl for female | SELECT * FROM table_dev_22 WHERE (serum_creatinine < 1.5 AND gender = 'male') OR (serum_creatinine < 1.4 AND gender = 'female') | criteria2sql |
CREATE TABLE table_40863 (
"Record" text,
"Athlete" text,
"Nation" text,
"Venue" text,
"Date" text
) | What is the Nation when the Athlete was emma george, and a Record of 4.58m(15ft0 in)? | SELECT "Nation" FROM table_40863 WHERE "Athlete" = 'emma george' AND "Record" = '4.58m(15ft0¼in)' | wikisql |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 分别在哪几次医疗记录中给病患袁古韵开出过金额不低于3093.83元的药品?医疗就诊编号是多少? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '袁古韵' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3093.83) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '袁古韵' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 309... | css |
CREATE TABLE table_19781 (
"English gloss" text,
"Santee-Sisseton" text,
"Yankton-Yanktonai" text,
"Northern Lakota" text,
"Southern Lakota" text
) | Name the santee sisseton for morning | SELECT "Santee-Sisseton" FROM table_19781 WHERE "English gloss" = 'morning' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what is the average total cost of a hospital, which includes a drug called sodium chloride 0.9% 100 ml pb until 4 years ago? | 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 medication.patientunitstayid FROM medication WHERE medication.drugname = 'sodium chloride 0.9% 100 ml pb')) AND DATETIME... | eicu |
CREATE TABLE table_name_6 (
d_42_√ VARCHAR,
d_45_√ VARCHAR
) | What is the D 42 number when the D 45 is r 16? | SELECT d_42_√ FROM table_name_6 WHERE d_45_√ = "r 16" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | had patient 002-19159 got a diagnosis? | 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 = '002-19159')) | eicu |
CREATE TABLE table_20729 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
) | What time was it when the away team's score was 5.4 (34)? | SELECT "Time" FROM table_20729 WHERE "Away team score" = '5.4 (34)' | wikisql |
CREATE TABLE table_name_6 (
year_of_marriage INTEGER,
her_age VARCHAR,
his_age VARCHAR
) | What is the mean year of marriage when her age was more than 19 and his age was 30? | SELECT AVG(year_of_marriage) FROM table_name_6 WHERE her_age > 19 AND his_age = 30 | sql_create_context |
CREATE TABLE table_61789 (
"Sign" text,
"Domicile" text,
"Detriment" text,
"Exaltation" text,
"Fall" text
) | Which exaltation has a domicile of Saturn and a fall of Jupiter? | SELECT "Exaltation" FROM table_61789 WHERE "Domicile" = 'saturn' AND "Fall" = 'jupiter' | 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... | 5304983这家医疗机构从零一年一月七日起至十二月二十三日的就诊记录里没有就业的人员的就诊记录有多少 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '5304983' AND IN_HOSP_DATE BETWEEN '2001-01-07' AND '2001-12-23' AND INSURED_STS = '未就业' | css |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | Show aircraft names and number of flights for each aircraft with a bar chart, show by the X in ascending. | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name | nvbench |
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... | give the number of patients whose diagnosis long title is acute on chronic combined systolic and diastolic heart failure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Acute on chronic combined systolic and diastolic heart failure" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | was patient 028-52605 given a diagnosis until 1 year ago? | 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 = '028-52605')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number... | hmm.. what was patient 3710's first basophils until 11/2105? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3710) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'basophils') AND STRFTIME('%y-%m', labevents.charttime) <= '2105-11' ORDER BY labe... | mimic_iii |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者柳丽容为牙列缺损,门诊诊断的糖类抗原125的结果定量是什么?单位是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID... | Give me a pie to show how many event details from different event details. | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details | nvbench |
CREATE TABLE table_14342367_5 (
points INTEGER
) | what is the maximum number of points? | SELECT MAX(points) FROM table_14342367_5 | sql_create_context |
CREATE TABLE table_68547 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Entrant" text
) | What is the start of Offy engine and in 1972? | SELECT "Start" FROM table_68547 WHERE "Engine" = 'offy' AND "Year" = '1972' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | how many prescriptions of cephulac took place until 3 years ago? | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'cephulac' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year') | eicu |
CREATE TABLE table_68526 (
"Season" text,
"League" text,
"Winner" text,
"Goals" real,
"Assists" real,
"Points" real
) | What are the most Points with an Assist of 46? | SELECT MAX("Points") FROM table_68526 WHERE "Assists" = '46' | wikisql |
CREATE TABLE table_name_48 (
year VARCHAR,
rank VARCHAR
) | with rank of 31 what is the year? | SELECT COUNT(year) FROM table_name_48 WHERE rank = "31" | sql_create_context |
CREATE TABLE table_47703 (
"Game" real,
"Date" text,
"Team" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
) | Who had the most points in game 81? | SELECT "High points" FROM table_47703 WHERE "Game" = '81' | wikisql |
CREATE TABLE table_75847 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What date has 2006 fifa world cup qualification as the competition, and alamodome, san antonio, united States as the venue? | SELECT "Date" FROM table_75847 WHERE "Competition" = '2006 fifa world cup qualification' AND "Venue" = 'alamodome, san antonio, united states' | wikisql |
CREATE TABLE table_17832 (
"Colt model no." text,
"Diemaco model" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
"Muzzle device" t... | How many inches is the barrel length when the rear sight is weaver and the barrel profile is A2? | SELECT "Barrel length" FROM table_17832 WHERE "Rear sight" = 'Weaver' AND "Barrel profile" = 'A2' | wikisql |
CREATE TABLE table_60764 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | What score has 33 as the points? | SELECT "Score" FROM table_60764 WHERE "Points" = '33' | wikisql |
CREATE TABLE table_name_6 (
home_team VARCHAR,
venue VARCHAR
) | What was the home team's score at Princes Park? | SELECT home_team AS score FROM table_name_6 WHERE venue = "princes park" | 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... | provide the number of patients whose language is russ and diagnoses short title is proteus infection nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "RUSS" AND diagnoses.short_title = "Proteus infection NOS" | mimicsql_data |
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 diagnosis (
diagn... | what number of patients were prescribed sodium chloride 0.9% 500 ml lvp within 2 months after receiving a insulin - subcutaneous dose of longer-acting insulin prepara procedure until 2104? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin - subcutaneous dose of longer-acting insulin prepara' AND STRFTIME('%y', treatment.treatmenttime) <=... | eicu |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Visualize a pie chart about the proportion of All_Neutral and School_ID. | SELECT All_Neutral, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_67181 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"wins" text,
"Fast laps" text,
"Points" text,
"Pos." text
) | Which team has the points category of test driver? | SELECT "Team" FROM table_67181 WHERE "Points" = 'test driver' | wikisql |
CREATE TABLE table_17969 (
"Round" real,
"Circuit" text,
"Date" text,
"Length" text,
"Pole Position" text,
"GT3 Winner" text,
"GTC Winner" text
) | what are all the date for gt3 winner oliver bryant matt harris | SELECT "Date" FROM table_17969 WHERE "GT3 Winner" = 'Oliver Bryant Matt Harris' | wikisql |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transactio... | A bar chart groups the lot details, and computes the number of each lot details. | SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details | nvbench |
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,
... | 门诊给患者31141271的诊断为支气管炎,他的尿素检查的结果定量及其单位是什么 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '支气管炎' AND hz_info.RYBH =... | css |
CREATE TABLE table_name_59 (
intra_dc_precision VARCHAR,
name VARCHAR
) | Name the Intra DC Precision that has the Name main profile? | SELECT intra_dc_precision FROM table_name_59 WHERE name = "main profile" | sql_create_context |
CREATE TABLE table_32441 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the date where the home team scores 8.7 (55)? | SELECT "Date" FROM table_32441 WHERE "Home team score" = '8.7 (55)' | wikisql |
CREATE TABLE table_26967904_2 (
p_max___bar__ INTEGER,
f_bolt___kgf__ VARCHAR
) | What is the p max ( bar ) for the 6876 f bolt ( kgf )? | SELECT MIN(p_max___bar__) FROM table_26967904_2 WHERE f_bolt___kgf__ = 6876 | sql_create_context |
CREATE TABLE table_73344 (
"Team" text,
"Stadium" text,
"Match played" text,
"Highest" real,
"Lowest" real,
"Average" real
) | What is the highest when pohang steelers is the team? | SELECT "Highest" FROM table_73344 WHERE "Team" = 'Pohang Steelers' | wikisql |
CREATE TABLE table_name_76 (
gender VARCHAR,
roll VARCHAR,
decile VARCHAR,
authority VARCHAR,
years VARCHAR
) | Which gender has an Authority of state, Years of 1 8, and a Decile smaller than 10, and a Roll of 36? | SELECT gender FROM table_name_76 WHERE authority = "state" AND years = "1–8" AND decile < 10 AND roll = 36 | sql_create_context |
CREATE TABLE table_63924 (
"Season" text,
"Competition" text,
"Round" text,
"Played" text,
"Drew" text,
"Lost" text
) | What is the drew for the 1999-2000 season when they were in third place? | SELECT "Drew" FROM table_63924 WHERE "Round" = 'third place' AND "Season" = '1999-2000' | wikisql |
CREATE TABLE table_30390 (
"Position" real,
"Club" text,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"Pts For" real,
"Pts Agst" real,
"Points" real,
"Percent" text
) | How many points did the team that won 5 games make? | SELECT "Pts For" FROM table_30390 WHERE "Won" = '5' | wikisql |
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,
... | give me the number of patients admitted on an emergency basis who had prescription for timolol maleate 0.5%. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Timolol Maleate 0.5%" | mimicsql_data |
CREATE TABLE table_31132 (
"Country" text,
"Remittances 2008" text,
"Remittances 2009" text,
"Remittances 2010" text,
"Remittances 2011" text
) | how many countries have remittances in 2008 of 9.07? | SELECT COUNT("Country") FROM table_31132 WHERE "Remittances 2008" = '9.07' | wikisql |
CREATE TABLE table_name_32 (
music VARCHAR,
points_jury VARCHAR
) | Which Music has a Points Jury of 18 (5,5,4,4)? | SELECT music FROM table_name_32 WHERE points_jury = "18 (5,5,4,4)" | sql_create_context |
CREATE TABLE table_16733 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | what's the minimum rnd with race italian grand prix | SELECT MIN("Rnd") FROM table_16733 WHERE "Race" = 'Italian Grand Prix' | wikisql |
CREATE TABLE perpetrator (
Injured INTEGER
) | What is the average number of people injured by all perpetrators? | SELECT AVG(Injured) FROM perpetrator | sql_create_context |
CREATE TABLE table_name_15 (
home_port VARCHAR,
ship VARCHAR
) | Name the home port for kansas city | SELECT home_port FROM table_name_15 WHERE ship = "kansas city" | sql_create_context |
CREATE TABLE table_69034 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What place was Corey Pavin in? | SELECT "Place" FROM table_69034 WHERE "Player" = 'corey pavin' | wikisql |
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,
... | 被门诊诊断为D87.114这个病的患者04324529,看看他的检测指标451191的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | 在02年2月21日到04年4月10日期间作为患者91814247检测指标506686的医务人员的工号及姓名分别是什么? | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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... | css |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | compared to last measured on the first hospital visit patient 19059's po2 is greater than the value first measured on the first hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19059 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ... | mimic_iii |
CREATE TABLE artist (
gender VARCHAR
) | What is the number of artists for each gender? | SELECT COUNT(*), gender FROM artist GROUP BY gender | 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... | how much is the average cost of a hospital that involves pressure control in 2105? | 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 lab.patientunitstayid FROM lab WHERE lab.labname = 'pressure control')) AND STRFTIME('%y', cost.chargetime) = '2105' GRO... | eicu |
CREATE TABLE table_name_1 (
score VARCHAR,
competition VARCHAR
) | what is the score for the 2010 world cup qualifying? | SELECT score FROM table_name_1 WHERE competition = "2010 world cup qualifying" | sql_create_context |
CREATE TABLE t_kc21 (
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,
... | 从2009年2月14日到2016年4月20日,算一下7490542这个医疗机构的患者对医疗项目自付比例的平均值 | SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7490542' AND t_kc22.STA_DATE BETWEEN '2009-02-14' AND '2016-04-20' | css |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | count the number of times patient 18517 has had the po intake on the last intensive care unit visit. | 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 = 18517) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND inputevents_cv.itemid IN ... | mimic_iii |
CREATE TABLE table_2735 (
"Region" text,
"Citation" text,
"Court of Appeals" text,
"Established" real,
"Judges" real,
"Meeting places" real,
"Chief judge" text
) | If the chief judge is Glen E. Conrad, what is the region? | SELECT "Region" FROM table_2735 WHERE "Chief judge" = 'Glen E. Conrad' | wikisql |
CREATE TABLE table_30376 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | One 6 November 2007 what was the manner of departure for the coach release in football league one? | SELECT "Manner of departure" FROM table_30376 WHERE "Date of appointment" = '6 November 2007' | wikisql |
CREATE TABLE table_19205 (
"Designation" text,
"Bus width (bits)" real,
"Channels" text,
"Clock rate (MHz)" real,
"Bandwidth (MB/s)" real
) | Name the number of clock rate mhz when bandwidth mb/s is 2400 | SELECT COUNT("Clock rate (MHz)") FROM table_19205 WHERE "Bandwidth (MB/s)" = '2400' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Ratio of reputation estimated by votes got, vs. real reputation. We calculate the rep of the users by counting only the up/down/accept votes (so: no bounty, edits, -100 for rudeness, 1 rep limit, community owned posts, -1 for answer downs, no rep for most deleted posts, and no rep for self-answer accepts). Then we see ... | WITH VoteRep AS (SELECT 1 AS VoteTypeId, 15 AS Rep UNION SELECT 2, 10 UNION SELECT 3, -2), Raw AS (SELECT Users.Id, 1.0 * SUM(VoteRep.Rep) / MIN(Users.Reputation) AS EstRep, MIN(Users.Reputation) AS Reputation FROM Users, Posts, Votes, VoteRep WHERE Posts.OwnerUserId = Users.Id AND Votes.PostId = Posts.Id AND Votes.Vot... | sede |
CREATE TABLE table_204_387 (
id number,
"name" text,
"country" text,
"top rugby league level" text,
"top union level" text,
"top representation level" text,
"rugby league debut" number,
"rugby union debut" number
) | what are the number of times super league appears under the top rugby league level column ? | SELECT COUNT(*) FROM table_204_387 WHERE "top rugby league level" = 'super league' | squall |
CREATE TABLE table_69911 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the date of the label Alfa records, a CD format, and an alca-9201 catalog? | SELECT "Date" FROM table_69911 WHERE "Label" = 'alfa records' AND "Format" = 'cd' AND "Catalog" = 'alca-9201' | 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what is the monthly minimum sodium value for patient 7400 in 2104? | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7400) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND STRFTIME('%y', labevents.charttime) = '2104' GROUP BY STRFTIME(... | mimic_iii |
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... | 在90378777250的那次医疗就诊中,一共被开出了哪些定价上限金额高于8247.29元的药品,都给列出清单来 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '90378777250' AND UP_LIMIT_AMO > 8247.29 | css |
CREATE TABLE table_47784 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the Money ($) player Loren Roberts has made? | SELECT MAX("Money ( $ )") FROM table_47784 WHERE "Player" = 'loren roberts' | wikisql |
CREATE TABLE table_21175 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"Best finish" text,
"Earnings ( $ )" real,
"Money list rank" text
) | how many times did Casey Martin win? | SELECT MAX("Wins") FROM table_21175 | wikisql |
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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what were the five most commonly diagnosed diagnoses for patients who previously received a insert intercostal cath within 2 months since 2102? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_name_25 (
agg VARCHAR
) | What is the 1st leg with a 4-3 agg.? | SELECT 1 AS st_leg FROM table_name_25 WHERE agg = "4-3" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 小儿麻醉科因疾病T40.906而住院花费所以的平均费用是多少钱从2003年5月11日开始到2016年12月20日结束? | SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '小儿麻醉科' AND IN_HOSP_DATE BETWEEN '2003-05-11' AND '2016-12-20' AND IN_DIAG_DIS_CD = 'T40.906' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_name_25 (
date VARCHAR,
away_team VARCHAR
) | What is the date that is Away team is Honduras? | SELECT date FROM table_name_25 WHERE away_team = "honduras" | sql_create_context |
CREATE TABLE table_name_2 (
Id VARCHAR
) | What is the 1999 tournament that has a Q1 in 2003 and a Q3 in 2002? | SELECT 1999 FROM table_name_2 WHERE 2003 = "q1" AND 2002 = "q3" | sql_create_context |
CREATE TABLE table_name_71 (
week INTEGER,
game_site VARCHAR,
date VARCHAR
) | Which week was the game held at Kingdome on October 13, 1991? | SELECT MIN(week) FROM table_name_71 WHERE game_site = "kingdome" AND date = "october 13, 1991" | sql_create_context |
CREATE TABLE table_19257 (
"AGR Power Station" text,
"Net MWe" real,
"Construction started" real,
"Connected to grid" real,
"Commercial operation" real,
"Accounting closure date" real
) | What is the Closure date of Hunterston B | SELECT MIN("Accounting closure date") FROM table_19257 WHERE "AGR Power Station" = 'Hunterston B' | wikisql |
CREATE TABLE table_name_53 (
result VARCHAR,
first_elected VARCHAR
) | When someone was first elected in 1898 what was the result? | SELECT result FROM table_name_53 WHERE first_elected = "1898" | sql_create_context |
CREATE TABLE table_19365 (
"Application" text,
"Version" text,
"Cmdlets" text,
"Provider" text,
"Management GUI" text
) | Which providers use version 2008? | SELECT "Provider" FROM table_19365 WHERE "Version" = '2008' | wikisql |
CREATE TABLE match_season (
College VARCHAR
) | Show the name of colleges that have at least two players. | SELECT College FROM match_season GROUP BY College HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_name_91 (
score VARCHAR,
record VARCHAR
) | What was the score of the game that led to a 7-5 record? | SELECT score FROM table_name_91 WHERE record = "7-5" | sql_create_context |
CREATE TABLE table_name_68 (
pba_team VARCHAR,
college VARCHAR
) | Who is the PBA team with Mlqu college? | SELECT pba_team FROM table_name_68 WHERE college = "mlqu" | sql_create_context |
CREATE TABLE table_28885977_1 (
built_for VARCHAR,
location VARCHAR
) | What was the stadium in Moorabbin, Victoria built for? | SELECT built_for FROM table_28885977_1 WHERE location = "Moorabbin, Victoria" | sql_create_context |
CREATE TABLE table_203_804 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number
) | what is the number of mclaren ford constructors ? | SELECT COUNT("constructor") FROM table_203_804 WHERE "constructor" = 'mclaren-ford' | squall |
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
date_moved_out DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_deta... | Just give me a histogram that X is the details of the organization and the Y-axis is the number of things they own, sort by the Y-axis in ascending. | SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details ORDER BY COUNT(organization_details) | nvbench |
CREATE TABLE table_54243 (
"Name" text,
"Party" text,
"Province" text,
"Term expires" real,
"Term of office" text
) | Ken Wright of the National Party was from which province? | SELECT "Province" FROM table_54243 WHERE "Party" = 'national' AND "Name" = 'ken wright' | wikisql |
CREATE TABLE table_204_1 (
id number,
"season" text,
"north" text,
"south" text,
"east" text,
"west" text
) | who won the season in the north before ec bayreuth did in 2002-03 ? | SELECT "north" FROM table_204_1 WHERE id = (SELECT id FROM table_204_1 WHERE "north" = 'ec bayreuth') - 1 | squall |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC te... | 病人编号为16815496在06年9月29日到2016年1月16日这段时间,病人被开出的所有检验报告单的科室编码以及名称分别是多少? | SELECT jybgb.KSBM, jybgb.KSMC 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.RYBH = '16815496' AND jybgb.BGRQ BETWEEN '2006-09-29' AND '2016-... | css |
CREATE TABLE table_name_73 (
silver INTEGER,
rank VARCHAR,
bronze VARCHAR
) | What is the lowest number of silvers for countries in rank 12 with more than 0 bronze? | SELECT MIN(silver) FROM table_name_73 WHERE rank = "12" AND bronze > 0 | sql_create_context |
CREATE TABLE table_204_552 (
id number,
"rank" number,
"cyclist" text,
"team" text,
"laps\ndown" number,
"notes" text
) | how many cyclist do not have -1 laps down ? | SELECT COUNT("cyclist") FROM table_204_552 WHERE "laps\ndown" IS NULL | squall |
CREATE TABLE table_12847 (
"Governorate" text,
"Cereals" real,
"Fruit Trees" real,
"Olives" real,
"Industrial crops" real,
"Vegetables" real
) | What is the total number of fruit trees of the governorate with more than 12,141 vegetables, less than 153,232 industrial crops, and less than 3,140 cereals? | SELECT COUNT("Fruit Trees") FROM table_12847 WHERE "Vegetables" > '12,141' AND "Industrial crops" < '153,232' AND "Cereals" < '3,140' | wikisql |
CREATE TABLE table_48660 (
"President" text,
"Vice" real,
"Romanized (Hangul)" text,
"Took office" text,
"Left office" text,
"Political party" text
) | When did the vice president with a vice over 6 take office? | SELECT "Took office" FROM table_48660 WHERE "Vice" > '6' | wikisql |
CREATE TABLE table_28169 (
"Pos" real,
"Team" text,
"07 A Pts" real,
"08 C Pts" real,
"08 A Pts" real,
"09 C Pts" real,
"09 A Pts" real,
"10 C Pts" real,
"Total Pts" real,
"Total Pld" real,
"Avg" text
) | What is the largest number of 10 C points for a team with 39 total points? | SELECT MAX("10 C Pts") FROM table_28169 WHERE "Total Pts" = '39' | wikisql |
CREATE TABLE table_name_33 (
date VARCHAR,
game VARCHAR
) | What was the date for Game 41? | SELECT date FROM table_name_33 WHERE game = "41" | sql_create_context |
CREATE TABLE table_17035 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | What position does Matt Hobgood play? | SELECT "Position" FROM table_17035 WHERE "Player" = 'Matt Hobgood' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zzmzjzjlb (
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... | 03年6月6日到08年9月28日这一段时间有几个医生就诊过患者彭俊捷? | SELECT COUNT(zzmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '彭俊捷' AND zzmzjzjlb.JZKSRQ BETWEEN '2003-06-06' AND '2008-09-28' UNION SELECT COUNT(fz... | css |
CREATE TABLE table_name_34 (
tie_no VARCHAR,
attendance VARCHAR
) | What is the Tie no of the game with an Attendance of 4,658? | SELECT tie_no FROM table_name_34 WHERE attendance = "4,658" | sql_create_context |
CREATE TABLE Staff_Roles (
role_code VARCHAR(10),
role_description VARCHAR(255)
)
CREATE TABLE Document_Types (
document_type_code VARCHAR(10),
document_description VARCHAR(255)
)
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CRE... | Display a bar chart for what are the ids and details for all organizations that have grants of more than 6000 dollars?, could you list by the Y from high to low? | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T1.organisation_id DESC | nvbench |
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... | what is procedure short title of subject name francis baseler? | SELECT procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Francis Baseler" | mimicsql_data |
CREATE TABLE table_61202 (
"7:00 am" text,
"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,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" ... | What shows at 12:30 pm when 1:30 pm is All My Children? | SELECT "12:30 pm" FROM table_61202 WHERE "1:30 pm" = 'all my children' | wikisql |
CREATE TABLE table_75790 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | When did the High Park Demons play Away? | SELECT "Date" FROM table_75790 WHERE "Away" = 'high park demons' | wikisql |
CREATE TABLE table_name_40 (
goalsagainst INTEGER,
points VARCHAR,
lost VARCHAR
) | Goalsagainst that has a Points of 108, and a Lost smaller than 14 has what average? | SELECT AVG(goalsagainst) FROM table_name_40 WHERE points = 108 AND lost < 14 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients whose age is less than 59 and drug route is replace? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "59" AND prescriptions.route = "REPLACE" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.