context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_92 ( decade VARCHAR, artist VARCHAR )
What decade is the artist the replacements?
SELECT decade FROM table_name_92 WHERE artist = "the replacements"
sql_create_context
CREATE TABLE table_name_23 ( wednesday VARCHAR, saturday VARCHAR )
Which Wednesday has a Saturday of ?
SELECT wednesday FROM table_name_23 WHERE saturday = "གཟའ་སྤེན་པ།"
sql_create_context
CREATE TABLE table_1520559_1 ( country VARCHAR, margin_of_victory VARCHAR )
Which countries won by 9 strokes?
SELECT country FROM table_1520559_1 WHERE margin_of_victory = "9 strokes"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what are the top four frequent drugs prescribed to patients within the same hospital visit after they were prescribed potassium chloride 40 meq/100 ml iv piggy back : 100 ml bag during the previous year?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'potassium chlori...
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,...
how many patients whose drug code is lora2i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LORA2I"
mimicsql_data
CREATE TABLE table_2967 ( "Year" real, "Champions" text, "Runners-up" text, "Score in the final" text, "3rd-place" text, "4th-place" text )
What was the score in the final the year that the 3rd place team was Bangkok University FC?
SELECT "Score in the final" FROM table_2967 WHERE "3rd-place" = 'Bangkok University FC'
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, ...
患者的检测指标487632的参考值范围在哪个区间内可以被门诊诊断为慢性咽炎
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性咽炎' AND jyjgzbb.JCZBDM = '487632'
css
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...
列出在医院2926207中患者45461281门诊诊断名称不包含硅肺有哪些门诊就诊记录?
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '45461281' AND hz_info.YLJGDM = '2926207' AND NOT mzjzjlb.JZZDSM LIKE '%硅肺%'
css
CREATE TABLE mzb ( 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...
患者葛星光医保的个人账户总共被花了多少,时间是从11年4月5日到20年7月4日
SELECT SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '葛星光' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-04-05' AND '2020-07-04' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '葛星光' A...
css
CREATE TABLE table_name_41 ( date VARCHAR, score VARCHAR )
What is the date of the game with a score of 4-3?
SELECT date FROM table_name_41 WHERE score = "4-3"
sql_create_context
CREATE TABLE table_203_563 ( id number, "#" number, "judge" text, "state" text, "born/died" text, "active" text, "chief" text, "senior" text, "appointed by" text, "reason for\ntermination" text )
who was the next judge to resign after alexander campbell king ?
SELECT "judge" FROM table_203_563 WHERE "reason for\ntermination" = 'resignation' AND "#" > (SELECT "#" FROM table_203_563 WHERE "judge" = 'alexander campbell king') ORDER BY "#" LIMIT 1
squall
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 demographic (...
calculate the maximum days for which elective hospital admission patients stayed in hospital.
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
calculate patient 012-84977's duration of the last stay in the icu.
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-84977') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_66 ( championship VARCHAR, date VARCHAR )
What Championship has a Date of 26 may 1986?
SELECT championship FROM table_name_66 WHERE date = "26 may 1986"
sql_create_context
CREATE TABLE table_name_59 ( tournament VARCHAR )
What is the tournament with a 2006 value of A and a 2011 value of 3r?
SELECT tournament FROM table_name_59 WHERE 2006 = "a" AND 2011 = "3r"
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city...
Which ULCS requirement courses are available in the Fall or Winter
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE table_58164 ( "Platform" real, "Frequency (per hour)" real, "Destination" text, "Operator" text, "Line" text )
what is the highest platform number when the frequency (per hour) is 4, the operator is london overground and the destination is west croydon?
SELECT MAX("Platform") FROM table_58164 WHERE "Frequency (per hour)" = '4' AND "Operator" = 'london overground' AND "Destination" = 'west croydon'
wikisql
CREATE TABLE table_name_7 ( screen_size VARCHAR, pixels VARCHAR, dimensions_w×h×d__mm_ VARCHAR )
What is the screen size and pixel value when the dimensions are 115.5 83.7 102.5?
SELECT screen_size, pixels FROM table_name_7 WHERE dimensions_w×h×d__mm_ = "115.5×83.7×102.5"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose diagnoses short title is alkalosis and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Alkalosis" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_14762 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text )
Which 1st Party has an Election of 1849 by-election?
SELECT "1st Party" FROM table_14762 WHERE "Election" = '1849 by-election'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
病患50606376在2011-11-27之后做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '50606376' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2011-11-27' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE festival_detail ( Festival_Name VARCHAR, YEAR VARCHAR )
What are the names of festivals held in year 2007?
SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007
sql_create_context
CREATE TABLE table_127511_1 ( sequencer VARCHAR, ion_torrent_pgm VARCHAR )
What is the sequencer when ion torrent pgm is 200-400 bp?
SELECT sequencer FROM table_127511_1 WHERE ion_torrent_pgm = "200-400 bp"
sql_create_context
CREATE TABLE table_10477224_1 ( sepal_length VARCHAR, sepal_width VARCHAR, petal_length VARCHAR )
Name the sepal length for sepal width of 2.8 and petal length of 5.1
SELECT sepal_length FROM table_10477224_1 WHERE sepal_width = "2.8" AND petal_length = "5.1"
sql_create_context
CREATE TABLE table_name_41 ( total INTEGER, player VARCHAR, to_par VARCHAR )
Player of corey pavin, and a To par larger than 5 has what average total?
SELECT AVG(total) FROM table_name_41 WHERE player = "corey pavin" AND to_par > 5
sql_create_context
CREATE TABLE table_62733 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of rank with more than 1 silver medal, 1 gold medal, and less than 6?
SELECT SUM("Rank") FROM table_62733 WHERE "Silver" > '1' AND "Gold" = '1' AND "Total" < '6'
wikisql
CREATE TABLE staff ( staff_id number, staff_details text ) CREATE TABLE claims_processing_stages ( claim_stage_id number, next_claim_stage_id number, claim_status_name text, claim_status_description text ) CREATE TABLE claim_headers ( claim_header_id number, claim_status_code text, ...
Which customer made the smallest amount of claim in one claim? Return the customer details.
SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT MIN(amount_piad) FROM claim_headers)
spider
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...
姓名是曹云飞的患者分别在哪几次医疗记录中被开出的药品金额都少于了6638.96元?就诊时的编号是什么?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '曹云飞' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6638.96)
css
CREATE TABLE table_20001 ( "Year" text, "Dates" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winners share ($)" real )
When are all dates with a score of 205 ( 8) in Australia?
SELECT "Dates" FROM table_20001 WHERE "Score" = '205 (–8)' AND "Country" = 'Australia'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id...
what are the five most commonly given diagnoses for patients who previously received packed cell transfusion during the same month in 2103?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
What are the numbers of wines for different grapes Plot them as bar chart, show by the the total number in ascending.
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_15 ( original_season VARCHAR, placing VARCHAR )
What's the original season in 11th place?
SELECT original_season FROM table_name_15 WHERE placing = "11th place"
sql_create_context
CREATE TABLE table_27537870_6 ( game INTEGER, january VARCHAR )
If the game was on January 21, which game was it?
SELECT MAX(game) FROM table_27537870_6 WHERE january = 21
sql_create_context
CREATE TABLE hosting_city ( host_city VARCHAR, match_id VARCHAR ) CREATE TABLE MATCH ( venue VARCHAR, match_id VARCHAR, competition VARCHAR ) CREATE TABLE city ( city_id VARCHAR, city VARCHAR )
What is the venue of the competition '1994 FIFA World Cup qualification' hosted by 'Nanjing ( Jiangsu )'?
SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
sql_create_context
CREATE TABLE table_name_67 ( save VARCHAR, score VARCHAR )
What is the save of the game with a 7-6 score?
SELECT save FROM table_name_67 WHERE score = "7-6"
sql_create_context
CREATE TABLE table_52310 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is the average ERP W when the call sign is whre?
SELECT AVG("ERP W") FROM table_52310 WHERE "Call sign" = 'whre'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodici...
how many hours has elapsed since patient 021-79544 stayed in ward 798 for the last time in the during the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-79544' AND patient.wardid = 798 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE qtb ( 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...
这个医疗就诊17047326007的总医疗费一共花了多少?
SELECT qtb.MED_AMOUT FROM qtb WHERE qtb.MED_CLINIC_ID = '17047326007' UNION SELECT gyb.MED_AMOUT FROM gyb WHERE gyb.MED_CLINIC_ID = '17047326007' UNION SELECT zyb.MED_AMOUT FROM zyb WHERE zyb.MED_CLINIC_ID = '17047326007' UNION SELECT mzb.MED_AMOUT FROM mzb WHERE mzb.MED_CLINIC_ID = '17047326007'
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 ) ...
Out of the total number of patients diagnosed with hx of GI malignancy nos, how many of them were married?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "Hx of GI malignancy NOS"
mimicsql_data
CREATE TABLE table_name_51 ( date VARCHAR, game VARCHAR )
Can you tell me the Date that has the Game of 2?
SELECT date FROM table_name_51 WHERE game = 2
sql_create_context
CREATE TABLE table_name_93 ( males_rank INTEGER, females___percentage_ VARCHAR, females_rank VARCHAR )
Which Males Rank is the highest one that has Females (%) smaller than 40, and Females Rank smaller than 22?
SELECT MAX(males_rank) FROM table_name_93 WHERE females___percentage_ < 40 AND females_rank < 22
sql_create_context
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 ...
how many hours have passed since the first prescribing of cyanocobalamin in patient 92846 on this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'cyanocobalamin' ORDER BY prescriptions.start...
mimic_iii
CREATE TABLE nomination ( Artwork_ID int, Festival_ID int, Result text ) CREATE TABLE festival_detail ( Festival_ID int, Festival_Name text, Chair_Name text, Location text, Year int, Num_of_Audience int ) CREATE TABLE artwork ( Artwork_ID int, Type text, Name text )
Show the ids and names of festivals that have at least two nominations for artworks Plot them as bar chart, could you show by the X-axis from low to high?
SELECT T3.Festival_Name, T1.Festival_ID FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Festival_Name
nvbench
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
Visualize the title and their average smallest ratings of the movie using a bar chart, sort by the title in descending please.
SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC
nvbench
CREATE TABLE table_name_54 ( races VARCHAR, podiums VARCHAR, poles VARCHAR, season VARCHAR )
What is the total number of races in the 2006 season with 0 poles and more than 0 podiums?
SELECT COUNT(races) FROM table_name_54 WHERE poles = 0 AND season = "2006" AND podiums > 0
sql_create_context
CREATE TABLE table_name_55 ( date VARCHAR, attendance INTEGER )
What is the date of the game with an attendance larger than 62,491?
SELECT date FROM table_name_55 WHERE attendance > 62 OFFSET 491
sql_create_context
CREATE TABLE table_name_66 ( callsign VARCHAR, frequency VARCHAR )
What callsign has 1300 as the frequency?
SELECT callsign FROM table_name_66 WHERE frequency = 1300
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, J...
自02年3月3日起,截止到06年2月9日,查一下患者72776229在医疗机构7840461的门诊看过几次病
SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_in...
css
CREATE TABLE table_26490 ( "Year" real, "Putri Pariwisata Indonesia" text, "1st Runner Up" text, "2nd Runner Up" text, "3rd Runner Up" text, "4th Runner Up" text )
Who won 4th place when audrie adriana sanova won 3rd place?
SELECT "3rd Runner Up" FROM table_26490 WHERE "2nd Runner Up" = 'Audrie Adriana Sanova'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
what is the daily maximum of temperature c (calc) for patient 32153 on the current hospital visit?
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32153 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_...
mimic_iii
CREATE TABLE table_name_20 ( money___$__ VARCHAR, player VARCHAR )
What was the Money ($) amount for Cary Middlecoff?
SELECT money___$__ FROM table_name_20 WHERE player = "cary middlecoff"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
what was the maximum value for arterial bp mean for patient 9294 on this month/09?
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9294)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter...
mimic_iii
CREATE TABLE table_5574 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in Final" text, "Score in Final" text )
Which Opponents in Final has an Outcome of winner, and a Surface of hard, and a Date of april 17, 1994?
SELECT "Opponents in Final" FROM table_5574 WHERE "Outcome" = 'winner' AND "Surface" = 'hard' AND "Date" = 'april 17, 1994'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
what is patient 43052's marital status on their first hospital encounter?
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 43052 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_66102 ( "Year" real, "Organization" text, "Award" text, "Work" text, "Result" text )
What award did they win before 2005?
SELECT "Award" FROM table_66102 WHERE "Year" < '2005'
wikisql
CREATE TABLE table_1341738_34 ( candidates VARCHAR, first_elected VARCHAR, party VARCHAR )
who was the candidate elected to the democratic party in 1952?
SELECT candidates FROM table_1341738_34 WHERE first_elected = "1952" AND party = "Democratic"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
how many patients have been discharged from hospital since 4 years ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_7020 ( "Year" text, "Team" text, "SckY" text, "Int%" text, "Rate" text, "RAtt" text, "RYds" text, "RAvg" text, "RLng" text, "R1st" text )
What was the Ravg for 2003?
SELECT "RAvg" FROM table_7020 WHERE "Year" = '2003'
wikisql
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text )
what is the average speed on each runner in the 4 x 100 m relay ?
SELECT "performance" FROM table_203_102 WHERE "event" = '4 x 100 m relay'
squall
CREATE TABLE table_47229 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the score of game 4?
SELECT "Score" FROM table_47229 WHERE "Game" = '4'
wikisql
CREATE TABLE table_71444 ( "Round" real, "Name" text, "Position" text, "School" text, "Signed" text )
Which school had a player who played the C position?
SELECT "School" FROM table_71444 WHERE "Position" = 'c'
wikisql
CREATE TABLE table_name_7 ( week INTEGER, date VARCHAR )
What is the sum of Week, when Date is December 2, 2001?
SELECT SUM(week) FROM table_name_7 WHERE date = "december 2, 2001"
sql_create_context
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text )
Bar chart x axis duration y axis how many duration
SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration
nvbench
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId n...
Total Posts for Ruby Per Month.
SELECT COUNT(*) AS PostCount, YEAR(P.CreationDate), MONTH(P.CreationDate) FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE ('ruby%') GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY 2 DESC, 3 DESC
sede
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
Show the lieutenant governor and comptroller from the democratic party.
SELECT lieutenant_governor, comptroller FROM party WHERE party = "Democratic"
spider
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
BURN WITH FIRE ALL STUPID UNICORN COMMENTS. They are just stupid noise.
SELECT PostId AS "post_link", Text FROM Comments WHERE Text LIKE '%unicorn%'
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
what's the cost of a drug named amlodipine besylate 5 mg po tabs?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'amlodipine besylate 5 mg po tabs')
eicu
CREATE TABLE table_31135 ( "Country" text, "Remittances 2008" text, "Remittances 2009" text, "Remittances 2010" text, "Remittances 2011" text )
how many countiers had 2009 remittances of 6.02?
SELECT COUNT("Country") FROM table_31135 WHERE "Remittances 2009" = '6.02'
wikisql
CREATE TABLE table_60893 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What is the lowest To par, when Total is greater than 148, and when Year(s) Won is '1959 , 1968 , 1974'?
SELECT MIN("To par") FROM table_60893 WHERE "Total" < '148' AND "Year(s) won" = '1959 , 1968 , 1974'
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 ) ...
what is date of birth and primary disease of subject name gus marques?
SELECT demographic.dob, demographic.diagnosis FROM demographic WHERE demographic.name = "Gus Marques"
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...
Give me the comparison about the amount of ACC_Road over the ACC_Road , and group by attribute ACC_Road, list in asc by the X-axis.
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_1341568_6 ( incumbent VARCHAR, district VARCHAR )
How many incumbents represent district California 34?
SELECT COUNT(incumbent) FROM table_1341568_6 WHERE district = "California 34"
sql_create_context
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 demographic ( subject_id text, hadm_id t...
what is the number of patients whose primary disease is st-segment elevation myocardial infarction/cardiac cath and born before 2107?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dob_year < "2107"
mimicsql_data
CREATE TABLE table_30121075_1 ( poor_law_union VARCHAR, townland VARCHAR )
What is the poor law union when the townland is bohonagh?
SELECT poor_law_union FROM table_30121075_1 WHERE townland = "Bohonagh"
sql_create_context
CREATE TABLE table_204_693 ( id number, "place" text, "total" number, "men" number, "women" number, "children" number, "elderly" number, "serbs" number, "jews" number, "romani" number, "rusyns" number, "hungarians" number, "russians" number )
what was the top city for victims ?
SELECT "place" FROM table_204_693 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_name_41 ( authority VARCHAR, name VARCHAR )
Which authority has a Name of tamatea high school?
SELECT authority FROM table_name_41 WHERE name = "tamatea high school"
sql_create_context
CREATE TABLE table_204_597 ( id number, "main author" text, "no. of patients" number, "duration of follow-up years" number, "linearized rate of infection" text, "actuarial freedom from infective endocarditis" text )
what author had the least number of patients ?
SELECT "main author" FROM table_204_597 ORDER BY "no. of patients" LIMIT 1
squall
CREATE TABLE table_46633 ( "Nominative" text, "Ergative" text, "Dative" text, "Genitive" text, "Instrumental" text, "Adverbial" text )
What is the ergative for the genitive tkven(s)?
SELECT "Ergative" FROM table_46633 WHERE "Genitive" = 'tkven(s)'
wikisql
CREATE TABLE table_71843 ( "Year" text, "Team" text, "Attempts" text, "Completions" text, "Completion %" text, "Yards" text )
What is the name of the team that has 1,317 attempts?
SELECT "Team" FROM table_71843 WHERE "Attempts" = '1,317'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
看看编号78865792393的检验报告单是哪位技师检验的,工号和姓名分别是什么
SELECT JYJSGH, JYJSQM FROM jybgb WHERE BGDH = '78865792393'
css
CREATE TABLE table_74651 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the sum of week number(s) had an attendance of 61,985?
SELECT COUNT("Week") FROM table_74651 WHERE "Attendance" = '61,985'
wikisql
CREATE TABLE table_train_266 ( "id" int, "active_infection" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "neuropathy" bool, "severe_diabetic_complication" bool, "hba1c" float, "active_malignancy" bool, "NOUSE" float )
have blood a1c > 7.6 % and < 8.5 % within 3 months prior to study enrollment.
SELECT * FROM table_train_266 WHERE hba1c > 7.6 AND hemoglobin_a1c_hba1c < 8.5
criteria2sql
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 marital status and gender of subject name miguel hodges?
SELECT demographic.marital_status, demographic.gender FROM demographic WHERE demographic.name = "Miguel Hodges"
mimicsql_data
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TAB...
i need a flight from SAN FRANCISCO to BOSTON that leaves after 2200
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 2200 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is admission location and admission time of subject id 2560?
SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_83 ( left_office VARCHAR, party VARCHAR )
What is Left Office, when Party is Vacant (1999-2001)?
SELECT left_office FROM table_name_83 WHERE party = "vacant (1999-2001)"
sql_create_context
CREATE TABLE table_name_72 ( odds VARCHAR, horse VARCHAR )
What are the Odds for the Horse called Ready's Echo?
SELECT odds FROM table_name_72 WHERE horse = "ready's echo"
sql_create_context
CREATE TABLE table_57701 ( "Disc" real, "Track" real, "English title" text, "Japanese title" text, "R\u014dmaji title" text, "Artist" text, "Track time" text )
Which Japanese title has a Disc smaller than 12, and an Artist of k z murashita?
SELECT "Japanese title" FROM table_57701 WHERE "Disc" < '12' AND "Artist" = 'kōzō murashita'
wikisql
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 was the total r chest tube output of patient 010-32430 until 1694 days ago?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32430')) AND intakeoutput.celllabel = 'r che...
eicu
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...
患者16935106有哪些医疗记录被开了853.43元以上的药品?列出医疗就诊编号
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '16935106' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 853.43)
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( mea...
please list the earliest LUNCH flight from COLUMBUS to PHOENIX
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_s...
atis
CREATE TABLE table_name_74 ( number INTEGER, opponent VARCHAR )
What is the highest number of the match with julio c sar v squez as the opponent?
SELECT MAX(number) FROM table_name_74 WHERE opponent = "julio césar vásquez"
sql_create_context
CREATE TABLE table_203_555 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
what was the difference in score between fuzzy zoeller and larry nelson ?
SELECT (SELECT "score" FROM table_203_555 WHERE "player" = 'fuzzy zoeller') - (SELECT "score" FROM table_203_555 WHERE "player" = 'larry nelson')
squall
CREATE TABLE table_28070 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many points did William Wasmund have?
SELECT "Points" FROM table_28070 WHERE "Player" = 'William Wasmund'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the marital status and death status of the patient troy friedman?
SELECT demographic.marital_status, demographic.expire_flag FROM demographic WHERE demographic.name = "Troy Friedman"
mimicsql_data
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,...
在哪几次医疗记录中给病患秦娟丽开出的药品均超过8902.92元?列出所有医疗就诊序列号都是什么?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '秦娟丽' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 8902.92)
css
CREATE TABLE table_name_21 ( country VARCHAR, score VARCHAR )
What Country's Player scored 71-69-70-71=281?
SELECT country FROM table_name_21 WHERE score = 71 - 69 - 70 - 71 = 281
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 d_icd_procedures ( row_id number, icd9_code text, s...
how many days have passed since the last 0.83% sodium chloride prescribed during the current hospital encounter for patient 55281?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281 AND admissions.dischtime IS NULL) AND prescriptions.drug = '0.83% sodium chloride' ORDER BY prescriptions...
mimic_iii
CREATE TABLE table_2771237_1 ( overall_record VARCHAR, average_attendance VARCHAR )
What was the overall record in the season where average attendance was 16720?
SELECT overall_record FROM table_2771237_1 WHERE average_attendance = 16720
sql_create_context
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, ...
what is maximum age of patients whose language is engl and primary disease is bradycardia?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "BRADYCARDIA"
mimicsql_data