context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 primary disease is celo-vessicle fistula and age is less than 27?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA" AND demographic.age < "27"
mimicsql_data
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
给患有癫痫性精神病的病患都开出了哪些药品它们的编号和名称各是什么?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_NM = '癫痫性精神病' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_NM = '癫痫性精神病' UNIO...
css
CREATE TABLE table_name_14 ( time VARCHAR, team_s_ VARCHAR, artist_s_ VARCHAR )
How long is the XXX track used by the Minnesota Vikings?
SELECT time FROM table_name_14 WHERE team_s_ = "minnesota vikings" AND artist_s_ = "xxx"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
how many patients of white ethnicity are lab tested for lab item id 51078?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.itemid = "51078"
mimicsql_data
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body te...
Java Questions from Recent times.
SELECT Id, Score, AcceptedAnswerId, Title, Body FROM Posts WHERE Tags LIKE '%<java>%' AND AcceptedAnswerId > 0 AND Id < 584234 ORDER BY Id DESC
sede
CREATE TABLE table_26130295_3 ( final_four_mvp INTEGER, first_team VARCHAR )
what would be final four mvp maximum when first team is 1
SELECT MAX(final_four_mvp) FROM table_26130295_3 WHERE first_team = 1
sql_create_context
CREATE TABLE table_148386_2 ( savoy_theatre_1888 VARCHAR, casino_theatre_1888 VARCHAR )
What is the total of roles that George Olmi plays in Savoy & Casino Theatre 1888?
SELECT COUNT(savoy_theatre_1888) FROM table_148386_2 WHERE casino_theatre_1888 = "George Olmi"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number,...
Questions by User A with Answers by User B.
SELECT Id, Id AS "post_link" FROM Posts AS Questions WHERE OwnerUserId = '##QuestionAuthor:int##' AND PostTypeId = 2 ORDER BY LENGTH(Body)
sede
CREATE TABLE table_7678 ( "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
What was the Chassis constructed by Maserati, when the Entrant was Officine A. Maserati, and when the Driver was Luigi Fagioli?
SELECT "Chassis" FROM table_7678 WHERE "Constructor" = 'maserati' AND "Entrant" = 'officine a. maserati' AND "Driver" = 'luigi fagioli'
wikisql
CREATE TABLE table_name_85 ( score VARCHAR, year VARCHAR )
what was the score in 1990
SELECT score FROM table_name_85 WHERE year = 1990
sql_create_context
CREATE TABLE table_name_99 ( distance VARCHAR, course VARCHAR )
How far is the olbia to sassari route?
SELECT distance FROM table_name_99 WHERE course = "olbia to sassari"
sql_create_context
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Activity ( actid INTEGER, acti...
A bar chart showing the first name of all the faculty members who participated in some activity, together with the number of activities they participated in, and could you sort in ascending by the x axis?
SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY Fname
nvbench
CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_yea...
A bar chart for how many competitions for each country, and rank by the the number of country in desc.
SELECT Country, COUNT(Country) FROM competition GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
CREATE TABLE table_1475840_1 ( stolen_ends INTEGER, locale VARCHAR, Alberta VARCHAR )
What is the minimum stolen ends for the locale Alberta?
SELECT MIN(stolen_ends) FROM table_1475840_1 WHERE locale = Alberta
sql_create_context
CREATE TABLE table_28140590_1 ( original_air_date VARCHAR, production_code VARCHAR )
What date did the episode with a production code of 60072 originally air?
SELECT original_air_date FROM table_28140590_1 WHERE production_code = 60072
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what are the four most frequently performed procedures for patients of the 40s in 2104?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
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...
Show team id vs acc_percent as scatter plot use a different color for each ACC_Regular_Season
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_10987 ( "Locomotive superintendent" text, "GNoSR Class" text, "LNER class" text, "Quantity Built" real, "Passed to LNER" real, "Manufacturer" text, "Date introduced" text )
Who was the Locomotive superintendent has a NER class of d45?
SELECT "Locomotive superintendent" FROM table_10987 WHERE "LNER class" = 'd45'
wikisql
CREATE TABLE table_48699 ( "Year" real, "Winner" text, "Finalist" text, "Result" text, "Date" text, "Venue" text, "Attendance" real )
Who was the finalist when the winner was First Vienna FC?
SELECT "Finalist" FROM table_48699 WHERE "Winner" = 'first vienna fc'
wikisql
CREATE TABLE table_2226817_8 ( no_in_series VARCHAR, no_in_season VARCHAR )
How many episodes in the series are from season 12?
SELECT no_in_series FROM table_2226817_8 WHERE no_in_season = 12
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 chartevents ( row_id number, subject_id number, ...
what was the name of the drug prescribed for the last time during the last hospital encounter for patient 29971?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29971 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, ...
Please give me a bar chart to show the number of players in each years played, list from high to low by the Y-axis.
SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played ORDER BY COUNT(Years_Played) DESC
nvbench
CREATE TABLE table_61664 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What is To par, when Score is '70-68-68-71=277'?
SELECT "To par" FROM table_61664 WHERE "Score" = '70-68-68-71=277'
wikisql
CREATE TABLE table_2409041_2 ( original_air_date VARCHAR, no_in_series VARCHAR )
When 21 is the number in series what is the air date?
SELECT original_air_date FROM table_2409041_2 WHERE no_in_series = 21
sql_create_context
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
What are the dates of the assessment notes, and count them by a bar chart
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes
nvbench
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, ...
How many patients born before 2109 had a urine magnesium lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2109" AND lab.label = "Magnesium, Urine"
mimicsql_data
CREATE TABLE table_11035 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
At Junction Oval, what is the sum of the crowd?
SELECT SUM("Crowd") FROM table_11035 WHERE "Venue" = 'junction oval'
wikisql
CREATE TABLE table_24937583_1 ( races__starts_ VARCHAR, points__dropped_points_ VARCHAR )
What were the starts when the points dropped 18?
SELECT races__starts_ FROM table_24937583_1 WHERE points__dropped_points_ = "18"
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...
what is the total number of patients tested for hematology who had open reduction of fracture with internal fixation, femur?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Open reduction of fracture with internal fixation, femur" AND lab."CATEGORY" = "Hematology"
mimicsql_data
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 ( ...
give me the number of patients whose ethnicity is hispanic or latino and days of hospital stay is greater than 17?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "17"
mimicsql_data
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
how many entrepreneurs correspond to each investor?, and rank Y-axis from high to low order.
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
门诊诊断患者戚飞翼为疾病V25.625的类风湿因子的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_17735 ( "Year" real, "Song title" text, "Artist" text, "Master recording ?" text, "Release date" text, "Single / Pack" text )
What are the release dates for songs in 2003?
SELECT "Release date" FROM table_17735 WHERE "Year" = '2003'
wikisql
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE T...
For each team, how many technicians are there. Visualize by pie chart.
SELECT Team, COUNT(*) FROM technician GROUP BY Team
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
患者53311855自二零零四年八月二日开始,截止到二零一七年一月二十九日,由哪几位医务人员为其检测二氧化碳的,查查这些医务人员的工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_75441 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Score has Points of 36, and a Game of 30?
SELECT "Score" FROM table_75441 WHERE "Points" = '36' AND "Game" = '30'
wikisql
CREATE TABLE table_1566852_8 ( cover_model VARCHAR, pictorials VARCHAR )
Who was the cover model when the issue's pictorials was pmoy - sara jean underwood?
SELECT cover_model FROM table_1566852_8 WHERE pictorials = "PMOY - Sara Jean Underwood"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( I...
Top users in Czech Republic.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('czech republic') ORDER BY Reputation DESC
sede
CREATE TABLE table_name_17 ( date VARCHAR, school VARCHAR )
What is the Date of the Athlete from Ferris High School?
SELECT date FROM table_name_17 WHERE school = "ferris high school"
sql_create_context
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, ...
在医院0600104中编码为80814674的患者门诊诊断名称包含牙龈的门诊就诊记录都有哪些?
SELECT * FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '80814674' AND hz_info.YLJGDM = '0600104' AND zzmzjzjlb.JZZDSM LIKE '%牙龈%' UNION SELECT * FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz...
css
CREATE TABLE table_name_91 ( driver VARCHAR, time_retired VARCHAR, grid VARCHAR )
Who drive the car that retired due to engine failure and a grid of less than 9?
SELECT driver FROM table_name_91 WHERE time_retired = "engine" AND grid < 9
sql_create_context
CREATE TABLE table_15532342_2 ( swimsuit VARCHAR, state VARCHAR )
Name the swimsuit for arizona
SELECT swimsuit FROM table_15532342_2 WHERE state = "Arizona"
sql_create_context
CREATE TABLE table_name_7 ( shooter VARCHAR, event VARCHAR, rank_points VARCHAR )
Who is the shooter at the WC Rio De Janeiro event with 10 rank points?
SELECT shooter FROM table_name_7 WHERE event = "wc rio de janeiro" AND rank_points = "10"
sql_create_context
CREATE TABLE table_58007 ( "Singular abbreviation" text, "Singular Word" text, "Plural abbreviation" text, "Plural Word" text, "Discipline" text )
The plural word of following lines or pages has what plural abbreviation?
SELECT "Plural abbreviation" FROM table_58007 WHERE "Plural Word" = 'following lines or pages'
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, ...
08年2月6日到18年10月8日期间,87902700这名患者全段甲状旁腺激素这个指标的所有记录
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what was the name of the drug prescribed to patient 65582 after having been diagnosed with accid in resident instit in 12/2105 during the same hospital visit?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 65582 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s...
mimic_iii
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, ...
之前,患者22973171有哪些异常情况?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_D...
Show the number of documents for different document name in a bar chart, rank Document_Name in desc order please.
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name ORDER BY Document_Name DESC
nvbench
CREATE TABLE table_11118 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date were there more than 16,000 people in the crowd and Carlton was the home team?
SELECT "Date" FROM table_11118 WHERE "Crowd" > '16,000' AND "Home team" = 'carlton'
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...
count the number of visits to the intensive care unit that patient 029-16737 made in 2102.
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737') AND STRFTIME('%y', patient.unitadmittime) = '2102'
eicu
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
列出号码为93974875753的与号码为40947115629这两位在就诊过程中开出了哪些一样名的药品?这些药品都叫什么名称?
(SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '93974875753') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '40947115629')
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年5月6日到2020年3月14日这段日子编号09797743的病人开出的所有检验报告单的科室编码以及名称分别是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH...
css
CREATE TABLE table_63906 ( "Title" text, "Series" text, "Director" text, "Production Num." real, "Release date" text )
Who's the director of Buddy of the Apes?
SELECT "Director" FROM table_63906 WHERE "Title" = 'buddy of the apes'
wikisql
CREATE TABLE table_13429 ( "Non-dictatorship" text, "Pareto efficiency" text, "Majority" text, "Monotone" text, "Consistency & Participation" text, "Condorcet" text, "Condorcet loser" text, "Clone independence" text, "Reversal symmetry" text )
What is the majority when the clone independence is no?
SELECT "Majority" FROM table_13429 WHERE "Clone independence" = 'no'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
count the number of patients who were prescribed with sodium chloride 0.9% 1,000 ml bag within 2 months after receiving a head ct scan procedure until 1 year ago.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'head ct scan' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELE...
eicu
CREATE TABLE table_204_609 ( id number, "year" number, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text )
what is the larger laps between 1963 or 1968
SELECT "year" FROM table_204_609 WHERE "year" IN (1963, 1968) ORDER BY "laps" DESC LIMIT 1
squall
CREATE TABLE table_12121208_1 ( womens_singles VARCHAR, mens_singles VARCHAR )
Who won the womens singles when Marc Zwiebler won the men's singles?
SELECT womens_singles FROM table_12121208_1 WHERE mens_singles = "Marc Zwiebler"
sql_create_context
CREATE TABLE table_79977 ( "Country" text, "Name" text, "Host" text, "Channel" text, "Prize" text, "First year aired" text )
What was the first year that had a prize of 50,000?
SELECT "First year aired" FROM table_79977 WHERE "Prize" = '50,000'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean...
All tags with excerpt, ordered by tag count.
SELECT t.TagName, t.Count AS TagCount, e.Body AS "Excerpt" FROM Tags AS t LEFT JOIN Posts AS e ON t.ExcerptPostId = e.Id ORDER BY TagCount DESC
sede
CREATE TABLE table_19837 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
How many wins were there when the position was 26th?
SELECT COUNT("Wins") FROM table_19837 WHERE "Position" = '26th'
wikisql
CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE membership_register_branch ( Member_ID int, Branch_I...
Show all branch names with the number of members in each branch registered after 2015 Plot them as bar chart, and show by the bar from low to high.
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY Name
nvbench
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' with a bar chart, and order from high to low by the Y.
SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY SUM(Num_Employees) DESC
nvbench
CREATE TABLE table_name_35 ( tournament VARCHAR, score VARCHAR )
What tournament had a game with a score of 6-7, 4-6?
SELECT tournament FROM table_name_35 WHERE score = "6-7, 4-6"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
count the number of patients whose admission year is less than 2168 and procedure short title is int insert lead in vent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2168" AND procedures.short_title = "Int insert lead in vent"
mimicsql_data
CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number )
Return the maximum number of points for climbers from the United Kingdom.
SELECT MAX(points) FROM climber WHERE country = "United Kingdom"
spider
CREATE TABLE table_name_57 ( type VARCHAR, manufacturer VARCHAR )
Which type had an unknown manufacturer?
SELECT type FROM table_name_57 WHERE manufacturer = "unknown"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
when did patient 007-849 have stool output first time on this month/30?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849')) AND intakeoutput.cellpath LIKE '%output%' ...
eicu
CREATE TABLE table_72808 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text )
What is the latitude of vaidilute rupes?
SELECT "Latitude" FROM table_72808 WHERE "Name" = 'Vaidilute Rupes'
wikisql
CREATE TABLE table_name_1 ( opponent VARCHAR, loss VARCHAR )
Who was the opponent when Hoeft (19-14) took the loss?
SELECT opponent FROM table_name_1 WHERE loss = "hoeft (19-14)"
sql_create_context
CREATE TABLE table_203_3 ( id number, "province" text, "capital" text, "population" number, "density" text, "municipalities" text, "legal districts" number )
which province is the only province with a higher population than malaga ?
SELECT "province" FROM table_203_3 WHERE "population" > (SELECT "population" FROM table_203_3 WHERE "province" = 'malaga')
squall
CREATE TABLE table_204_888 ( id number, "location" text, "mile" number, "destinations" text, "notes" text )
which round had the most miles ?
SELECT "location" FROM table_204_888 ORDER BY "mile" DESC LIMIT 1
squall
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
病患40717294诊断为I86.192疾病时在门诊检测指标763289的结果定量及其单位各是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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.Y...
css
CREATE TABLE table_203_152 ( id number, "province" text, "capital" text, "area (km2)" number, "population" number, "density" number )
which province in the dominican republic has the smallest area -lrb- in square kilometers -rrb- ?
SELECT "province" FROM table_203_152 ORDER BY "area (km2)" LIMIT 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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
Find the lab test and lab test fluid of Shawn Green.
SELECT lab.label, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Shawn Green"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
患者李凯唱的异常情况,之前有哪些?
(SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_14650162_1 ( pick__number VARCHAR, college VARCHAR )
What is the pick number of the player whose college is Florida State?
SELECT pick__number FROM table_14650162_1 WHERE college = "Florida State"
sql_create_context
CREATE TABLE gas_station ( LOCATION VARCHAR, open_year VARCHAR )
order all gas station locations by the opening year.
SELECT LOCATION FROM gas_station ORDER BY open_year
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
自15年7月27日起,截止到16年11月4日,医疗机构6851618的特需门诊有多少就诊记录
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '68...
css
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...
how many white ethnic background patients have prescription for metolazone medication?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug = "Metolazone"
mimicsql_data
CREATE TABLE table_22062 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real )
What is the highest position a team with 7 draws earned?
SELECT MAX("Position") FROM table_22062 WHERE "Draws" = '7'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Most popular StackOverflow tags in <year>.
SELECT PostId, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate >= '2012-01-01' AND Posts.CreationDate < '2012-02-01' AND TagName IN ('javascript', 'java', 'php', 'c#', 'html', 'python', 'css', 'c++', 'mysql', 'sql', 'objective-c', 'asp.net', 'c', 'json', 'r...
sede
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
had patient 010-33968 had sao2 greater than 89.0 in 07/last year?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-33968')) AND vitalperiodic.sao2 > 89.0 AND NOT vitalperiodic.sao...
eicu
CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_i...
Please compare the frequency of the customer details using a bar chart.
SELECT customer_details, COUNT(customer_details) FROM Customers GROUP BY customer_details
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...
count the number of patients whose primary disease is s/p hanging?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING"
mimicsql_data
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...
what is the number of patients whose age is less than 56 and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "56" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
what was the first time patient 008-10139 last month received a lab test?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-10139')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T...
eicu
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( ...
until 1 year ago how many patients have undergone insulin within the same month after being diagnosed with diabetes mellitus?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN ...
eicu
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
Next semester , are there any ELI 320 sections that are not on Monday ?
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'ELI' AND course.number = 320 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.ye...
advising
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 diagnoses short title and diagnoses long title of diagnoses icd9 code 78630?
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "78630"
mimicsql_data
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight te...
please give me fares from DENVER to PHILADELPHIA
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_22824297_1 ( class VARCHAR, position VARCHAR, player VARCHAR )
What is every class with a position of guard and Tal Brody as the player?
SELECT class FROM table_22824297_1 WHERE position = "Guard" AND player = "Tal Brody"
sql_create_context
CREATE TABLE table_68191 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text )
What is the total number of games played that correlates with a first game in 1991, a percentage of 22.22%, and less than 7 losses?
SELECT COUNT("Played") FROM table_68191 WHERE "First game" = '1991' AND "Percentage" = '22.22%' AND "Lost" > '7'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
count the number of patients whose age is less than 49 and procedure icd9 code is 92?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "49" AND procedures.icd9_code = "92"
mimicsql_data
CREATE TABLE table_79843 ( "Title" text, "Album" text, "Country" text, "Peak position" real, "Weeks on chart" real )
what is the country with the album best of and weeks on chart is less than 5?
SELECT "Country" FROM table_79843 WHERE "Album" = 'best of' AND "Weeks on chart" < '5'
wikisql
CREATE TABLE table_69996 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What's the attendance of the san diego chargers game before week 6?
SELECT COUNT("Attendance") FROM table_69996 WHERE "Week" < '6' AND "Opponent" = 'san diego chargers'
wikisql
CREATE TABLE table_203_836 ( id number, "title" text, "year" number, "platforms" text, "developer" text, "publisher" text, "notes" text )
spicy pony released a total of three games ; their game , american mcgee 's crooked house was released on which platforms ?
SELECT "platforms" FROM table_203_836 WHERE "title" = "american mcgee's crooked house"
squall
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's the name of the drug that patient 002-72731 was prescribed two or more times until 46 months ago?
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002...
eicu
CREATE TABLE table_name_99 ( score VARCHAR, loss VARCHAR )
What was the score of the game that had a loss of Drese (2-2)?
SELECT score FROM table_name_99 WHERE loss = "drese (2-2)"
sql_create_context
CREATE TABLE table_15355 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
What is the name of the event that had a prize of z 1,226,711?
SELECT "Event" FROM table_15355 WHERE "Prize" = 'zł 1,226,711'
wikisql
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 prescriptions ( subject_id text, hadm_id...
how many patients with lower extremity embolism had blood gas lab test?
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 = "Lower extremity embolism" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data