context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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, ...
在2004-03-08至2005-12-26之间外地门诊的就诊记录数量在这家医疗机构5043128体现了多少
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 = '50...
css
CREATE TABLE table_3917 ( "Episode #" real, "Series #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text, "Viewers (millions)" text )
Wat episode number had 5.46 million viewers?
SELECT "Episode #" FROM table_3917 WHERE "Viewers (millions)" = '5.46'
wikisql
CREATE TABLE table_75807 ( "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the average number of Byes when there were less than 0 losses and were against 1247?
SELECT AVG("Byes") FROM table_75807 WHERE "Against" = '1247' AND "Draws" < '0'
wikisql
CREATE TABLE table_70767 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Ends" real, "Transfer fee" text, "Source" text )
What is the transfer window in esp with promoted type and more than 2010 ends?
SELECT "Transfer window" FROM table_70767 WHERE "Country" = 'esp' AND "Type" = 'promoted' AND "Ends" > '2010'
wikisql
CREATE TABLE table_1004033_1 ( season INTEGER, team VARCHAR )
When did the Metrostars have their first Rookie of the Year winner?
SELECT MIN(season) FROM table_1004033_1 WHERE team = "MetroStars"
sql_create_context
CREATE TABLE table_name_23 ( date VARCHAR, visitor VARCHAR )
What is the date of the game with Detroit as the visitor team?
SELECT date FROM table_name_23 WHERE visitor = "detroit"
sql_create_context
CREATE TABLE table_54824 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the crowd size on 4 july 1981, and a Away team of essendon?
SELECT "Crowd" FROM table_54824 WHERE "Date" = '4 july 1981' AND "Away team" = 'essendon'
wikisql
CREATE TABLE table_23656 ( "Season" real, "Division" text, "Coach" text, "Overall Record" text, "Conference Record" text, "Result" text, "Attendance" real )
Who coached the team in the season with a 6-1 conference record?
SELECT "Coach" FROM table_23656 WHERE "Conference Record" = '6-1'
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, ...
病患奚白云所有检验报告单中时间在09年9月21日到12年11月3日内的审核日期时间都是什么时候?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 ...
css
CREATE TABLE table_name_5 ( fastest_laps INTEGER, poles INTEGER )
What was the average number of fastest laps with less than 0 poles?
SELECT AVG(fastest_laps) FROM table_name_5 WHERE poles < 0
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, ...
被门诊诊断为D87.114这个病的患者04324529,看看他的检测指标451191的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
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 ) ...
count the number of patients less than 45 years of age who had open biopsy of liver.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Open biopsy of liver"
mimicsql_data
CREATE TABLE table_38676 ( "Make" text, "Year placed in service" text, "Quantity" real, "Number of seats" real, "Wheelchair accessible? ()" text, "Current status" text )
What is the largest number of seats with more than 32 of a MCI make?
SELECT MAX("Number of seats") FROM table_38676 WHERE "Make" = 'mci' AND "Quantity" > '32'
wikisql
CREATE TABLE table_1140103_6 ( date VARCHAR, _number VARCHAR )
What date is listed at place 13
SELECT date FROM table_1140103_6 WHERE _number = 13
sql_create_context
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...
what is the number of patients whose admission year is less than 2108 and procedure long title is continuous invasive mechanical ventilation for less than 96 consecutive hours?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2108" AND procedures.long_title = "Continuous invasive mechanical ventilation for less than 96 consecutive hours"
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 demographic (...
calculate the minimum age of patients with brain mass; intracranial hemorrhage primary disease who had psychiatric facility-partial hospitalization discharge.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
mimicsql_data
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_to_...
Show the number of documents in different starting date. Bin starting date by weekday and group by location code with a stacked bar chart.
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Location_Code
nvbench
CREATE TABLE procedures ( 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 ...
provide the number of patients whose admission type is elective and admission year is less than 2135?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2135"
mimicsql_data
CREATE TABLE table_77060 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
How much Avg/G has a Gain smaller than 1571, and a Long smaller than 46?
SELECT COUNT("Avg/G") FROM table_77060 WHERE "Gain" < '1571' AND "Long" < '46'
wikisql
CREATE TABLE table_name_95 ( drawn VARCHAR, tries_for VARCHAR )
Name the drawn for tries for of 42
SELECT drawn FROM table_name_95 WHERE tries_for = "42"
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...
患者郎清俊药品金额不低于7585.12元的在哪几次医疗记录中被开出过以及医疗就诊编号是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '郎清俊' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7585.12)
css
CREATE TABLE table_name_24 ( rank INTEGER, points INTEGER )
What is the highest rank of the player with less than 32 points?
SELECT MAX(rank) FROM table_name_24 WHERE points < 32
sql_create_context
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 who had urgent hospital admission and are prescribed paroxetine hcl medication.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Paroxetine HCl"
mimicsql_data
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
what is average age of male for different job title?
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job
nvbench
CREATE TABLE table_13615 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "GPU frequency" text, "Cores" text, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, "Release date" te...
What is I/O bus when socket is socket g1bga-1288?
SELECT "I/O bus" FROM table_13615 WHERE "Socket" = 'socket g1bga-1288'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE cite ( ...
papers using WordNet or Dbpedia
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname IN ('WordNet', 'Dbpedia') AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid GROUP BY paper.paperid
scholar
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...
患者65531997在01年7月20日到15年10月22日,是找的哪些工号及姓名的医务人员检测指标116352的
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 diagnoses_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_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
how much do the magnesium, urine actually cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium, urine'))
mimic_iii
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CR...
Very short answers with high score.
SELECT Id AS "post_link", Body, Score FROM Posts WHERE LENGTH(Body) < 256 AND Score > 5 AND PostTypeId = 2
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,...
give me the number of patients with private health insurance admitted before 2167.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admityear < "2167"
mimicsql_data
CREATE TABLE table_name_26 ( partner VARCHAR, outcome VARCHAR, date VARCHAR )
Who is the partner with a runner-up outcome on April 6, 1992?
SELECT partner FROM table_name_26 WHERE outcome = "runner-up" AND date = "april 6, 1992"
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 jyjgzbb ( BGDH text, BGRQ tim...
在2010年5月30日到2014年3月23日内患者08033471有多少检测结果指标记录的检验人为88248924的检测指标流水号?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON 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 hz_info.RYBH = '08033471' AND jyjgzbb.JYRQ BETWEEN '2010-05-3...
css
CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_manager text, building_phone text ) CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TA...
What are dates of birth of all the guests whose gender is 'Male'?
SELECT date_of_birth FROM guests WHERE gender_code = "Male"
spider
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
retrieve the top five most commonly prescribed drugs until 1 year ago for patients of age 40s.
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year') GR...
eicu
CREATE TABLE table_12419515_4 ( written_by VARCHAR, total_viewers__in_millions_ VARCHAR )
Who wrote the title that received 1.211 million total viewers?
SELECT written_by FROM table_12419515_4 WHERE total_viewers__in_millions_ = "1.211"
sql_create_context
CREATE TABLE table_17606 ( "#" real, "Nation" text, "Winners" real, "Runners-up" real, "3rd Place" real, "4th Place" real )
how many winners from vietnam
SELECT "Winners" FROM table_17606 WHERE "Nation" = 'Vietnam'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
Posts most edited by user.
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", COUNT(DISTINCT PostHistory.RevisionGUID) AS Edits, MIN(PostHistory.CreationDate) AS Earliest, MAX(PostHistory.CreationDate) AS Latest FROM Posts JOIN PostHistory ON PostHistory.PostId = Posts.Id WHERE PostHistory.UserId = '##UserId##' AND PostHistory.Pos...
sede
CREATE TABLE table_1221089_1 ( colors VARCHAR, institution VARCHAR )
What are the school colors of the University of New Hampshire?
SELECT colors FROM table_1221089_1 WHERE institution = "University of New Hampshire"
sql_create_context
CREATE TABLE table_1906515_1 ( launch_date VARCHAR, duration__days_ VARCHAR )
Name the launch date for duration days 174.14
SELECT launch_date FROM table_1906515_1 WHERE duration__days_ = "174.14"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
what number of patients who received a insert endotracheal tube procedure in the same hospital visit after having been diagnosed with alcohol abuse-unspec during this year?
SELECT COUNT(DISTINCT t1.subject_id) 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 diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_76922 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the average overall that has a pick less than 20, North Carolina as the college, with a round less than 8?
SELECT AVG("Overall") FROM table_76922 WHERE "Pick" < '20' AND "College" = 'north carolina' AND "Round" < '8'
wikisql
CREATE TABLE table_11789 ( "Name" text, "Appointed/Elected" text, "Term expires" text, "Appointing Governor" text, "Governor's Party Affiliation" text )
What is the expiring term for Daryl Hecht when the appointing governor is Tom Vilsack?
SELECT "Term expires" FROM table_11789 WHERE "Appointing Governor" = 'tom vilsack' AND "Name" = 'daryl hecht'
wikisql
CREATE TABLE table_203_800 ( id number, "#" number, "president" text, "president's party" text, "senate with" number, "senate opposed" number, "house with" number, "house opposed" number, "years served" number, "elections won" number )
who was the last president from the republican party ?
SELECT "president" FROM table_203_800 WHERE "president's party" = 'republican' ORDER BY "#" DESC LIMIT 1
squall
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal...
What is the age distribution for the users?.
SELECT t2.age, COUNT(t2.Id) AS Count_of_users_by_age FROM Users AS t2 GROUP BY t2.age ORDER BY t2.age
sede
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 departments ( DEPARTMENT_ID decimal...
For those employees who did not have any job in the past, give me the comparison about the average of manager_id over the hire_date bin hire_date by time, sort in descending by the total number.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_22 ( daytime VARCHAR, name VARCHAR )
Name the Daytime which has a Name of exmouth?
SELECT daytime FROM table_name_22 WHERE name = "exmouth"
sql_create_context
CREATE TABLE table_name_21 ( home_team VARCHAR, away_team VARCHAR )
Who was the home team in the match against Luton Town?
SELECT home_team FROM table_name_21 WHERE away_team = "luton town"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
select * from Posts wheere AnswerCount>0.
SELECT * FROM Posts WHERE AnswerCount > 0
sede
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
列出77494849这个患者在医院2952772中就诊科室名称里包含不育的医疗就诊记录都有哪些?
SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '77494849' AND gwyjzb.MED_SER_ORG_NO = '2952772' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%不育%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '77494849' AND fgwyjzb.MED_SER_ORG_NO = '2952772' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%不育%'
css
CREATE TABLE procedures ( 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 diagnoses ( ...
give me the number of patients whose diagnoses icd9 code is v4987?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "V4987"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
Plot salary by grouped by email as a bar graph, and show y-axis in descending order.
SELECT EMAIL, SALARY FROM employees ORDER BY SALARY DESC
nvbench
CREATE TABLE exhibition_record ( exhibition_id number, date text, attendance number ) CREATE TABLE artist ( artist_id number, name text, country text, year_join number, age number ) CREATE TABLE exhibition ( exhibition_id number, year number, theme text, artist_id numbe...
What are the names and year of joining for artists that do not have the country 'United States'?
SELECT name, year_join FROM artist WHERE country <> 'United States'
spider
CREATE TABLE table_18104 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
Who were the candidates in the Maryland 5 district election?
SELECT "Candidates" FROM table_18104 WHERE "District" = 'Maryland 5'
wikisql
CREATE TABLE table_name_8 ( opening_weekend_net_gross INTEGER, studio_s_ VARCHAR )
What's the sum of Opening Weekend Net Gross at the Studio of UTV Motion Pictures?
SELECT SUM(opening_weekend_net_gross) FROM table_name_8 WHERE studio_s_ = "utv motion pictures"
sql_create_context
CREATE TABLE table_name_20 ( programming VARCHAR, name VARCHAR )
What is the programming for Kanal 5?
SELECT programming FROM table_name_20 WHERE name = "kanal 5"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
看看参保人华俊迈从2007.7.28到2017.9.6这期间,在门诊发生的检查费有多少总额
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '华俊迈' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2007-07-28' AND '2017-09-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_47 ( competition VARCHAR, score VARCHAR )
What competition has a score of 1-3?
SELECT competition FROM table_name_47 WHERE score = "1-3"
sql_create_context
CREATE TABLE table_name_31 ( against INTEGER, club VARCHAR, draws VARCHAR )
What's the against of South Warrnambool when the draw is less than 0?
SELECT SUM(against) FROM table_name_31 WHERE club = "south warrnambool" AND draws < 0
sql_create_context
CREATE TABLE table_72595 ( "Tournament" text, "Country" text, "Location" text, "Current Venue" text, "Began" real, "Court surface" text )
Rome is in which country?
SELECT "Country" FROM table_72595 WHERE "Location" = 'Rome'
wikisql
CREATE TABLE table_name_82 ( seasons_in_league INTEGER, best_position VARCHAR )
Which sum of Seasons in league has a Best Position of 5th (2007)?
SELECT SUM(seasons_in_league) FROM table_name_82 WHERE best_position = "5th (2007)"
sql_create_context
CREATE TABLE table_1342249_5 ( party VARCHAR, incumbent VARCHAR )
What party did incumbent Brooks Hays belong to?
SELECT party FROM table_1342249_5 WHERE incumbent = "Brooks Hays"
sql_create_context
CREATE TABLE table_11256021_1 ( extroverted VARCHAR, _relationship_oriented VARCHAR, date VARCHAR )
what's the extroverted, relationship-oriented where date is c. 1928
SELECT extroverted, _relationship_oriented FROM table_11256021_1 WHERE date = "c. 1928"
sql_create_context
CREATE TABLE table_name_62 ( turbo VARCHAR, part_number_s_ VARCHAR )
what is the turbo when the part number is cm8062300834302bx80623i72600bxc80623i72600?
SELECT turbo FROM table_name_62 WHERE part_number_s_ = "cm8062300834302bx80623i72600bxc80623i72600"
sql_create_context
CREATE TABLE table_name_43 ( runner_up VARCHAR, year VARCHAR, arena VARCHAR )
Who was the runner-up at the Broadmoor Arena before 2008?
SELECT runner_up FROM table_name_43 WHERE year < 2008 AND arena = "broadmoor arena"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_stop ( flight_id int, stop_n...
what are all flights from BOSTON to DENVER
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER'...
atis
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
Bar chart x axis carrier y axis the number of carrier, display bar from high to low order.
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier ORDER BY Carrier DESC
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
what's the total amount of input of patient 028-8188?
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 = '028-8188')) AND intakeoutput.cellpath LIKE '%int...
eicu
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val...
what is the total quantity of or out pacu urine output patient 32592 had until 09/25/2104?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32592)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'or ...
mimic_iii
CREATE TABLE table_name_57 ( fylde INTEGER, burnley INTEGER )
What is the average rating for a Flyde that has a Burnley less than 0?
SELECT AVG(fylde) FROM table_name_57 WHERE burnley < 0
sql_create_context
CREATE TABLE table_60689 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the total number of draws for Wakool when there are more than 11 losses and fewer than 4 wins?
SELECT COUNT("Draws") FROM table_60689 WHERE "Losses" > '11' AND "Wins" < '4' AND "Golden Rivers" = 'wakool'
wikisql
CREATE TABLE table_70963 ( "Index" text, "Name" text, "Chinese Name" text, "Country" text, "Status" text )
What is the Index number of Chen Bangjun Andie from Singapore?
SELECT "Index" FROM table_70963 WHERE "Country" = 'singapore' AND "Name" = 'chen bangjun andie'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
以往患者79096915门诊诊断呢都有什么?
SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '79096915' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AN...
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...
自二零一三年四月二十六日开始,截止到二零一六年八月三日,看看参保人89232453单一药品最大的购买次数共发生过多少次
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 = '89232453' AND t_kc22.STA_DATE BETWEEN '2013-04-26' AND '2016-08-03' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L...
css
CREATE TABLE table_26720 ( "Pitcher" text, "Strikeouts" real, "Season" real, "Team" text, "League" text, "Overall Rank" real )
Name the total number of pitcher for 9 overall rank
SELECT COUNT("Pitcher") FROM table_26720 WHERE "Overall Rank" = '9'
wikisql
CREATE TABLE table_74730 ( "Driver" text, "Car #" real, "Make" text, "Points" text, "Laps" real, "Winnings" text )
What make of car did Brian Vickers drive?
SELECT "Make" FROM table_74730 WHERE "Driver" = 'brian vickers'
wikisql
CREATE TABLE table_68492 ( "Circuit" text, "Location / State" text, "Date" text, "Winning driver" text, "Team" text )
what date was mallala motor sport park the circuit?
SELECT "Date" FROM table_68492 WHERE "Circuit" = 'mallala motor sport park'
wikisql
CREATE TABLE department_stores ( dept_store_id VARCHAR, store_name VARCHAR ) CREATE TABLE departments ( dept_store_id VARCHAR, department_name VARCHAR )
What is the id and name of the department store that has both marketing and managing department?
SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.department_name = "marketing" INTERSECT SELECT T2.dept_store_id, T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id = T2.dept_store_id WHERE T1.de...
sql_create_context
CREATE TABLE table_63711 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the rank of Japan?
SELECT "Rank" FROM table_63711 WHERE "Nationality" = 'japan'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
在门诊被诊断为疾病J42.599的病人的检测指标805062数值的平均值以及最值数据是多少
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css
CREATE TABLE table_45696 ( "Election" real, "Candidates fielded" real, "# of seats won" real, "Total votes" real, "% of popular vote" text, "Place" text )
Can you tell me the total number of Total votes that has the Election larger than 2009, and the Candidates fielded larger than 61?
SELECT COUNT("Total votes") FROM table_45696 WHERE "Election" > '2009' AND "Candidates fielded" > '61'
wikisql
CREATE TABLE procedures ( 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 ...
what is the number of patients whose admission location is transfer from hosp/extram and drug name is ipratropium bromide mdi?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND prescriptions.drug = "Ipratropium Bromide MDI"
mimicsql_data
CREATE TABLE table_15107 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real )
On what date was the attendance larger than 29,319 and had a score of 7-6?
SELECT "Date" FROM table_15107 WHERE "Attendance" > '29,319' AND "Score" = '7-6'
wikisql
CREATE TABLE table_7430 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real )
How many Games has a Name of st phane dumas and a Rank larger than 5?
SELECT AVG("Games") FROM table_7430 WHERE "Name" = 'stéphane dumas' AND "Rank" > '5'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId num...
Comments qualifying for Think! hat.
SELECT DISTINCT (p.Id) AS "post_link" FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE c.CreationDate >= '2019-12-07' AND c.UserId = '##userid:int##' AND c.Score > 0
sede
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Contributing users and id-request-first users - how much do they overlap?.
SELECT u.Id AS "user_link", p.Id AS "post_link", p.CreationDate, (CASE WHEN p.PostTypeId = 1 THEN p.Tags WHEN p.PostTypeId = 2 THEN (SELECT Tags FROM Posts AS p3 WHERE p3.Id = p.ParentId) END) AS "tags" FROM Users AS u INNER JOIN (SELECT p2.OwnerUserId, MIN(p2.Id) AS "id", MIN(p2.CreationDate) AS "creationdate", MIN(p2...
sede
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comme...
How many users have actually read the entire Tour page? (statistically). Counts how many users have actually read the entire Tour page, based on how many who has received the 'Informed' badge.
SELECT (SELECT COUNT(Id) FROM Users) AS Users, COUNT(b.UserId) AS BadgeHolders, (CAST(COUNT(b.UserId) AS FLOAT) / (SELECT COUNT(Id) FROM Users) * 100) AS Percentage FROM Users AS u LEFT JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Informed'
sede
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
when did patient 004-32341 first receive a prescription for fentanyl (pf) 50 mcg/1 ml 2 ml inj?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32341')) AND medication.drugname = 'fentanyl (pf) 50 mcg/1...
eicu
CREATE TABLE table_16471432_4 ( directed_by VARCHAR, series__number VARCHAR )
Who was the director for the episode in season #50?
SELECT directed_by FROM table_16471432_4 WHERE series__number = 50
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
For those employees who do not work in departments with managers that have ids between 100 and 200, find first_name and employee_id , and visualize them by a bar chart, rank by the names in desc please.
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE table_27713890_1 ( production_code INTEGER, us_viewers__millions_ VARCHAR )
What is the production code that had 24.8 million u.s. viewers?
SELECT MAX(production_code) FROM table_27713890_1 WHERE us_viewers__millions_ = "24.8"
sql_create_context
CREATE TABLE table_11960610_6 ( location_attendance VARCHAR, date VARCHAR )
What was the location attendance on the date of November 15?
SELECT location_attendance FROM table_11960610_6 WHERE date = "November 15"
sql_create_context
CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE People ( person_id INTEGER, first_name VARCHAR(255), middle_name VARCHAR(255), last_name VARCHAR(255), cell_mobile_number VARCHAR(40), ...
how many registed students do each course have? List course name and the number of their registered students?, and I want to show from low to high by the y-axis.
SELECT course_name, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id JOIN Courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id ORDER BY COUNT(*)
nvbench
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...
门诊就诊21319926440开检验报告单开了几份?
SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '21319926440'
css
CREATE TABLE table_64767 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the average total when silver is more than 2, bronze is 12 and gold is less than 12?
SELECT AVG("Total") FROM table_64767 WHERE "Silver" > '2' AND "Bronze" = '12' AND "Gold" < '12'
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevent...
what are the three most frequently prescribed drugs for patients that had previously received vaccination nec within 2 months, until 2101?
SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
mimic_iii
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...
之前患者孔梦菡发生过哪些异常情况
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.YLJGDM...
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
calculate the number of patients who had received a cl reduc disloc-elbow procedure until 2104.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cl reduc disloc-elbow') AND STRFTIME('%y', procedure...
mimic_iii
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text )
Display a bar chart for how many climbers are from each country?
SELECT Country, COUNT(*) FROM climber GROUP BY Country
nvbench
CREATE TABLE table_name_55 ( date VARCHAR, venue VARCHAR )
What is the date of the game at Junction Oval?
SELECT date FROM table_name_55 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, ...
when was the first time patient 30171 got a lab test until 05/2105 for bicarbonate?
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30171) AND STRFTIME('%y-%m', labevents.charttime) <= '2105-05' ORDER BY ...
mimic_iii