context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_49616 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What is Tournament, when Date is 'Sep 25, 1977'?
SELECT "Tournament" FROM table_49616 WHERE "Date" = 'sep 25, 1977'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id...
Schema of Stack Exchange data dump. http://meta.stackexchange.com/questions/287120/schema-of-stack-exchange-data-dump
SELECT * FROM Posts WHERE PostTypeId = 6 AND CreationDate BETWEEN '2014-02-10' AND '2014-02-25'
sede
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients diagnosed with long term use of steroids were admitted in emergency?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Long-term use steroids"
mimicsql_data
CREATE TABLE table_name_13 ( location VARCHAR, winning_skip VARCHAR )
What location did Sherry Middaugh win in?
SELECT location FROM table_name_13 WHERE winning_skip = "sherry middaugh"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE chartevents ( row_id number, subject_id number, had...
count the number of patients who received arterial catheterization within 2 months after a diagnosis of malfunc cardiac pacemake since 3 years ago.
SELECT COUNT(DISTINCT t1.subject_id) 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_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'malfunc cardiac pa...
mimic_iii
CREATE TABLE table_35944 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
Which Date has a Record of 58 10?
SELECT "Date" FROM table_35944 WHERE "Record" = '58–10'
wikisql
CREATE TABLE table_39842 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2008 Candidates" text, "Results" text )
What is the 2008 Candidates Elected before 1994 with Incumbent Jim McDermott?
SELECT "2008 Candidates" FROM table_39842 WHERE "Elected" < '1994' AND "Incumbent" = 'jim mcdermott'
wikisql
CREATE TABLE table_name_15 ( silver INTEGER, nation VARCHAR, gold VARCHAR )
How many silvers for south korea with under 1 gold medal?
SELECT MAX(silver) FROM table_name_15 WHERE nation = "south korea" AND gold < 1
sql_create_context
CREATE TABLE table_16440 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
How many episodes had 16.03 million viewers?
SELECT COUNT("No. in series") FROM table_16440 WHERE "U.S. viewers (millions)" = '16.03'
wikisql
CREATE TABLE table_name_53 ( blank_ends INTEGER, stolen_ends VARCHAR, ends_won VARCHAR )
When ends won were below 57 but stolen ends are more than 14, what's the highest blank ends found?
SELECT MAX(blank_ends) FROM table_name_53 WHERE stolen_ends > 14 AND ends_won < 57
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
what is the name of the drug that patient 30296 had been prescribed two times in 05/this year?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30296) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 ye...
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( ...
how many times was desmopressin nasal prescribed since 2 years ago?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'desmopressin nasal' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-2 year')
mimic_iii
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 )
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, I want to list in asc by the Y.
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.Code
nvbench
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 ...
what was the name of the drug patient 25696 was prescribed for during the same hospital visit after having undergone a cont inv mec ven <96 hrs procedure in 03/last year?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 25696 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE table_35083 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
Which Nationality of the person has a Position on left wing?
SELECT "Nationality" FROM table_35083 WHERE "Position" = 'left wing'
wikisql
CREATE TABLE table_77975 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Away team score has a Venue of kardinia park?
SELECT "Away team score" FROM table_77975 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE table_185 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text )
How many total rounds did Damon Hill come in First Place?
SELECT COUNT("Round") FROM table_185 WHERE "Winning Driver" = 'Damon Hill'
wikisql
CREATE TABLE table_15780 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
Which week did the Seattle Seahawks have a record of 6-6?
SELECT AVG("Week") FROM table_15780 WHERE "Record" = '6-6'
wikisql
CREATE TABLE table_name_40 ( time VARCHAR, laps VARCHAR, rider VARCHAR )
Which Time has Laps smaller than 28, and a Rider of nicky hayden?
SELECT time FROM table_name_40 WHERE laps < 28 AND rider = "nicky hayden"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
医疗机构5267326超过27天的住院天数的人有多少?
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '5267326' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 27 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = ...
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
tell me what were the top five most common procedures of the patients in the 30s since 2100?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', treatment.treatmenttime) >= '2100' GROUP BY treatment....
eicu
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
Age when deleted - experimental.
SELECT * FROM Posts WHERE Id = 43386
sede
CREATE TABLE table_name_54 ( assist_pass VARCHAR, date VARCHAR, score VARCHAR )
What is the assist/pass on 2008-01-16 when the score was 2-0?
SELECT assist_pass FROM table_name_54 WHERE date = "2008-01-16" AND score = "2-0"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
知不知道住院就诊18256092603的门诊中医诊断编号是什么
SELECT MZZYZDZZBM FROM zyjzjlb WHERE JZLSH = '18256092603'
css
CREATE TABLE table_name_83 ( total INTEGER, finish VARCHAR, player VARCHAR )
What is the average total of player hale irwin, who had a t52 finish?
SELECT AVG(total) FROM table_name_83 WHERE finish = "t52" AND player = "hale irwin"
sql_create_context
CREATE TABLE table_75879 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the score of the game when the record was 39 21 4?
SELECT "Score" FROM table_75879 WHERE "Record" = '39–21–4'
wikisql
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, ...
在医院8978261中,以出院诊断疾病编码为依据,查出不同疾病患者的平均年龄
SELECT t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8978261' GROUP BY t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在整个医疗记录中医院编号3850390的住院诊断为躁狂抑郁性精神病当前为抑郁相的人花的最低和最高医疗费总额是多少元?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '3850390' AND t_kc24.t_kc21_IN_DIAG_DIS_NM = '躁狂抑郁性精神病当前为抑郁相')
css
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose diagnoses short title is acidosis and lab test fluid is pleural?
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 = "Acidosis" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_1876262_10 ( other_mozilla VARCHAR, firefox VARCHAR )
If Firefox is 30.45%, what is the other Mozilla amount?
SELECT other_mozilla FROM table_1876262_10 WHERE firefox = "30.45%"
sql_create_context
CREATE TABLE table_41440 ( "Season" text, "Conference" text, "Division" text, "Finish" text, "Wins" real, "Losses" real, "Win%" real )
Which finish had a win percentage that was more than 0.598 and also had less than 53 wins?
SELECT "Finish" FROM table_41440 WHERE "Win%" > '0.598' AND "Wins" < '53'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在2007年12月12日到2020年1月21日内患者34563100就诊过多少个医生?
SELECT COUNT(mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_...
css
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在2013年6月16号到2020年3月24号期间内,列出医院4189636开出的检验报告单中,不同检测指标名称还有不同检测指标结果定量单位下,并且保留平均值最大的11项的检测指标结果定量的平均值是多大?
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '4189636' AND jyjgzbb.BGRQ BETWEEN '2013-06-16' AND '2020-03...
css
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 procedures ( ...
give me the time at which patient with patient id 81923 was admitted to hospital.
SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "81923"
mimicsql_data
CREATE TABLE table_name_97 ( home_team VARCHAR, venue VARCHAR )
What is the Home Team Score at VFL Park?
SELECT home_team AS score FROM table_name_97 WHERE venue = "vfl park"
sql_create_context
CREATE TABLE table_name_5 ( year INTEGER, title VARCHAR )
WHAT IS THE YEAR OF FLOETIC?
SELECT SUM(year) FROM table_name_5 WHERE title = "floetic"
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '魏梦凡' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_71 ( country VARCHAR, score VARCHAR )
Which country has the score 70-76-68-214?
SELECT country FROM table_name_71 WHERE score = "70-76-68-214"
sql_create_context
CREATE TABLE zyb ( 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...
在两千年三月二号到零九年九月十三号期间,04270747这名患者在医院7760452被开的所有的药的编号和药物名称都列一下
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '04270747' AND qtb.MED_SER_ORG_NO = '7760452' AND qtb.IN_HOSP_DATE BETWEEN '2000-03-02' AND '2009-09-13' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = ...
css
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
very much' questions.
SELECT c.Id AS "comment_link" FROM Comments AS c WHERE c.Text LIKE '%very much%' ORDER BY c.CreationDate
sede
CREATE TABLE table_42439 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score in the final" text )
What surface has natalia gussoni as the partner?
SELECT "Surface" FROM table_42439 WHERE "Partner" = 'natalia gussoni'
wikisql
CREATE TABLE table_30313 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
Where was the tour when jing junhong li jiawei played womens doubles?
SELECT "Year Location" FROM table_30313 WHERE "Womens Doubles" = 'Jing Junhong Li Jiawei'
wikisql
CREATE TABLE table_38209 ( "Character Name" text, "Voice Actor (Japanese)" text, "Voice Actor (English 1997 / Saban)" text, "Voice Actor (English 1998 / Pioneer)" text, "Voice Actor (English 2006 / FUNimation)" text )
what character did Laara sadiq play
SELECT "Character Name" FROM table_38209 WHERE "Voice Actor (English 1998 / Pioneer)" = 'laara sadiq'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
在编号为97271307283的这次医疗就诊中,大病支付金是多少
SELECT t_kc24.ILL_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '97271307283'
css
CREATE TABLE table_12116 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
WHAT ARE THE BYES WITH A WIN SMALLER THAN 16, 8 LOSSES, AND AT PENSHURST, WITH AGAINST SMALLER THAN 1405?
SELECT SUM("Byes") FROM table_12116 WHERE "Wins" < '16' AND "Losses" = '8' AND "Mininera DFL" = 'penshurst' AND "Against" < '1405'
wikisql
CREATE TABLE table_33902 ( "Denomination" text, "Metal" text, "Weight" text, "Shape" text, "Size" text )
What is the size that has nickel as the metal, and one rupee as the denomination?
SELECT "Size" FROM table_33902 WHERE "Metal" = 'nickel' AND "Denomination" = 'one rupee'
wikisql
CREATE TABLE table_name_38 ( method VARCHAR, opponent VARCHAR )
Which method was used when Alessio Sakara was the opponent?
SELECT method FROM table_name_38 WHERE opponent = "alessio sakara"
sql_create_context
CREATE TABLE table_25546 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "Margin of victory" text, "Tournament location" text, "Purse ( $ )" real, "Winners share ($)" real )
When was the tournament in Forest Lake Country Club held?
SELECT "Dates" FROM table_25546 WHERE "Tournament location" = 'Forest Lake Country Club'
wikisql
CREATE TABLE table_name_92 ( gold INTEGER, nation VARCHAR )
What is the fewest gold medals won by Greece?
SELECT MIN(gold) FROM table_name_92 WHERE nation = "greece"
sql_create_context
CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255...
Show each state and the number of addresses in each state Show bar chart, rank X in desc order.
SELECT state_province_county, COUNT(*) FROM Addresses GROUP BY state_province_county ORDER BY state_province_county DESC
nvbench
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 much is the minimum hospital bill that includes bradycardia?
SELECT MIN(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 = 'bradycardia')) GROUP BY cost.patienthealthsy...
eicu
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( pap...
who has the most publications in question answering ?
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'question answering' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY ...
scholar
CREATE TABLE table_name_19 ( result VARCHAR, date VARCHAR )
What is the result for the game on May 27, 2006?
SELECT result FROM table_name_19 WHERE date = "may 27, 2006"
sql_create_context
CREATE TABLE table_14785 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Which totals tournament has the lowest wins and top-25 less than 4?
SELECT MIN("Wins") FROM table_14785 WHERE "Tournament" = 'totals' AND "Top-25" < '4'
wikisql
CREATE TABLE table_24222929_3 ( original_airdate VARCHAR, episode_number_production_number VARCHAR )
When did the fourth episode of the season (4 1-04) first air?
SELECT original_airdate FROM table_24222929_3 WHERE episode_number_production_number = "4 1-04"
sql_create_context
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart, and display from low to high by the y axis.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_48501 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What result had a time of 1:02?
SELECT "Result" FROM table_48501 WHERE "Time" = '1:02'
wikisql
CREATE TABLE table_name_5 ( money___$__ VARCHAR, score VARCHAR )
How much money does the player with a score of 74-71-76-76=297 have?
SELECT money___$__ FROM table_name_5 WHERE score = 74 - 71 - 76 - 76 = 297
sql_create_context
CREATE TABLE table_41984 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
What is the set 5 of the match with a set 2 of 26-24 and a set 1 of 27-25?
SELECT "Set 5" FROM table_41984 WHERE "Set 2" = '26-24' AND "Set 1" = '27-25'
wikisql
CREATE TABLE table_26060884_2 ( burglary VARCHAR, forcible_rape VARCHAR )
How many burglary crimes were committed if the forcible rapes were 1233?
SELECT burglary FROM table_26060884_2 WHERE forcible_rape = 1233
sql_create_context
CREATE TABLE table_61438 ( "Draft" real, "Round" real, "Pick" real, "Player" text, "Nationality" text )
What is the average draft with a pick larger than 42, and player Grant Eakin after round 8?
SELECT AVG("Draft") FROM table_61438 WHERE "Pick" > '42' AND "Player" = 'grant eakin' AND "Round" > '8'
wikisql
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 me the number of patients whose diagnoses short title is chr kidney dis stage iv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr kidney dis stage IV"
mimicsql_data
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 regions ( REGION_ID decimal(5,0), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and department_id , and visualize them by a bar chart, rank by the bars from low to high please.
SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE table_35293 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What is the winning scor of the tournament with Robin Walton as the runner-up?
SELECT "Winning score" FROM table_35293 WHERE "Runner(s)-up" = 'robin walton'
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 ...
when did patient 10211 since 2104 leave the hospital for the last time?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 10211 AND STRFTIME('%y', admissions.dischtime) >= '2104' ORDER BY admissions.dischtime DESC LIMIT 1
mimic_iii
CREATE TABLE department_stores ( dept_store_chain_id VARCHAR )
What are the ids of the two department store chains with the largest number of department stores?
SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY COUNT(*) DESC LIMIT 2
sql_create_context
CREATE TABLE table_46270 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text )
What team has brad miller (8) as the high assists?
SELECT "Team" FROM table_46270 WHERE "High assists" = 'brad miller (8)'
wikisql
CREATE TABLE table_27882867_9 ( high_points VARCHAR, high_assists VARCHAR )
How many people had the high points when a. webb (7) had the high assists?
SELECT COUNT(high_points) FROM table_27882867_9 WHERE high_assists = "A. Webb (7)"
sql_create_context
CREATE TABLE table_name_1 ( tied VARCHAR, drawn VARCHAR )
Name the tie that has 71 drawn
SELECT tied FROM table_name_1 WHERE drawn = "71"
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,...
在医院0529710所有的记录里按科室与出院诊断编码的不同列出来病人的平均年纪
SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0529710' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD
css
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
列出患者20499920在10年5月11日到20年4月9日内被开出的所有检验报告单的检验报告单号是多少?
(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.RYBH = '20499920' AND jybgb.BGRQ BETWEEN '2010-05-11' AND '2020-04-09') UNI...
css
CREATE TABLE table_name_10 ( player VARCHAR, total VARCHAR, to_par VARCHAR )
Which player has a total bigger than 285 and a to par of +14?
SELECT player FROM table_name_10 WHERE total > 285 AND to_par = "+14"
sql_create_context
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 ) ...
how many of the newborn admissions had item id 51300?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "51300"
mimicsql_data
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...
Stacked bar chart of team_id for with each ACC_Home in each acc road, sort by the Y in asc.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID
nvbench
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
ENGR 523 , how long has it been offered for ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ENGR' AND course.number = 523 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE table_name_77 ( nation VARCHAR, gold VARCHAR, silver VARCHAR, bronze VARCHAR )
Which Nation has Silver smaller than 16, Bronze larger than 6, and Gold of 2?
SELECT nation FROM table_name_77 WHERE silver < 16 AND bronze > 6 AND gold = 2
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me the comparison about Team_ID over the Team_Name by a bar chart, and could you rank in ascending by the bar please?
SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What 300 -level courses are available in Fall or Winter terms ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of...
advising
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_DIRE_CD text, MED_DIRE_NM text,...
统计一下医疗记录中年龄15岁及以上的患者的平均治病费总额有多少钱?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 15)
css
CREATE TABLE table_name_58 ( place INTEGER, english_translation VARCHAR )
Which Place has an English translation of lullaby for my beloved?
SELECT MAX(place) FROM table_name_58 WHERE english_translation = "lullaby for my beloved"
sql_create_context
CREATE TABLE table_59513 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
What Shooter has a Total of 28?
SELECT "Shooter" FROM table_59513 WHERE "Total" = '28'
wikisql
CREATE TABLE table_4924 ( "Player" text, "Span" text, "Lost" text, "Draw" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text )
How many pens does Siaosi Atiola have?
SELECT "Pens" FROM table_4924 WHERE "Player" = 'siaosi atiola'
wikisql
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 minimum age of patients whose admission location is trsf within this facility and primary disease is s/p fall?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "S/P FALL"
mimicsql_data
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
在医院0057877从00年12月30号起到12年5月22号这段时间内开出的那些检验报告单内,不一样检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值是多少呢?
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '0057877' AND BGRQ BETWEEN '2000-12-30' AND '2012-05-22' GROUP BY JCZBMC, JCZBJGDW
css
CREATE TABLE table_name_90 ( opponent VARCHAR, results¹ VARCHAR )
Who did Yugoslavia play against that led to a result of 2:3?
SELECT opponent FROM table_name_90 WHERE results¹ = "2:3"
sql_create_context
CREATE TABLE table_50918 ( "Episode" text, "Air Date" text, "Timeslot" text, "18-49" text, "Viewers" real )
What was the air date of 'Gary tries to do it all'?
SELECT "Air Date" FROM table_50918 WHERE "Episode" = 'gary tries to do it all'
wikisql
CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade 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 TABLE student ( stu_num number, stu_lname text...
What are the last name and office of all history professors?
SELECT T1.emp_lname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History'
spider
CREATE TABLE albums ( id INTEGER, title VARCHAR(160), artist_id INTEGER ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, hire_date TIMESTAMP, address VARCHAR(70), city VARCH...
List the number of invoices from the US, grouped by state by a bar chart, and list X from high to low order.
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY billing_state DESC
nvbench
CREATE TABLE table_54965 ( "State" text, "Interview" real, "Swimsuit" real, "Evening gown" real, "Average" real )
What is the sum of the evening gown scores where the interview score is less than 8.77, the swimsuit score is equal to 7.8, and the average score is less than 8.2?
SELECT SUM("Evening gown") FROM table_54965 WHERE "Interview" < '8.77' AND "Swimsuit" = '7.8' AND "Average" < '8.2'
wikisql
CREATE TABLE table_70395 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Before the year 1988, what is the lowest number of points that entrant Coloni SpA scored?
SELECT MIN("Points") FROM table_70395 WHERE "Entrant" = 'coloni spa' AND "Year" < '1988'
wikisql
CREATE TABLE injury_accident ( SOURCE VARCHAR )
How many different kinds of information sources are there for injury accidents?
SELECT COUNT(DISTINCT SOURCE) FROM injury_accident
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Users where location = melbourne.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('melbourne') ORDER BY Reputation DESC
sede
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, ...
how did since 2101 patient 9297 last enter the hospital?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 9297 AND STRFTIME('%y', admissions.admittime) >= '2101' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_59400 ( "State" text, "Born/Died" text, "Active service" text, "Chief Judge" text, "Senior status" text, "Appointed by" text, "Reason for termination" text )
Which Chief Judge has Appointed by of reagan category:articles with hcards?
SELECT "Chief Judge" FROM table_59400 WHERE "Appointed by" = 'reagan category:articles with hcards'
wikisql
CREATE TABLE table_37025 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
Which Venue has a Notes of heptathlon, and a Year of 1991?
SELECT "Venue" FROM table_37025 WHERE "Notes" = 'heptathlon' AND "Year" = '1991'
wikisql
CREATE TABLE table_2102898_1 ( episode VARCHAR, run_time VARCHAR )
How many episodes ran 24:33?
SELECT COUNT(episode) FROM table_2102898_1 WHERE run_time = "24:33"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
ORDER BY - first posts by CreationDate.
SELECT Id, CreationDate, Title, Body FROM dbo.Posts ORDER BY CreationDate LIMIT 10
sede
CREATE TABLE table_name_1 ( colony_name VARCHAR, date_founded VARCHAR )
Which Colony Name was Founded on january 19, 2012?
SELECT colony_name FROM table_name_1 WHERE date_founded = "january 19, 2012"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
give me the number of patients whose ethnicity is black/cape verdean and days of hospital stay is greater than 8?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "8"
mimicsql_data
CREATE TABLE table_61235 ( "Ship" text, "Hull Number" text, "Laid down" text, "Launched" text, "Commissioned" text )
What is Laid Down, when Commissioned is '11 November 1989'?
SELECT "Laid down" FROM table_61235 WHERE "Commissioned" = '11 november 1989'
wikisql