context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 jyjgzbb ( BGDH text, BGRQ tim...
患者22512141在14年10月25日至17年7月8日的补体C4指标记录
SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON 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 AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
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 ) ...
How many female patients have been diagnosed with syncope telemetry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "SYNCOPE;TELEMETRY"
mimicsql_data
CREATE TABLE table_65376 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Which Qual 1 has a Team of team player's, and a Best of 58.405?
SELECT "Qual 1" FROM table_65376 WHERE "Team" = 'team player''s' AND "Best" = '58.405'
wikisql
CREATE TABLE table_25519358_1 ( vertical_0_b VARCHAR, name VARCHAR )
Name the vertical for bian
SELECT vertical_0_b FROM table_25519358_1 WHERE name = "边 BIAN"
sql_create_context
CREATE TABLE table_67051 ( "Quarter" text, "Score" text, "Club" text, "Opponent" text, "Year" text, "Round" text, "Venue" text )
Which opponent has a Score of 15.4.94?
SELECT "Opponent" FROM table_67051 WHERE "Score" = '15.4.94'
wikisql
CREATE TABLE table_name_58 ( year VARCHAR, remark VARCHAR )
What year was remark #104 us?
SELECT year FROM table_name_58 WHERE remark = "#104 us"
sql_create_context
CREATE TABLE table_name_94 ( term_start VARCHAR, party VARCHAR )
What's the term start date for Meretz?
SELECT term_start FROM table_name_94 WHERE party = "meretz"
sql_create_context
CREATE TABLE table_39839 ( "Rank" text, "s Wicket" text, "Player" text, "Matches" text, "Average" text )
What is the average that has 441 as wicket?
SELECT "Average" FROM table_39839 WHERE "s Wicket" = '441'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
has patient 030-53416 been given a plasmapheresis procedure at another hospital in 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-53416' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-53416' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE table_name_67 ( team VARCHAR, year VARCHAR )
What is the team for 1976?
SELECT team FROM table_name_67 WHERE year = "1976"
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...
将病人秦芳华医疗费总额大于6792.26元的医疗记录中的入院诊断疾病的名称和编码列出来
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '秦芳华' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6792.26)
css
CREATE TABLE table_name_49 ( wins INTEGER, year VARCHAR, points VARCHAR )
What is the least amount of wins earlier than 1964 with more than 7 points?
SELECT MIN(wins) FROM table_name_49 WHERE year < 1964 AND points > 7
sql_create_context
CREATE TABLE table_16106 ( "Date" text, "Album name" text, "Track" text, "Track title" text, "Lyricist" text, "Music genre/style" text, "Major instrument(s)" text, "Lyrics theme/style" text, "Duration" text )
What is the total number of lyricist where the lyrics theme is romance and the song lasts 3:50?
SELECT COUNT("Lyricist") FROM table_16106 WHERE "Lyrics theme/style" = 'Romance' AND "Duration" = '3:50'
wikisql
CREATE TABLE table_25138 ( "Position" real, "1990\u20131991" text, "1991\u20131992" text, "1992\u20131993" text, "1993\u20131994" text, "1994\u20131995" text )
Who was ranked in the same position in 1990-1991 as Drew Kachtik in 1993-1994?
SELECT "1990\u20131991" FROM table_25138 WHERE "1993\u20131994" = 'Drew Kachtik'
wikisql
CREATE TABLE table_1342256_10 ( result VARCHAR, incumbent VARCHAR )
What was the result of Robert L. F. Sikes' election bid?
SELECT result FROM table_1342256_10 WHERE incumbent = "Robert L. F. Sikes"
sql_create_context
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...
5621712这个医疗机构在2005年5月30日之后的住院就诊记录中有多少入院登记的记录
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '5621712' AND zyjzjlb.RYDJSJ > '2005-05-30'
css
CREATE TABLE table_4873 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text )
During which round was the first defensive end with an overall rank larger than 186 drafted?
SELECT MIN("Round") FROM table_4873 WHERE "Overall" > '186' AND "Position" = 'defensive end'
wikisql
CREATE TABLE table_11734041_18 ( years_for_rockets VARCHAR, no_s_ VARCHAR )
Which years had a jersey number 55
SELECT years_for_rockets FROM table_11734041_18 WHERE no_s_ = "55"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
王清俊病患的检验报告单对应的检验结果指标均正常的一共有哪些?其检验报告单号是多少?
SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info...
css
CREATE TABLE table_58222 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
Which player is 6-2?
SELECT "Player" FROM table_58222 WHERE "Height" = '6-2'
wikisql
CREATE TABLE table_43540 ( "Round" real, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text )
When was the circuit portland international raceway?
SELECT "Date" FROM table_43540 WHERE "Circuit" = 'portland international raceway'
wikisql
CREATE TABLE table_26561508_1 ( patient_portrayer VARCHAR, directed_by VARCHAR, written_by VARCHAR )
What is the total number of patient portayers for the episode directed by Craig Zisk and written by Brad Falchuk?
SELECT COUNT(patient_portrayer) FROM table_26561508_1 WHERE directed_by = "Craig Zisk" AND written_by = "Brad Falchuk"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text )
What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor, and show by the bars from low to high.
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor
nvbench
CREATE TABLE table_79330 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What are the notes with the time 6:24.21?
SELECT "Notes" FROM table_79330 WHERE "Time" = '6:24.21'
wikisql
CREATE TABLE table_name_95 ( overall VARCHAR, date VARCHAR )
What is the Overall with a Date that is february 4, 1964?
SELECT overall FROM table_name_95 WHERE date = "february 4, 1964"
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...
那些年纪大于21岁的病患的医疗记录中其医务费总金额平均一下是多些?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE > 21 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE > 21 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE > 21 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON...
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...
在2007年12月20日到2016年9月1日间15522613这个患者买了几次西药?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '15522613' AND t_kc22.STA_DATE BETWEEN '2007-12-20' AND '2016-09-01' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Show me the total number by country in a histogram, and could you display by the x axis in asc?
SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY Country
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...
heparin (preservative free) is administered via which route?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Heparin (Preservative Free)"
mimicsql_data
CREATE TABLE table_name_44 ( date VARCHAR, killed VARCHAR, location VARCHAR )
What date has 2 for killed, and jaffa as the location?
SELECT date FROM table_name_44 WHERE killed = "2" AND location = "jaffa"
sql_create_context
CREATE TABLE table_name_60 ( home_team VARCHAR, away_team VARCHAR, year VARCHAR )
Which Home team has an Away team of al-ain fc, and a Year of 2002/03?
SELECT home_team FROM table_name_60 WHERE away_team = "al-ain fc" AND year = "2002/03"
sql_create_context
CREATE TABLE table_34073 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text )
What is the date of the game with an attendance of 19,183?
SELECT "Date" FROM table_34073 WHERE "Attendance" = '19,183'
wikisql
CREATE TABLE table_28066 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many touchdowns were the when there was more than 1.0 extra point?
SELECT "Touchdowns" FROM table_28066 WHERE "Extra points" > '1.0'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ...
what are the three most commonly ordered laboratory tests for patients who were previously diagnosed with crbl emblsm w infrct within the same month, during this year?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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.i...
mimic_iii
CREATE TABLE table_14006_1 ( bleeding_time VARCHAR, condition VARCHAR )
what's the bleeding time with condition being liver failure, end-stage
SELECT bleeding_time FROM table_14006_1 WHERE condition = "Liver failure, end-stage"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
when did patient 20033 have the last minimum ph value until 09/2104?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20033) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND STRFTIME('%y-%m', labevents.charttime) <= '2104-09' ORDER BY labevents...
mimic_iii
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
查一下在2011-01-07到2019-04-03这一期间,编号为8962316的医疗机构一共处理过几次异地就诊
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8962316' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-01-07' AND '2019-04-03' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
Calculate the number of patients with insertion of endotracheal tube who have an unspecified death status
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Insertion of endotracheal tube"
mimicsql_data
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...
when was patient 15107 last admitted to the hospital through the emergency room admit until 1 year ago?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 15107 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_204_637 ( id number, "type" text, "gauge" text, "railway" text, "works no." text, "year" text, "builder" text )
which railway was the only railway that hunslet taylor bulit a garratt for ?
SELECT "railway" FROM table_204_637 WHERE "builder" = 'hunslet-taylor'
squall
CREATE TABLE table_44246 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text )
Which Laps has a Points of lead changes: 13 between 8 drivers?
SELECT "Laps" FROM table_44246 WHERE "Points" = 'lead changes: 13 between 8 drivers'
wikisql
CREATE TABLE table_name_59 ( nationality VARCHAR, position VARCHAR, school_club_team VARCHAR )
What is the Nationality of the player who had Position of guard from School/Club Team Notre Dame?
SELECT nationality FROM table_name_59 WHERE position = "guard" AND school_club_team = "notre dame"
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 procedures ( ...
how many patients whose admission location is phys referral/normal deli and item id is 51035?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51035"
mimicsql_data
CREATE TABLE table_name_68 ( runners_up VARCHAR, semifinalists VARCHAR )
Whose Runner-up has a Semifinalist of guillermo p rez-rold n andrea gaudenzi?
SELECT runners_up FROM table_name_68 WHERE semifinalists = "guillermo pérez-roldán andrea gaudenzi"
sql_create_context
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 locations ( LOCATION_ID decimal(4,0...
For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the average of salary bin hire_date by weekday in a bar chart, display from low to high by the y axis.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
in the last hospital encounter what was the marital status of patient 88441?
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 88441 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_37115 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What outcome has yvonne vermaak as the opponent?
SELECT "Outcome" FROM table_37115 WHERE "Opponent" = 'yvonne vermaak'
wikisql
CREATE TABLE table_69516 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many points were scored against the club that drew 3 and scored 50 points?
SELECT "Points against" FROM table_69516 WHERE "Drawn" = '3' AND "Points" = '50'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
what number of patients are staying in the 181 ward last year?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 181 AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE table_29076 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real )
List all dates where South Florida was a visiting team.
SELECT "Date" FROM table_29076 WHERE "Visiting team" = 'South Florida'
wikisql
CREATE TABLE table_name_29 ( team VARCHAR, high_assists VARCHAR )
What is the team when alvin williams (6) has the high assists?
SELECT team FROM table_name_29 WHERE high_assists = "alvin williams (6)"
sql_create_context
CREATE TABLE table_3987 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
Who is the director when the production code is 60034?
SELECT "Directed by" FROM table_3987 WHERE "Production code" = '60034'
wikisql
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 ) ...
count the number of patients who have admitted before the year 2179 and stayed in the hospital for more than 29 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "29" AND demographic.admityear < "2179"
mimicsql_data
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( ...
Show how many delegates in each party with a bar chart, and sort in ascending by the Y-axis.
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY COUNT(T2.Party)
nvbench
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
Name all the ULCS classes for me .
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_14520977_1 ( week VARCHAR, location VARCHAR )
Name the week for kingdome
SELECT week FROM table_14520977_1 WHERE location = "Kingdome"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDat...
top sudanese developers in stackoverflow.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, CreationDate, LastAccessDate, Views FROM Users WHERE LOWER(Location) LIKE '%sudan%' ORDER BY Reputation DESC
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is minimum age of patients whose admission location is trsf within this facility and discharge location is rehab/distinct part hosp?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP"
mimicsql_data
CREATE TABLE table_name_74 ( score VARCHAR, runner_up VARCHAR, year VARCHAR )
In 1979 when Jimmy Connors was the runner-up what was the score?
SELECT score FROM table_name_74 WHERE runner_up = "jimmy connors" AND year < 1979
sql_create_context
CREATE TABLE table_11585313_1 ( name VARCHAR, number_of_goals VARCHAR )
What is the name of person that scored 10 goals?
SELECT name FROM table_11585313_1 WHERE number_of_goals = 10
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
count the number of patients whose marital status is single and procedure short title is insert 2 vascular stents?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.short_title = "Insert 2 vascular stents"
mimicsql_data
CREATE TABLE table_35059 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Who was the runner-up when the winning score was 28 (66-67-68-64-67=332)?
SELECT "Runner(s)-up" FROM table_35059 WHERE "Winning score" = '–28 (66-67-68-64-67=332)'
wikisql
CREATE TABLE table_14863 ( "Round" text, "Track" text, "Race 1" text, "Race 2" text, "Race 3" text )
What is the Race 2 result of Round 2?
SELECT "Race 2" FROM table_14863 WHERE "Round" = 'round 2'
wikisql
CREATE TABLE table_name_20 ( rank INTEGER, network VARCHAR, number_of_viewers VARCHAR )
Which Rank has a Network of bbc one, and a Number of Viewers of 30.15million? Question 2
SELECT SUM(rank) FROM table_name_20 WHERE network = "bbc one" AND number_of_viewers = "30.15million"
sql_create_context
CREATE TABLE table_name_67 ( college VARCHAR, position VARCHAR )
What college did the placekicker go to?
SELECT college FROM table_name_67 WHERE position = "placekicker"
sql_create_context
CREATE TABLE table_25597136_1 ( focal_plane_in_ft__m_ VARCHAR, tower_height_in_ft__m_ VARCHAR )
Where tower height in ft (m) is 46ft (14.0m) the focal plane is ft (m).
SELECT focal_plane_in_ft__m_ FROM table_25597136_1 WHERE tower_height_in_ft__m_ = "46ft (14.0m)"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text,...
Post with more than 5 answers using GROUP BY clause.
SELECT Id, AnswerCount FROM Posts GROUP BY Id, AnswerCount HAVING AnswerCount > 5 ORDER BY AnswerCount
sede
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
i'd like to fly early tomorrow from COLUMBUS to MINNEAPOLIS
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, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1000) AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
give me the number of patients whose primary disease is acidosis and year of death is less than or equal to 2131?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACIDOSIS" AND demographic.dod_year <= "2131.0"
mimicsql_data
CREATE TABLE table_204_383 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which nation came in first place ?
SELECT "nation" FROM table_204_383 WHERE "rank" = 1
squall
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is maximum days of hospital stay of patients whose primary disease is sepsis?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "SEPSIS"
mimicsql_data
CREATE TABLE table_42867 ( "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
What winning team did Jonathan bomarito drive for when jonathan summerton had the fastest lap?
SELECT "Winning team" FROM table_42867 WHERE "Winning driver" = 'jonathan bomarito' AND "Fastest Lap" = 'jonathan summerton'
wikisql
CREATE TABLE table_10169 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
What is the home team score when the away team was fitzroy?
SELECT "Home team score" FROM table_10169 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE table_name_31 ( grid INTEGER, driver VARCHAR )
What is the largest Grid with a Driver of piers courage?
SELECT MAX(grid) FROM table_name_31 WHERE driver = "piers courage"
sql_create_context
CREATE TABLE table_20655 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Foursomes W-L-H" text, "Fourballs W-L-H" text, "Points won" text, "Points %" text )
When the year was 1992, what were the points won?
SELECT "Points won" FROM table_20655 WHERE "Year" = '1992'
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 ...
那个在2001年11月11日到15年3月7日这段时间里,16229426病患的全部检察结果指标记录的检测人为66553479的检查指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE table_dev_25 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "alcohol_abuse" bool, "hypertension" bool, "NOUSE" float )
excessive alcohol intake
SELECT * FROM table_dev_25 WHERE alcohol_abuse = 1
criteria2sql
CREATE TABLE table_name_25 ( year VARCHAR, uk_albums VARCHAR )
15 albums were released in the UK during which year?
SELECT year FROM table_name_25 WHERE uk_albums = "15"
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_DIRE_CD text, MED_DIRE_NM text,...
9581134这家医院所有的就诊记载里,按照不一样的科室编号与入院时的诊断编码差别算一下民政补助部分与总医疗费用的最大比值并把结果按降序来排列
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9581134' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC
css
CREATE TABLE table_16432543_1 ( established VARCHAR, institution VARCHAR )
What is the year Rowan University was established
SELECT established FROM table_16432543_1 WHERE institution = "Rowan University"
sql_create_context
CREATE TABLE table_41435 ( "Date" text, "Location" text, "Country" text, "Event" text, "Winner" text, "Runner-up" text )
What is Runner-up, when Event is Mancora Peru Classic?
SELECT "Runner-up" FROM table_41435 WHERE "Event" = 'mancora peru classic'
wikisql
CREATE TABLE Payments ( payment_id INTEGER, booking_id INTEGER, customer_id INTEGER, payment_type_code VARCHAR(15), amount_paid_in_full_yn VARCHAR(1), payment_date DATETIME, amount_due DECIMAL(19,4), amount_paid DECIMAL(19,4) ) CREATE TABLE View_Product_Availability ( product_id INT...
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check, and count them by a line chart, show X from low to high order.
SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' GROUP BY payment_date ORDER BY payment_date
nvbench
CREATE TABLE table_29163303_2 ( year INTEGER, championship VARCHAR )
What is the earliest year in which the result is championship US Open (2)?
SELECT MIN(year) FROM table_29163303_2 WHERE championship = "US Open (2)"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, ...
All votes on the given post.
SELECT * FROM Votes WHERE PostId = '##PostId##'
sede
CREATE TABLE Customers_cards ( card_type_code VARCHAR, customer_id VARCHAR )
Show all card type codes and the number of customers holding cards in each type.
SELECT card_type_code, COUNT(DISTINCT customer_id) FROM Customers_cards GROUP BY card_type_code
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
find the number of patients under the age of 61 whose primary disease is coronary artery disease/coronary artery bypass graft/sda.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.age < "61"
mimicsql_data
CREATE TABLE table_name_44 ( capacity INTEGER, club VARCHAR )
What is the largest capacity for the stadium for Treviso club?
SELECT MAX(capacity) FROM table_name_44 WHERE club = "treviso"
sql_create_context
CREATE TABLE table_name_90 ( position INTEGER, team VARCHAR, against VARCHAR )
What was the position for team corinthians with over 14 against?
SELECT AVG(position) FROM table_name_90 WHERE team = "corinthians" AND against > 14
sql_create_context
CREATE TABLE table_name_24 ( byes INTEGER, against VARCHAR, mininera_dfl VARCHAR, wins VARCHAR, losses VARCHAR )
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_name_24 WHERE wins < 16 AND losses = 8 AND mininera_dfl = "penshurst" AND against < 1405
sql_create_context
CREATE TABLE tourist_attractions ( tourist_attraction_id number, attraction_type_code text, location_id number, how_to_get_there text, name text, description text, opening_hours text, other_details text ) CREATE TABLE theme_parks ( theme_park_id number, theme_park_details text )...
Find the total number of available hotels.
SELECT COUNT(*) FROM hotels
spider
CREATE TABLE table_65476 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text )
What is the IHSAA class when the county was 83 vermillion?
SELECT "IHSAA Class" FROM table_65476 WHERE "County" = '83 vermillion'
wikisql
CREATE TABLE table_name_80 ( type VARCHAR, tamil_name VARCHAR )
What is the Tamil Name of ( 2)?
SELECT type FROM table_name_80 WHERE tamil_name = "சந்திர புத்தாண்டு (தினம் 2)"
sql_create_context
CREATE TABLE table_53934 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What Driver has 1 in Grid?
SELECT "Driver" FROM table_53934 WHERE "Grid" = '1'
wikisql
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,...
tell me the number of patients diagnosed with congenital stenosis of pulmonary valve who were hospitalized for more than 4 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "4" AND diagnoses.long_title = "Stenosis of pulmonary valve, congenital"
mimicsql_data
CREATE TABLE table_52831 ( "Name" text, "Species" text, "Overview" text, "Introduced" text, "Feral" text, "Threat level" text )
What is the Threat Levels with Rabbits in Australia?
SELECT "Threat level" FROM table_52831 WHERE "Overview" = 'rabbits in australia'
wikisql
CREATE TABLE table_69435 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "IHSAA Class" text, "Year Joined" real, "Previous Conference" text )
what's the mascot for 66 pulaski 2?
SELECT "Mascot" FROM table_69435 WHERE "# / County" = '66 pulaski 2'
wikisql
CREATE TABLE user_profiles ( name VARCHAR, email VARCHAR )
Find the names of users whose emails contain superstar or edu .
SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
since 11/07/2104, what is average value of respiration for patient 006-99708?
SELECT AVG(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-99708')) AND NOT vitalperiodic.respiration IS ...
eicu
CREATE TABLE table_21221 ( "Province" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
How many values are in the ends won cell corresponding to a PA of 39?
SELECT COUNT("Ends Won") FROM table_21221 WHERE "PA" = '39'
wikisql
CREATE TABLE Customer_Contact_Channels ( customer_id INTEGER, channel_code VARCHAR(15), active_from_date DATETIME, active_to_date DATETIME, contact_number VARCHAR(50) ) CREATE TABLE Addresses ( address_id INTEGER, address_content VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(2...
A bar chart for what are the number of the dates when customers with ids between 10 and 20 became customers?, list the number of date became customer in descending order.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench