context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_86 (
series VARCHAR,
date VARCHAR
) | Which Series are on may 18? | SELECT series FROM table_name_86 WHERE date = "may 18" | sql_create_context |
CREATE TABLE table_name_71 (
player VARCHAR,
to_par VARCHAR
) | Who is the player with a to par of +1? | SELECT player FROM table_name_71 WHERE to_par = "+1" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the founder , and group by attribute founder by a bar chart, and rank Founder in descending order please. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC | nvbench |
CREATE TABLE table_name_62 (
played INTEGER,
conceded INTEGER
) | Mean of played with smaller than 7 conceded? | SELECT AVG(played) FROM table_name_62 WHERE conceded < 7 | sql_create_context |
CREATE TABLE table_name_68 (
rank INTEGER,
area VARCHAR,
density VARCHAR,
province VARCHAR
) | What is the highest Rank with a density less than 376.37, the province was valverde, and an Area larger than 823? | SELECT MAX(rank) FROM table_name_68 WHERE density < 376.37 AND province = "valverde" AND area > 823 | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 列出在医院8013694中方语诗患者就诊科室名称包含全科的所有医疗就诊记录都有什么? | SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '方语诗' AND t_kc21.MED_SER_ORG_NO = '8013694' AND t_kc21.MED_ORG_DEPT_NM LIKE '%全科%' | css |
CREATE TABLE table_204_168 (
id number,
"date" text,
"time" text,
"opponent" text,
"site" text,
"tv" text,
"result" text,
"attendance" number,
"record" text
) | what is the total attendance on 11/09/2013 ? | SELECT "attendance" FROM table_204_168 WHERE "date" = '11/09/2013' | squall |
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,
... | whats the sex of patient 002-59265? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '002-59265' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is the number of patients whose year of birth is less than 2065? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2065" | mimicsql_data |
CREATE TABLE table_28980706_4 (
share__18_49_ VARCHAR,
viewers__millions_ VARCHAR
) | When there are 9.28 million viewers what is the share (18-49)? | SELECT share__18_49_ FROM table_28980706_4 WHERE viewers__millions_ = "9.28" | sql_create_context |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
... | Show all origins and the number of flights from each origin. | SELECT origin, COUNT(*) FROM flight GROUP BY origin | spider |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the diagnosis short title of diagnosis icd9 code 53550. | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "53550" | mimicsql_data |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname va... | Who has published more papers in NSDI ? | SELECT DISTINCT COUNT(DISTINCT paper.paperid), writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'NSDI' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(DISTINCT paper.paperid) DESC | scholar |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
di... | Show the id and salary of Mark Young. | SELECT eid, salary FROM employee WHERE name = 'Mark Young' | spider |
CREATE TABLE table_name_55 (
tournament VARCHAR
) | What is 2012, when Tournament is 'French Open'? | SELECT 2012 FROM table_name_55 WHERE tournament = "french open" | sql_create_context |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | How many rooms have a king bed? | SELECT COUNT(*) FROM rooms WHERE bedtype = "King" | spider |
CREATE TABLE table_18874 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Which team was in a game with a record of 15-63? | SELECT "Team" FROM table_18874 WHERE "Record" = '15-63' | 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,
... | 查询花英勋病患的检验报告单中结果指标均异常的检验报告单,需要检验报告的单号 | SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '花英勋' ... | css |
CREATE TABLE table_26245 (
"No" real,
"Player" text,
"Height (m)" text,
"Height (f)" text,
"Position" text,
"Year born" real,
"Current Club" text
) | Which players were born in 1983 and play as forward position? | SELECT "Player" FROM table_26245 WHERE "Year born" = '1983' AND "Position" = 'Forward' | wikisql |
CREATE TABLE table_40512 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | What position was played at the World Athletics Final Competition in a year more recent than 2008? | SELECT "Position" FROM table_40512 WHERE "Competition" = 'world athletics final' AND "Year" > '2008' | wikisql |
CREATE TABLE table_name_18 (
wind VARCHAR,
rank VARCHAR,
location VARCHAR
) | What was the wind at New York City when the rank was smaller than 6? | SELECT wind FROM table_name_18 WHERE rank < 6 AND location = "new york city" | sql_create_context |
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_reported DATETIME,
date_problem_closed DATETIME,
problem_description VARCHAR(255),
other_problem_details VARCHAR(255)
)
CREATE TABLE Problem... | List all the log entry descriptions and count them using a bar chart. | SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description | nvbench |
CREATE TABLE table_30694 (
"Reservoir" text,
"Basin" text,
"Location" text,
"Type" text,
"Height (m)" text,
"Length along the top (m)" text,
"Drainage basin (km\u00b2)" text,
"Reservoir surface (ha)" text,
"Volume (hm\u00b3)" text
) | What is listed in drainage basin when the type is gravity and the reservoir surface is 34.36? | SELECT "Drainage basin (km\u00b2)" FROM table_30694 WHERE "Type" = 'Gravity' AND "Reservoir surface (ha)" = '34.36' | wikisql |
CREATE TABLE table_204_772 (
id number,
"team" text,
"county" text,
"wins" number,
"years won" number
) | which team won after ballymore eustace ? | SELECT "team" FROM table_204_772 WHERE "years won" > (SELECT "years won" FROM table_204_772 WHERE "team" = 'ballymore eustace') ORDER BY "years won" LIMIT 1 | squall |
CREATE TABLE table_16175217_1 (
children_per_donor VARCHAR,
allowed_recipients VARCHAR
) | What are the children per donor in the country where the allowed recipients are married or in cohabitation? | SELECT children_per_donor FROM table_16175217_1 WHERE allowed_recipients = "Married or in cohabitation" | sql_create_context |
CREATE TABLE table_32282 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the away team when the home team scored 20.15 (135)? | SELECT "Away team score" FROM table_32282 WHERE "Home team score" = '20.15 (135)' | wikisql |
CREATE TABLE table_57429 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team played a home team with a score of 10.9 (69) at Glenferrie Oval? | SELECT "Away team" FROM table_57429 WHERE "Home team score" = '10.9 (69)' AND "Venue" = 'glenferrie oval' | wikisql |
CREATE TABLE table_77057 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
) | How much Loss has a Gain smaller than 1571, and a Long smaller than 47, and an Avg/G of 36.4? | SELECT COUNT("Loss") FROM table_77057 WHERE "Gain" < '1571' AND "Long" < '47' AND "Avg/G" = '36.4' | wikisql |
CREATE TABLE table_6242 (
"Tournament" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the info for the year 2010, for the Australian Open tournament? | SELECT "2010" FROM table_6242 WHERE "Tournament" = 'australian open' | wikisql |
CREATE TABLE table_36511 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | WHo has a Position of end and a School/Club Team of oregon state? | SELECT "Player" FROM table_36511 WHERE "Position" = 'end' AND "School/Club Team" = 'oregon state' | wikisql |
CREATE TABLE table_23214 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real
) | On how many different dates did schools from Chestnut Hill, Massachusetts join the conference? | SELECT COUNT("Joined") FROM table_23214 WHERE "Location" = 'Chestnut Hill, Massachusetts' | wikisql |
CREATE TABLE table_55996 (
"Name" text,
"Period" text,
"Starts" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Win %" real
) | What is the high loss total for players with zero wins and a win % greater than 0? | SELECT MAX("Losses") FROM table_55996 WHERE "Wins" = '0' AND "Win %" > '0' | wikisql |
CREATE TABLE table_name_72 (
hometown__previous_school_ VARCHAR,
name VARCHAR
) | What is the Hometown of Tim Williams? | SELECT hometown__previous_school_ FROM table_name_72 WHERE name = "tim williams" | sql_create_context |
CREATE TABLE table_name_26 (
Giant VARCHAR,
slalom VARCHAR
) | Which Giant Slalom has a Slalom of 45? | SELECT Giant AS slalom FROM table_name_26 WHERE slalom = "45" | sql_create_context |
CREATE TABLE table_45555 (
"Tournament" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text... | What is 1990, when 1997 is '1R', and when Tournament is 'Hamburg'? | SELECT "1990" FROM table_45555 WHERE "1997" = '1r' AND "Tournament" = 'hamburg' | wikisql |
CREATE TABLE table_203_551 (
id number,
"goal" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | how many games did he score but his team lost ? | SELECT COUNT(*) FROM table_203_551 WHERE "result" < "result" | squall |
CREATE TABLE table_203_148 (
id number,
"date" text,
"name" text,
"nationality" text,
"tonnage\n(grt)" number,
"fate" text
) | what nationality is on top of french navy ? | SELECT "nationality" FROM table_203_148 WHERE id = (SELECT id FROM table_203_148 WHERE "nationality" = 'french navy') - 1 | squall |
CREATE TABLE table_65903 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the to par for Jiyai Shin when the place is t1? | SELECT "To par" FROM table_65903 WHERE "Place" = 't1' AND "Player" = 'jiyai shin' | wikisql |
CREATE TABLE table_24508 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | Name the number of reason for change on may 11, 1939 | SELECT COUNT("Reason for change") FROM table_24508 WHERE "Date successor seated" = 'May 11, 1939' | 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... | 2007-01-04到2020-10-03期间,2301260这个医疗机构处理了多少次新生儿门诊 | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '2301260' AND zzmzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '2301260' AND fzzmzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND fzzmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | how many patients are admitted before the year 2120 and administered through oral drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2120" AND prescriptions.route = "ORAL" | mimicsql_data |
CREATE TABLE table_name_91 (
to_par VARCHAR,
player VARCHAR
) | What is the to par of player peter senior? | SELECT to_par FROM table_name_91 WHERE player = "peter senior" | sql_create_context |
CREATE TABLE table_2668254_8 (
candidates VARCHAR,
district VARCHAR
) | Who were the candidates in the Kentucky 5 district? | SELECT candidates FROM table_2668254_8 WHERE district = "Kentucky 5" | sql_create_context |
CREATE TABLE table_name_36 (
championship VARCHAR,
year VARCHAR,
opponent VARCHAR,
surface VARCHAR
) | Which championship has Roger Federer as an opponent on a clay surface in a year earlier than 2007? | SELECT championship FROM table_name_36 WHERE opponent = "roger federer" AND surface = "clay" AND year < 2007 | sql_create_context |
CREATE TABLE table_67377 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Which position had a goal difference of less than 27, lost more than 13 games, scored less than 42 goals and drew 6 games? | SELECT MAX("Played") FROM table_67377 WHERE "Goal Difference" < '27' AND "Losses" > '13' AND "Goals for" < '42' AND "Draws" = '6' | wikisql |
CREATE TABLE table_name_47 (
fa_cup_goals VARCHAR,
flt_goals INTEGER
) | What is the total number of FA Cup Goals, when FLT Goals is greater than 0? | SELECT COUNT(fa_cup_goals) FROM table_name_47 WHERE flt_goals > 0 | sql_create_context |
CREATE TABLE table_22644589_4 (
event VARCHAR,
compulsory_dance__cd_ VARCHAR
) | In what even was the compulsory dance scored 23.75? | SELECT event FROM table_22644589_4 WHERE compulsory_dance__cd_ = "23.75" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | You can return a bar chart to show the employees' first name and the corresponding manager's id, and rank total number in ascending order. | SELECT FIRST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID | nvbench |
CREATE TABLE table_20461 (
"Member State sorted by GDP" text,
"GDP in s billion of USD (2012)" text,
"GDP % of EU (2012)" text,
"Annual change % of GDP (2012)" text,
"GDP per capita in PPP US$ (2012)" real,
"Public Debt % of GDP (2013 Q1)" text,
"Deficit (-)/ Surplus (+) % of GDP (2012)" tex... | What is the public debt % of GDP in 2013 Q1 with a 4.7% GDP of EU in 2012? | SELECT "Public Debt % of GDP (2013 Q1)" FROM table_20461 WHERE "GDP % of EU (2012)" = '4.7%' | wikisql |
CREATE TABLE table_name_2 (
yards INTEGER,
long INTEGER
) | Which Yards has a Long smaller than 3? | SELECT AVG(yards) FROM table_name_2 WHERE long < 3 | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | 在编号为3488295的医院就诊的医疗记录内在入院诊断中得了肾结石的患者医疗费的总额最低和最高是多少元? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3488295' AND t_kc21.IN_DIAG_DIS_NM = '肾结石') | css |
CREATE TABLE table_24801 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What was the score when the partner is Rafael Osuna? | SELECT "Score" FROM table_24801 WHERE "Partner" = 'Rafael Osuna' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | how many patients stayed in hospital for more than 3 days and were diagnosed with ac vasc insuff intestine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "3" AND diagnoses.short_title = "Ac vasc insuff intestine" | mimicsql_data |
CREATE TABLE table_name_13 (
driver VARCHAR,
zan_1 VARCHAR
) | What driver has 19 as the zan 1? | SELECT driver FROM table_name_13 WHERE zan_1 = "19" | sql_create_context |
CREATE TABLE table_35496 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponen" text,
"Score" text
) | Which Surface has a Score of 7 5, 6 4? | SELECT "Surface" FROM table_35496 WHERE "Score" = '7–5, 6–4' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id... | what are the top three common diagnoses that patients were diagnosed with within 2 months after having been diagnosed with pleural effusion nos in 2105? | 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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | what was the four most frequent specimen tests that patients had during the same month after they had been diagnosed with cerv spondyl w myelopath? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE 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,
... | how many patients whose admission year is less than 2154 and drug name is sw? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2154" AND prescriptions.drug = "SW" | mimicsql_data |
CREATE TABLE table_name_63 (
opponent VARCHAR,
date VARCHAR
) | Which opponent was playing on December 20, 1998? | SELECT opponent FROM table_name_63 WHERE date = "december 20, 1998" | sql_create_context |
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... | what were the top five most frequent diagnoses of the patients of age 40s a year before? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT... | eicu |
CREATE TABLE table_47734 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Which player was the high points scorer during the game with an end score of W 93-85? | SELECT "High points" FROM table_47734 WHERE "Score" = 'w 93-85' | wikisql |
CREATE TABLE table_name_5 (
opponent VARCHAR,
date VARCHAR
) | Who was the opponent on April 29? | SELECT opponent FROM table_name_5 WHERE date = "april 29" | sql_create_context |
CREATE TABLE table_69926 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | what tournament happened on march 27, 2006? | SELECT "Tournament" FROM table_69926 WHERE "Date" = 'march 27, 2006' | wikisql |
CREATE TABLE table_34278 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Name the average Bronze when silver is more than 3, gold is more than 1 and the total is 14 | SELECT AVG("Bronze") FROM table_34278 WHERE "Gold" > '1' AND "Total" = '14' AND "Silver" > '3' | wikisql |
CREATE TABLE table_name_13 (
water__sqmi_ INTEGER,
county VARCHAR,
ansi_code VARCHAR
) | Which Water (sqmi) has a County of benson, and an ANSI code smaller than 1759243? | SELECT MIN(water__sqmi_) FROM table_name_13 WHERE county = "benson" AND ansi_code < 1759243 | sql_create_context |
CREATE TABLE table_name_29 (
species_specific VARCHAR,
link VARCHAR,
comparative VARCHAR,
intra_molecular_structure VARCHAR
) | Which Species Specific has a Comparative of no, and an Intra-molecular structure of no, and a Link of sourcecode? | SELECT species_specific FROM table_name_29 WHERE comparative = "no" AND intra_molecular_structure = "no" AND link = "sourcecode" | sql_create_context |
CREATE TABLE table_name_70 (
home_away VARCHAR,
date VARCHAR
) | Which Home/Away was on April 27, 2008? | SELECT home_away FROM table_name_70 WHERE date = "april 27, 2008" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
... | Before CMPLXSYS 281 what courses do I need ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_name_15 (
nat VARCHAR,
name VARCHAR,
transfer_window VARCHAR,
type VARCHAR
) | Marcell Jansen with a transfer window of summer, and of transfer as type is from what nation? | SELECT nat FROM table_name_15 WHERE transfer_window = "summer" AND type = "transfer" AND name = "marcell jansen" | sql_create_context |
CREATE TABLE table_36906 (
"Club" text,
"Sport" text,
"Founded" real,
"League" text,
"Venue" text,
"Head Coach" text
) | Head Coach of wojciech kami ski is what club? | SELECT "Club" FROM table_36906 WHERE "Head Coach" = 'wojciech kamiński' | wikisql |
CREATE TABLE table_52801 (
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Points Diff" real,
"Points" real
) | I want the total number of points for against of 753 and points diff more than -114 | SELECT COUNT("Points") FROM table_52801 WHERE "Against" = '753' AND "Points Diff" > '-114' | wikisql |
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... | 列举出从2000年6月13日到2019年11月17日这段时间,编号为64770032的病患所有检验报告单中的标本采集部位? | SELECT jybgb.BBCJBW FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON 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.JZLSH_MZJZJLB WHERE hz_info.RYBH = '64770032' AND jybgb.BGRQ BETWEEN '2000-06-13' AND '201... | css |
CREATE TABLE table_name_74 (
apogee__km_ VARCHAR,
alt_name VARCHAR,
mass__kg_ VARCHAR
) | How many Apogee sis Ops-8285 with more than 1500 kg? | SELECT COUNT(apogee__km_) FROM table_name_74 WHERE alt_name = "ops-8285" AND mass__kg_ > 1500 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE txmzjzjlb (
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... | 2005年2月16日到2008年10月12日期间患者水嘉瑞所有检验报告单中的标本采集部位可以告诉我都在哪里吗? | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 WHERE person_info.XM = ... | css |
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 hz_info (
KH text,
KLX number... | 门诊诊断为疾病编号Y85.622的病人的低密度脂蛋白胆固醇的参考值界限下限和上限我可以看看吗? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'Y85.622' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇' UNION SELECT jyjgzbb.CKZ... | css |
CREATE TABLE table_204_535 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | which is the only rider with number 6 grid on the chart | SELECT "rider" FROM table_204_535 WHERE "grid" = 6 | squall |
CREATE TABLE table_15776 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | what is the score for the game on 21 april 2001? | SELECT "Score" FROM table_15776 WHERE "Date" = '21 april 2001' | wikisql |
CREATE TABLE table_23286158_8 (
game VARCHAR,
high_rebounds VARCHAR
) | Name the game for andre miller , rudy fernandez (7) | SELECT game FROM table_23286158_8 WHERE high_rebounds = "Andre Miller , Rudy Fernandez (7)" | sql_create_context |
CREATE TABLE table_204_275 (
id number,
"date" text,
"city" text,
"opponent" text,
"results" text,
"scorers" text,
"type of game" text
) | other than friendly games , how many games did serbia play in 2010 ? | SELECT COUNT(*) FROM table_204_275 WHERE "type of game" <> 'friendly' AND "date" = 2010 | squall |
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,... | 在病人27439695的医疗记录中,给他开出的药品金额小于8781.25元的医疗就诊有哪几次?编号是什么 | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '27439695' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 8781.25) | css |
CREATE TABLE table_204_72 (
id number,
"election year" number,
"# of\nconstituency votes" number,
"# of\nparty list votes" number,
"% of\nparty list votes" number,
"# of\noverall seats won" text,
"+/-" number
) | what was the number of party votes cast in 1987 ? | SELECT "# of\nparty list votes" FROM table_204_72 WHERE "election year" = 1987 | squall |
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 int,
from_airport varchar,
meal_code text,
stops int,... | show me flights from DALLAS to SAN FRANCISCO on WEDNESDAY | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND days.day_name = 'WEDNESDAY' AND flight.flight_days = days.days_c... | atis |
CREATE TABLE table_204_616 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
) | does alexandria county have a higher or lower population than delaware county ? | SELECT (SELECT "population" FROM table_204_616 WHERE "township" = 'alexandria') > (SELECT "population" FROM table_204_616 WHERE "township" = 'delaware') | squall |
CREATE TABLE table_74562 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
) | Tell me the tv time for attendance of 60,894 | SELECT "TV Time" FROM table_74562 WHERE "Attendance" = '60,894' | wikisql |
CREATE TABLE table_11636 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date did the home team score 9.10 (64)? | SELECT "Date" FROM table_11636 WHERE "Home team score" = '9.10 (64)' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,... | how many days have elapsed since the first time that patient 4401 had a tpn d13.0 intake on the current intensive care unit visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 4401) AND icustays.outtime IS NULL) A... | mimic_iii |
CREATE TABLE table_204_739 (
id number,
"districts" text,
"ubigeo" number,
"area\n(km2)" number,
"population" number,
"population density\n(/km2)" number,
"created" text,
"postal\ncode" number
) | how many districts are there in this city ? | SELECT COUNT("districts") FROM table_204_739 | squall |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | Find the number of the enrollment date for all the tests that have 'Pass' result, sort in asc by the Y. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) | nvbench |
CREATE TABLE table_name_50 (
yacht_name VARCHAR,
combined_elapsed_time VARCHAR
) | Which yacht name has a Combined elapsed time of 179d 11h 58m 14s? | SELECT yacht_name FROM table_name_50 WHERE combined_elapsed_time = "179d 11h 58m 14s" | sql_create_context |
CREATE TABLE table_36394 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) | How many Attendances have a Score of 4 5? Question 4 | SELECT MAX("Attendance") FROM table_36394 WHERE "Score" = '4 – 5' | wikisql |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
se... | Display a bar chart for how many rooms in each building have a capacity of over 50?, could you list from low to high by the X? | SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY building | nvbench |
CREATE TABLE table_203_314 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the total number of medals given ? | SELECT SUM("total") FROM table_203_314 | squall |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of last_name and department_id , and I want to list in descending by the X please. | SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE table_60296 (
"Team" text,
"CF appearances" real,
"CF wins" real,
"Cup wins" real,
"Last CF" real
) | What is the lowest number of last cfs of the team with 2 cf appearances, 0 cup wins, and less than 0 cf wins? | SELECT MIN("Last CF") FROM table_60296 WHERE "CF appearances" = '2' AND "Cup wins" = '0' AND "CF wins" < '0' | wikisql |
CREATE TABLE table_16753 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What circuit is the Vi Rhein-Pokalrennen race in? | SELECT "Circuit" FROM table_16753 WHERE "Race Name" = 'VI Rhein-Pokalrennen' | wikisql |
CREATE TABLE table_61447 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2012 of the hamburg masters? | SELECT "2012" FROM table_61447 WHERE "Tournament" = 'hamburg masters' | wikisql |
CREATE TABLE table_29414946_3 (
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | Why did Geninho leave as manager? | SELECT manner_of_departure FROM table_29414946_3 WHERE outgoing_manager = "Geninho" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 (
COUNT... | Show the department id and their salary using a scatter chart. | SELECT T1.SALARY, T1.DEPARTMENT_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID | nvbench |
CREATE TABLE table_46413 (
"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... | what is the average c/w 15+ when 18 to 19 is 132 and 65 to 69 is more than 1,869? | SELECT AVG("C/W 15+") FROM table_46413 WHERE "18 to 19" = '132' AND "65 to 69" > '1,869' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | give me the number of patients whose primary disease is newborn and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.fluid = "Ascites" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.