context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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, ...
find the number of patients diagnosed for enthesopathy of hip whose lab test fluid is joint fluid.
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 = "Enthesopathy of hip" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For those employees who was hired before 2002-06-21, visualize the relationship between commission_pct and department_id .
SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_29179 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 28 Aug" text )
If Wed Aug 25 is no time, what is Sat aug 21?
SELECT "Sat 21 Aug" FROM table_29179 WHERE "Wed 25 Aug" = '—— No Time'
wikisql
CREATE TABLE table_35274 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text )
What is the 8:30 program that airs on the station that airs various programs at 7:30?
SELECT "8:30" FROM table_35274 WHERE "7:30" = 'various programs'
wikisql
CREATE TABLE table_train_200 ( "id" int, "gender" string, "fasting_triglycerides" int, "fasting_plasma_glucose" int, "smoking" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
fasting triglycerides > 700 mg / dl within past 12 weeks
SELECT * FROM table_train_200 WHERE fasting_triglycerides > 700
criteria2sql
CREATE TABLE table_25758 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
Who directed the episode that had 6.76 million U.S. viewers?
SELECT "Directed by" FROM table_25758 WHERE "U.S. viewers (millions)" = '6.76'
wikisql
CREATE TABLE table_29270 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
How many production codes did the episode number in series 46b have?
SELECT COUNT("Production code") FROM table_29270 WHERE "No. in series" = '46b'
wikisql
CREATE TABLE table_1099080_1 ( partial_thromboplastin_time VARCHAR, condition VARCHAR )
What was the partial thromboplastin time for factor x deficiency as seen in amyloid purpura
SELECT partial_thromboplastin_time FROM table_1099080_1 WHERE condition = "Factor X deficiency as seen in amyloid purpura"
sql_create_context
CREATE TABLE table_46726 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text )
What is the decision of the game with an attendance greater than 19,883?
SELECT "Decision" FROM table_46726 WHERE "Attendance" > '19,883'
wikisql
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE department ( dep...
Return a bar chart about the distribution of dept_name and the amount of dept_name , and group by attribute dept_name.
SELECT dept_name, COUNT(dept_name) FROM instructor GROUP BY dept_name ORDER BY salary
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
what is the cost of taking a mcv lab test?
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 = 'mcv'))
mimic_iii
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
自二零一零年八月七日到二零一五年二月三日,挂医生26801950的号看门诊的病人是多少
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.ZZYSGH = '26801950' AND zzmzjzjlb.JZKSRQ BETWEEN '2010-08-07' AND '2015-02-03' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN fzzmzjzjlb ON hz_inf...
css
CREATE TABLE table_48515 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the time of ufc 154?
SELECT "Time" FROM table_48515 WHERE "Event" = 'ufc 154'
wikisql
CREATE TABLE table_name_94 ( valvetrain VARCHAR )
What is the valvetrain with an engine model that is engine model?
SELECT valvetrain FROM table_name_94 WHERE "engine_model" = "engine_model"
sql_create_context
CREATE TABLE table_name_87 ( earnings___ INTEGER, wins VARCHAR, rank VARCHAR )
What's the smallest amount of earnings when the wins are less than 72 and the rank is more than 3?
SELECT MIN(earnings___) AS $__ FROM table_name_87 WHERE wins < 72 AND rank > 3
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,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...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of salary bin hire_date by weekday in a bar chart, I want to display in desc by the total number.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC
nvbench
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...
查看一下86323983的患者以前的治疗方案
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '86323983' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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 ...
医院1051519所有的就诊记载里参照不一样的科室和出院诊断的编码看看自费的金额和总医疗费用相比的最小值,按照从小到大的顺序显示出来
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1051519' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT)
css
CREATE TABLE table_name_34 ( attendance VARCHAR, date VARCHAR )
what is the attendance on december 14, 2003?
SELECT attendance FROM table_name_34 WHERE date = "december 14, 2003"
sql_create_context
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation b...
What are the countries of all airlines whose names start with Orbit, and count them by a bar chart, and display X in ascending order.
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY country
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Days since post creation that a vote was cast.
SELECT DATEDIFF(day, Posts.CreationDate, CreationDate) AS DayVote, COUNT(*) AS TotalN FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE (VoteTypeId = 2 OR VoteTypeId = 3) GROUP BY DATEDIFF(day, Posts.CreationDate, CreationDate) ORDER BY DayVote
sede
CREATE TABLE table_203_672 ( id number, "week" number, "date" text, "opponent" text, "result" text, "venue" text, "attendance" number )
who was the opponent during the last week of the season ?
SELECT "opponent" FROM table_203_672 ORDER BY "week" DESC LIMIT 1
squall
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Draw a bar chart about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, and show by the x-axis in asc.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_204_638 ( id number, "year" number, "tournament" text, "surface" text, "round" text, "winner" text, "score" text )
how many were carpet courts ?
SELECT COUNT(*) FROM table_204_638 WHERE "surface" = 'carpet'
squall
CREATE TABLE table_name_44 ( title VARCHAR, last_issue VARCHAR, first_issue VARCHAR )
What is the title that was first published in February 2009 and is still ongoing?
SELECT title FROM table_name_44 WHERE last_issue = "ongoing" AND first_issue = "february 2009"
sql_create_context
CREATE TABLE table_28730459_3 ( league_goals VARCHAR, league_matches VARCHAR, tebe_career VARCHAR )
What is the number of league goals for players with 10 league matches and a TeBe career of 2003?
SELECT league_goals FROM table_28730459_3 WHERE league_matches = 10 AND tebe_career = "2003"
sql_create_context
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
let me know the short title of procedure that the patient jerry deberry underwent.
SELECT procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
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 patients born in or before 2155 have procedure icd9 code 3806?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "3806"
mimicsql_data
CREATE TABLE table_44090 ( "Year" real, "Champion" text, "Country" text, "Score" real, "To par" text, "Tournament Location" text )
What country does jocelyne bourassa play for?
SELECT "Country" FROM table_44090 WHERE "Champion" = 'jocelyne bourassa'
wikisql
CREATE TABLE table_name_89 ( last_win VARCHAR, club VARCHAR )
When was the last win of Celtic?
SELECT last_win FROM table_name_89 WHERE club = "celtic"
sql_create_context
CREATE TABLE wrestler ( Name VARCHAR, Days_held VARCHAR )
What is the name of the wrestler with the fewest days held?
SELECT Name FROM wrestler ORDER BY Days_held LIMIT 1
sql_create_context
CREATE TABLE table_name_91 ( score VARCHAR, date VARCHAR )
Tell me the score on 1978-12-16
SELECT score FROM table_name_91 WHERE date = "1978-12-16"
sql_create_context
CREATE TABLE classroom ( building VARCHAR, capacity INTEGER )
Find the buildings which have rooms with capacity more than 50.
SELECT DISTINCT building FROM classroom WHERE capacity > 50
sql_create_context
CREATE TABLE table_name_64 ( rank VARCHAR, province VARCHAR )
What is the rank of the gauteng province?
SELECT rank FROM table_name_64 WHERE province = "gauteng"
sql_create_context
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 allergy ( allergy...
on the first hospital encounter was patient 002-17195 prescribed famotidine?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-17195' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
eicu
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 patient ( uniquep...
what is the average amount of the total hospital cost which involves av block?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'av block')) GROUP BY cost.patienthealthsyste...
eicu
CREATE TABLE table_2317 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment" real, "Founded" real )
where would you find a public university which was founded in 1915?
SELECT "Location(s)" FROM table_2317 WHERE "Control" = 'Public university' AND "Founded" = '1915'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Par...
Unanswered questions asked before graduation.
SELECT Posts.Id AS "post_link" FROM Posts WHERE Posts.AnswerCount = 0 AND Posts.ClosedDate IS NULL AND Posts.CreationDate < @Time ORDER BY Posts.Score DESC
sede
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...
把2005年1月7日到2016年10月5日期间患者18154604在4531182的医疗机构一共看检查过多少次查看一下
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '18154604' AND t_kc22.STA_DATE BETWEEN '2005-01-07' AND '2016-10-05' AND gwyjzb.MED_SER_ORG_NO = '4531182' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CL...
css
CREATE TABLE table_203_52 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
who was the last driver listed to receive points ?
SELECT "driver" FROM table_203_52 ORDER BY "points" LIMIT 1
squall
CREATE TABLE Addresses ( address_id INTEGER, address_content VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Order_Items ( order_id INTEGER, product_id INTEGER, ord...
How many customers using email as the contact channel? Group by customer name and bin active date by year in a stacked bar chart.
SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' GROUP BY customer_name
nvbench
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...
2007年10月4日到2010年2月18日,查一下563科室的门诊就诊数量的详细情况
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSBM = '563' AND txmzjzjlb.JZKSRQ BETWEEN '2007-10-04' AND '2010-02-18' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSBM = '563' AND ftxmzjzjlb.JZKSRQ BETWEEN '2007-10-04' AND '2010-02-18'
css
CREATE TABLE table_50339 ( "League" text, "Season" text, "Name" text, "Place" real, "Record" text, "Head Coach" text, "Points" text, "Rebounds" text, "Assists" text, "Steals" text, "Turnover" text )
Can you tell me the Name that has the Place of 1?
SELECT "Name" FROM table_50339 WHERE "Place" = '1'
wikisql
CREATE TABLE table_name_98 ( date VARCHAR, group VARCHAR, venue VARCHAR )
What was the date for the G1 group race at Flemington?
SELECT date FROM table_name_98 WHERE group = "g1" AND venue = "flemington"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients lab test results are with abnormal status from the lab test name ph?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "pH"
mimicsql_data
CREATE TABLE table_name_61 ( time VARCHAR, method VARCHAR )
What was the time when the method was TKO?
SELECT time FROM table_name_61 WHERE method = "tko"
sql_create_context
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE out...
what was the name of the intake that patient 7112 has last had today?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7112)) AND DATETIME(inputevents_cv.c...
mimic_iii
CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equity_Shareholding real ) CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id in...
What are the ids and names of the companies that operated more than one flight, and order bars in ascending order.
SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id ORDER BY T1.name
nvbench
CREATE TABLE table_4358 ( "Date" text, "Tournament" text, "Location" text, "Score" text, "Honduras scorers" text )
Which tournament took place on June 18, 2013?
SELECT "Tournament" FROM table_4358 WHERE "Date" = 'june 18, 2013'
wikisql
CREATE TABLE table_name_61 ( ground VARCHAR, score VARCHAR )
What is the Ground with a Score that is 49-80?
SELECT ground FROM table_name_61 WHERE score = "49-80"
sql_create_context
CREATE TABLE table_48508 ( "Tournament" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "Career WR"...
What is 2004, when 2007 is 'A', and when 1997 is 'A'?
SELECT "2004" FROM table_48508 WHERE "2007" = 'a' AND "1997" = 'a'
wikisql
CREATE TABLE table_name_79 ( score VARCHAR, date VARCHAR )
What was the Score on 25 May 2007?
SELECT score FROM table_name_79 WHERE date = "25 may 2007"
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,...
how many patients whose gender is f and procedure long title is intraoperative cardiac pacemaker?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Intraoperative cardiac pacemaker"
mimicsql_data
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE S...
What is my rank for this badge?.
SELECT UserId, Name, Date, Class FROM Badges WHERE Date < (SELECT Date FROM Badges WHERE UserId = 5889131 AND Name = 'Explainer' AND Class = 3) AND Name = 'Explainer' AND Class = 3
sede
CREATE TABLE table_17927935_1 ( week INTEGER, opponent VARCHAR )
What was the week number when the opponent was the New York Jets?
SELECT MAX(week) FROM table_17927935_1 WHERE opponent = "New York Jets"
sql_create_context
CREATE TABLE table_56110 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the away team score at Kardinia Park?
SELECT "Away team score" FROM table_56110 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE table_name_43 ( time_retired VARCHAR, rider VARCHAR )
What is Olivier Jacque's Time/Retired?
SELECT time_retired FROM table_name_43 WHERE rider = "olivier jacque"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id numb...
how many patients have had coronary arteriogram nec two or more times during a year before?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 WHERE d_icd_procedures.short_title = 'coronary arteriogram ...
mimic_iii
CREATE TABLE table_name_95 ( year INTEGER, venue VARCHAR )
Name the highest Year which has a Venue of narbonne , france?
SELECT MAX(year) FROM table_name_95 WHERE venue = "narbonne , france"
sql_create_context
CREATE TABLE table_21353 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Competition" text, "Man of the Match" text )
On what day was Stuart Potts the Man of the Match?
SELECT "Date" FROM table_21353 WHERE "Man of the Match" = 'Stuart Potts'
wikisql
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...
在医疗就诊73144270096中的医师为病人37130408开具过医疗项目的他们的编号和姓名都分别叫什么?
SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_CLINIC_ID = '73144270096'
css
CREATE TABLE table_name_76 ( rank VARCHAR, height_feet___m VARCHAR )
What is the rank associated with a Height feet / m of 427 / 130?
SELECT rank FROM table_name_76 WHERE height_feet___m = "427 / 130"
sql_create_context
CREATE TABLE table_61206 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "5:00 pm" text, "6:30 pm"...
What is the noon show on the channel that shows General Hospital at 3pm?
SELECT "noon" FROM table_61206 WHERE "3:00 pm" = 'general hospital'
wikisql
CREATE TABLE table_63215 ( "Island" text, "Country" text, "Population" text, "Area km\u00b2" text, "Density (per km\u00b2)" text )
Which island has a density (per km ) of 1,368?
SELECT "Island" FROM table_63215 WHERE "Density (per km\u00b2)" = '1,368'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,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...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a line chart about the change of salary over hire_date .
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_name_86 ( country VARCHAR, author VARCHAR )
Which Country's Author is based on Sophocles and Euripides?
SELECT country FROM table_name_86 WHERE author = "based on sophocles and euripides"
sql_create_context
CREATE TABLE table_47925 ( "Title" text, "Series" text, "Release" real, "Featuring" text, "Writer" text, "Director" text, "Length" text, "Release Date" text )
Who wrote Infiltration?
SELECT "Writer" FROM table_47925 WHERE "Title" = 'infiltration'
wikisql
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...
00738240365被医疗就诊的病情描述是什么?
SELECT qtb.MAIN_COND_DES FROM qtb WHERE qtb.MED_CLINIC_ID = '00738240365' UNION SELECT gyb.MAIN_COND_DES FROM gyb WHERE gyb.MED_CLINIC_ID = '00738240365' UNION SELECT zyb.MAIN_COND_DES FROM zyb WHERE zyb.MED_CLINIC_ID = '00738240365' UNION SELECT mzb.MAIN_COND_DES FROM mzb WHERE mzb.MED_CLINIC_ID = '00738240365'
css
CREATE TABLE table_69485 ( "Clubs" text, "Winners" real, "Runners-up" real, "Total finals" real, "Winnig years" text )
What is the highest total number of finals a club with more than 2 runners-up and fewer than 1 winner went to?
SELECT MAX("Total finals") FROM table_69485 WHERE "Runners-up" > '2' AND "Winners" < '1'
wikisql
CREATE TABLE table_1137702_3 ( winning_driver VARCHAR, grand_prix VARCHAR )
Who was the winning driver when the grand Prix was at Belgian Grand Prix?
SELECT winning_driver FROM table_1137702_3 WHERE grand_prix = "Belgian grand_prix"
sql_create_context
CREATE TABLE table_37394 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text )
Which Position has a D.O.B. of 3 june 1989?
SELECT "Position" FROM table_37394 WHERE "D.O.B." = '3 june 1989'
wikisql
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...
这位昌梦秋的患者在08年11月16日到10年10月26日期间,去医院看病最主要看的是哪位医生
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '昌梦秋' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-11-16' AND '2010-10-26' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM...
css
CREATE TABLE table_56453 ( "Power Plant" text, "Producer" text, "Location" text, "State" text, "Total Capacity (MWe)" real )
What company is the producer at the poolavadi location
SELECT "Producer" FROM table_56453 WHERE "Location" = 'poolavadi'
wikisql
CREATE TABLE table_59634 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
Name the highest Year which has a Venue of narbonne , france?
SELECT MAX("Year") FROM table_59634 WHERE "Venue" = 'narbonne , france'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees who did not have any job in the past, draw a line chart about the change of salary over hire_date .
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_name_2 ( writer VARCHAR, company VARCHAR, title VARCHAR )
Who was the writer of The Year of the Cat from the BBV?
SELECT writer FROM table_name_2 WHERE company = "bbv" AND title = "the year of the cat"
sql_create_context
CREATE TABLE table_63483 ( "Round" text, "Main date" text, "Number of fixtures" real, "Clubs" text, "New entries this round" text )
What are the club number for the first round?
SELECT "Clubs" FROM table_63483 WHERE "Round" = 'first round'
wikisql
CREATE TABLE table_62031 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
What is Results, when First Elected is less than 1988?
SELECT "Results" FROM table_62031 WHERE "First elected" < '1988'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
has the arterial bp [systolic] of patient 4269 ever greater been on the first icu visit than 133.0?
SELECT COUNT(*) > 0 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 = 4269) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_i...
mimic_iii
CREATE TABLE table_1139835_3 ( winners VARCHAR, season_result VARCHAR )
who is the winners where season result is 7th
SELECT winners FROM table_1139835_3 WHERE season_result = "7th"
sql_create_context
CREATE TABLE table_55275 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Which December 4, 1976 week has an attendance less than 57,366?
SELECT MIN("Week") FROM table_55275 WHERE "Date" = 'december 4, 1976' AND "Attendance" < '57,366'
wikisql
CREATE TABLE table_name_99 ( home_team VARCHAR, venue VARCHAR )
What was the home team score at VFL Park?
SELECT home_team AS score FROM table_name_99 WHERE venue = "vfl park"
sql_create_context
CREATE TABLE table_10689 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the attendance on location for a record of 40 40?
SELECT "Location Attendance" FROM table_10689 WHERE "Record" = '40–40'
wikisql
CREATE TABLE bridge ( architect_id int, id int, name text, location text, length_meters real, length_feet real ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE mill ( architect_id int, id int, location text, name text, ...
Give me a histogram for what are the ids and names of the architects who built at least 3 bridges ?, and order Y-axis from low to high order.
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of code , and group by attribute founder in a bar chart, and I want to list by the Y from low to high please.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_21804557_18 ( mountains_classification VARCHAR, metas_volantes_classification VARCHAR )
Who got the mountains classification when Michael Albasini won the stage?
SELECT mountains_classification FROM table_21804557_18 WHERE metas_volantes_classification = "Michael Albasini"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the hire_date bin hire_date by time by a bar chart, and could you display y axis in ascending order?
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_56651 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did St Kilda score when they were the home team?
SELECT "Home team score" FROM table_56651 WHERE "Home team" = 'st kilda'
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 jybgb ( BBCJBW text, BBDM tex...
00年6月2号到06年12月18号,患者方欣悦的236211指标是怎样的
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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_MZJZ...
css
CREATE TABLE table_name_32 ( attendance VARCHAR, result VARCHAR )
What is the attendance number when the result is l 41-37?
SELECT attendance FROM table_name_32 WHERE result = "l 41-37"
sql_create_context
CREATE TABLE table_2685 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the team for united center 22,147
SELECT "Team" FROM table_2685 WHERE "Location Attendance" = 'United Center 22,147'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_g...
Which courses are taught by Neve Gordon ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Neve Gordon%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = c...
advising
CREATE TABLE table_4470 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text )
Tell me the total number of picks for position of m of williams college
SELECT COUNT("Pick #") FROM table_4470 WHERE "Position" = 'm' AND "Affiliation" = 'williams college'
wikisql
CREATE TABLE table_23995 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "Height" text, "Weight" text, "College" text, "Status" text )
what's the position of pick # 79
SELECT "Position" FROM table_23995 WHERE "Pick #" = '79'
wikisql
CREATE TABLE table_64933 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real )
How much Attendance has an Arena of arrowhead pond of anaheim, and Points of 5?
SELECT SUM("Attendance") FROM table_64933 WHERE "Arena" = 'arrowhead pond of anaheim' AND "Points" = '5'
wikisql
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 allergy ( allergy...
count the number of patients who had had a mechanical ventilation - pressure support procedure done two or more times in a year before.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'mechanical ventilation - pressure support' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETI...
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...
依科室的不同编号列一下1456542这家医院所有就诊记录里面,统筹基金的开销与医疗费用总数的平均比值
SELECT gwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1456542' GROUP BY gwyjzb.MED_ORG_DEPT_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI...
css
CREATE TABLE table_1463332_2 ( _number_appearances VARCHAR, most_recent_final VARCHAR )
What is the number of appearances where the most recent final result is 1999, beat Genk 3-1?
SELECT COUNT(_number_appearances) FROM table_1463332_2 WHERE most_recent_final = "1999, beat Genk 3-1"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
医疗记录中年龄低于23岁的患者的医疗费平均金额是多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE < 23 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE < 23)
css
CREATE TABLE table_53600 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Career Win\u2013Loss" text )
What is the 2009 value with a 1r in 2010 and A in 2011?
SELECT "2009" FROM table_53600 WHERE "2010" = '1r' AND "2011" = 'a'
wikisql