context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_74 ( employed VARCHAR, position_held VARCHAR )
What are the years employed shown for mathematics & prefect master?
SELECT employed FROM table_name_74 WHERE position_held = "mathematics & prefect master"
sql_create_context
CREATE TABLE table_9492 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What is the total number of Date, when Partner is 'Carl-Uwe Steeb'?
SELECT COUNT("Date") FROM table_9492 WHERE "Partner" = 'carl-uwe steeb'
wikisql
CREATE TABLE table_30825 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
Who was the tournament winner in the Southwestern Athletic Conference?
SELECT "Tournament Winner" FROM table_30825 WHERE "Conference" = 'Southwestern Athletic Conference'
wikisql
CREATE TABLE table_name_56 ( position VARCHAR, club_province VARCHAR )
What is the position of Perpignan?
SELECT position FROM table_name_56 WHERE club_province = "perpignan"
sql_create_context
CREATE TABLE table_name_93 ( total VARCHAR, gold VARCHAR, silver VARCHAR, bronze VARCHAR )
Which Total has a Silver larger than 8, and a Bronze of 20, and a Gold smaller than 20?
SELECT COUNT(total) FROM table_name_93 WHERE silver > 8 AND bronze = 20 AND gold < 20
sql_create_context
CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(80) ) CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Contacts ( contact_id INTEGER, ...
Show the number of customer address history in each day and bin date to by weekday with a bar chart, and could you order y axis in ascending order?
SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id ORDER BY COUNT(date_to)
nvbench
CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number )
What are the names of musicals who have at 3 or more actors?
SELECT T2.name FROM actor AS T1 JOIN musical AS T2 ON T1.musical_id = T2.musical_id GROUP BY T1.musical_id HAVING COUNT(*) >= 3
spider
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
what are the three most common drugs prescribed to patients with age 40s within 2 months after they were diagnosed with anemia nos, since 4 years ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLO...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday, list by the Y in ascending please.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fli...
flight from SALT LAKE CITY to OAKLAND CALIFORNIA
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, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_17904 ( "Series number" text, "Episode number" real, "Date of first broadcast" text, "Total viewers" real, "Series average" real )
what is the total viewers where the date of first broadcast is 28 january 2010 and the episode number is 1?
SELECT MIN("Total viewers") FROM table_17904 WHERE "Date of first broadcast" = '28 January 2010' AND "Episode number" = '1'
wikisql
CREATE TABLE table_34597 ( "Number" real, "Name" text, "Position" text, "Height" text, "Weight" real, "Class" text, "Hometown" text )
Weight of 220 has what class?
SELECT "Class" FROM table_34597 WHERE "Weight" = '220'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
when did patient 010-11305 for the last time leave the hospital until 2101?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '010-11305' AND STRFTIME('%y', patient.hospitaldischargetime) <= '2101' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patient...
since 4 years ago, what was the last hospital admission time of patient 028-23341 via the recovery room?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '028-23341' AND patient.hospitaladmitsource = 'recovery room' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, X...
看一下在医疗就诊62739895555中给患者严梦竹做检验的科室编码及名称分别是什么
SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '62739895555'
css
CREATE TABLE table_name_9 ( run_2 VARCHAR, rank VARCHAR )
Which Run 2 has a Rank of 4?
SELECT run_2 FROM table_name_9 WHERE rank = "4"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE class_of_servi...
what price is a LIMOUSINE service to NEW YORK 's LGA
SELECT DISTINCT ground_service.ground_fare FROM airport, city, ground_service WHERE (airport.airport_code = 'LGA' AND city.city_name = 'NEW YORK' AND ground_service.airport_code = airport.airport_code AND ground_service.city_code = city.city_code) AND ground_service.transport_type = 'LIMOUSINE'
atis
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...
已经被门诊诊断为疾病W41.056的这个患者96646392的D2聚体(肝素/EDTA)的结果定量及其单位分别是什么?
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 status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, d...
Create a bar chart showing the total number across city
SELECT city, COUNT(*) FROM station GROUP BY city
nvbench
CREATE TABLE table_71837 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Name the average attendance with dallas visitor
SELECT AVG("Attendance") FROM table_71837 WHERE "Visitor" = 'dallas'
wikisql
CREATE TABLE table_200_47 ( id number, "date" text, "event" text, "duration\t\n(months)" text, "duration\t\t\n(years)" text )
when did the first drop in the experiment fall ?
SELECT "date" FROM table_200_47 WHERE "event" = '1st drop fell'
squall
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
41547321号参保病人在14年11月21日到16年7月7日期间在门诊交了多少的手术费?
SELECT SUM(t_kc22.AMOUNT) 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 = '41547321' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2014-11-21' AND '2016-07-07' AND t_kc22.MED_I...
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...
能不能告诉我患者施志业在医疗记录中药品消费在1613.81元以上的医疗就诊有哪几次?医疗就诊的编号是多少
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '施志业' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1613.81)
css
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE aircraft ( ...
i need information on flights between ST. PETERSBURG and CHARLOTTE
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 = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
彭德佑这个病人被开出的药品金额超过438.17元的医疗记录有哪些?把医疗就诊编号列出来
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '彭德佑' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 438.17)
css
CREATE TABLE table_36422 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text, "Record" text )
What was the Record on September 21?
SELECT "Record" FROM table_36422 WHERE "Date" = 'september 21'
wikisql
CREATE TABLE table_13006 ( "Mountain" text, "Height (m)" real, "Height (ft)" real, "Range" text, "Prominence (m)" real, "Parent mountain" text, "First ascent" text )
What is the largest height when the prominence is 3,118?
SELECT MAX("Height (m)") FROM table_13006 WHERE "Prominence (m)" = '3,118'
wikisql
CREATE TABLE table_11570261_2 ( margin_of_victory VARCHAR, runner_s__up VARCHAR )
What was the margin of victory over Justin Leonard, phillip price?
SELECT COUNT(margin_of_victory) FROM table_11570261_2 WHERE runner_s__up = "Justin Leonard, Phillip Price"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
Questions which had given tag (included the editor who added it).
WITH firstrev_cte AS (SELECT p.Id AS pid, MIN(ph.Id) AS MinId FROM PostHistory AS ph INNER JOIN Posts AS p ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId IN (3, 6, 9) AND ph.Text LIKE '%<##tagName##>%' GROUP BY p.Id) SELECT pid AS "post_link", url = 'site://posts/' + CAST(PostId AS TEXT) + '/revisions', UserId AS "user...
sede
CREATE TABLE table_name_41 ( place VARCHAR, country VARCHAR, player VARCHAR )
What is Place, when Country is 'United States', and when Player is 'Lee Trevino'?
SELECT place FROM table_name_41 WHERE country = "united states" AND player = "lee trevino"
sql_create_context
CREATE TABLE table_name_65 ( English VARCHAR, winning_song VARCHAR )
Which winning song was sung by aku tetap milikmu?
SELECT WINNING_SONG(English AS Title) FROM table_name_65 WHERE winning_song = "aku tetap milikmu"
sql_create_context
CREATE TABLE table_58028 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
In what tournament was there an extra of 400 m hurdles?
SELECT "Tournament" FROM table_58028 WHERE "Extra" = '400 m hurdles'
wikisql
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the last_name by a bar chart, could you display from high to low by the Y-axis?
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_26048 ( "Years led" text, "Span of years led" real, "Player" text, "Titles won at point of lead" real, "Total Career titles" real, "Tournament at which lead began" text )
At which tournament did william renshaw begin his lead when he had won 7 titles?
SELECT "Tournament at which lead began" FROM table_26048 WHERE "Player" = 'William Renshaw' AND "Titles won at point of lead" = '7'
wikisql
CREATE TABLE table_204_846 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" number )
which tie number did not have any attendance ?
SELECT "tie no" FROM table_204_846 WHERE "attendance" IS NULL
squall
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...
从07年7月31日到07年12月11日,小儿骨质疏松科的门诊量如何?
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSMC = '小儿骨质疏松科' AND zzmzjzjlb.JZKSRQ BETWEEN '2007-07-31' AND '2007-12-11' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSMC = '小儿骨质疏松科' AND fzzmzjzjlb.JZKSRQ BETWEEN '2007-07-31' AND '2007-12-11'
css
CREATE TABLE table_24027 ( "Ep." real, "Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. Code" text )
How many episodes had a production code of 5m13?
SELECT COUNT("Ep.") FROM table_24027 WHERE "Prod. Code" = '5M13'
wikisql
CREATE TABLE table_61659 ( "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, "4:00 pm" text, "4:30 pm"...
WHAT IS THE 4:30PM WITH AN 8:00AM CBS THIS MORNING?
SELECT "4:30 pm" FROM table_61659 WHERE "8:00 am" = 'cbs this morning'
wikisql
CREATE TABLE table_71100 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text )
What was the number of males that had the number females 62 331?
SELECT "males" FROM table_71100 WHERE "females" = '62 331'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
tell me both the short title and long title of diagnoses for patient josette orr.
SELECT diagnoses.short_title, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr"
mimicsql_data
CREATE TABLE table_10975034_4 ( player VARCHAR, pick__number VARCHAR )
Which players have a pick number of 27?
SELECT player FROM table_10975034_4 WHERE pick__number = 27
sql_create_context
CREATE TABLE table_31250 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What is the original air date of the episode that was directed by Bruce Seth Green?
SELECT "Original air date" FROM table_31250 WHERE "Directed by" = 'Bruce Seth Green'
wikisql
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...
Count the number of patients admitted to the hospital before year 2157 whose procedure long title is 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 WHERE demographic.admityear < "2157" AND procedures.long_title = "Open reduction of fracture with internal fixation, femur"
mimicsql_data
CREATE TABLE table_21748 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
How many locations have the call signs dxjp-fm?
SELECT COUNT("Location") FROM table_21748 WHERE "Callsign" = 'DXJP-FM'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
when has patient 59275 first had the minimum value of rdw until 40 months ago?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59275) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-40 month'...
mimic_iii
CREATE TABLE table_name_93 ( overall INTEGER, position VARCHAR, round VARCHAR )
What is the lowest Overall for the wide receiver in a round less than 2?
SELECT MIN(overall) FROM table_name_93 WHERE position = "wide receiver" AND round < 2
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
show me times for flights from SAN FRANCISCO to ATLANTA
SELECT DISTINCT flight.arrival_time, flight.departure_time 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_cod...
atis
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...
对于医疗费总额高于9559.88元的患者83111468的医疗记录,列出有什么入院诊断疾病编码和名称?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '83111468' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 9559.88)
css
CREATE TABLE table_261642_3 ( frequency__hz_ VARCHAR, g__μs_km_ VARCHAR )
what is the frequency (hz) when the g ( s/km) is 53.205?
SELECT frequency__hz_ FROM table_261642_3 WHERE g__μs_km_ = "53.205"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
tell me the maximum cost for a hospital with cerebral mass of unknown etiology?
SELECT MAX(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 = 'cerebral mass of unknown etiology')) GROUP B...
eicu
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
when was the first time patient 26799 was having less than 18.0 respiratory rate on 09/20/last year?
SELECT chartevents.charttime 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 = 26799)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat...
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 d_icd_procedures ( ...
until 2104 how many patients were diagnosed with cor ath unsp vsl ntv/gft and didn't come back to the hospital within 2 months?
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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 = 'cor ath un...
mimic_iii
CREATE TABLE table_29635868_1 ( object_date VARCHAR, origin VARCHAR )
How many object dates have origin in Samoa?
SELECT COUNT(object_date) FROM table_29635868_1 WHERE origin = "Samoa"
sql_create_context
CREATE TABLE Staff ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255) ) CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problem_Log ( problem_log_id INTEGER, ...
For the problem whose id is 10, bin the log_entry_date into the weekday interval and count the date, and return a bar chart, display by the Y from high to low.
SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) DESC
nvbench
CREATE TABLE table_name_53 ( position INTEGER, club VARCHAR, points VARCHAR, draws VARCHAR )
What is the position when the points were less than 34, draws of 7, and a Club of sd eibar?
SELECT AVG(position) FROM table_name_53 WHERE points < 34 AND draws = 7 AND club = "sd eibar"
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, could you list by the total number in asc?
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY)
nvbench
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, ...
I need to see my transcript .
SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1
advising
CREATE TABLE table_name_16 ( wins INTEGER, draws VARCHAR, scored VARCHAR, team VARCHAR )
What is the fewest wins that has fewer than 23 goals scored, team of 2 de Mayo, and fewer than 7 draws?
SELECT MIN(wins) FROM table_name_16 WHERE scored < 23 AND team = "2 de mayo" AND draws < 7
sql_create_context
CREATE TABLE playlists ( id INTEGER, name VARCHAR(120) ) CREATE TABLE invoice_lines ( id INTEGER, invoice_id INTEGER, track_id INTEGER, unit_price NUMERIC(10,2), quantity INTEGER ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VAR...
List the number of invoices from the US, grouped by state by a bar chart, show by the Y-axis from low to high.
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*)
nvbench
CREATE TABLE table_204_392 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "country" text, "domed or retractable roof" text )
how many more seats does at & t stadium have than ford field ?
SELECT (SELECT "capacity" FROM table_204_392 WHERE "stadium" = 'at&t stadium') - (SELECT "capacity" FROM table_204_392 WHERE "stadium" = 'ford field')
squall
CREATE TABLE table_1341690_18 ( result VARCHAR, incumbent VARCHAR )
What were the results when the incumbent was John Breaux?
SELECT result FROM table_1341690_18 WHERE incumbent = "John Breaux"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
what was the name of the last lab test that patient 006-133605 had on this hospital visit?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hospitaldischargetime IS NULL)) ORDER BY lab.labresulttime DESC L...
eicu
CREATE TABLE table_27313 ( "Region" text, "Preschool (0\u20135 years)" text, "Primary (6\u201313 years)" text, "Secondary (14\u201317 years)" text, "Tertiary (18\u201324 years)" text )
What is the enrollment ratio for preschool in the region where enrollment ratio for tertiary is 29.55?
SELECT "Preschool (0\u20135 years)" FROM table_27313 WHERE "Tertiary (18\u201324 years)" = '29.55'
wikisql
CREATE TABLE table_name_18 ( score VARCHAR, competition VARCHAR )
What's the score of the friendly competition?
SELECT score FROM table_name_18 WHERE competition = "friendly"
sql_create_context
CREATE TABLE table_203_99 ( id number, "season" number, "date" text, "driver" text, "team" text, "chassis" text, "engine" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text )
what is the total number dallara chassis listed in the table ?
SELECT COUNT(*) FROM table_203_99 WHERE "chassis" = 'dallara'
squall
CREATE TABLE table_name_87 ( rank INTEGER, notes VARCHAR, time VARCHAR )
What is the lowest rank for the team that raced a time of 6:17.62 and a notes of sa/b?
SELECT MIN(rank) FROM table_name_87 WHERE notes = "sa/b" AND time = "6:17.62"
sql_create_context
CREATE TABLE table_name_21 ( attendance INTEGER, date VARCHAR, week VARCHAR )
Name the most attendance for november 17, 1946 and week more than 8
SELECT MAX(attendance) FROM table_name_21 WHERE date = "november 17, 1946" AND week > 8
sql_create_context
CREATE TABLE table_1213511_7 ( player VARCHAR, position VARCHAR, nhl_team VARCHAR )
Which players have the position of centre and play for the nhl team new york rangers
SELECT player FROM table_1213511_7 WHERE position = "Centre" AND nhl_team = "New York Rangers"
sql_create_context
CREATE TABLE table_5934 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real )
What is the date of the Los Angeles open?
SELECT "Date" FROM table_5934 WHERE "Tournament" = 'los angeles open'
wikisql
CREATE TABLE table_203_522 ( id number, "week" number, "date" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "venue" text, "attendance" number )
what was the team record during the 10th week of the season ?
SELECT "results\nteam record" FROM table_203_522 WHERE "week" = 10
squall
CREATE TABLE table_name_42 ( opponent VARCHAR, date VARCHAR )
Which Opponent has a Date of march 16?
SELECT opponent FROM table_name_42 WHERE date = "march 16"
sql_create_context
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_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id num...
what is the yearly average of heart rate for patient 25796 until 49 months ago?
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25796)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear...
mimic_iii
CREATE TABLE table_name_24 ( player VARCHAR, position VARCHAR, school_club_team VARCHAR )
Who is the forward from Grambling State?
SELECT player FROM table_name_24 WHERE position = "forward" AND school_club_team = "grambling state"
sql_create_context
CREATE TABLE table_name_20 ( format VARCHAR, label VARCHAR )
What was the format when the label was loen entertainment?
SELECT format FROM table_name_20 WHERE label = "loen entertainment"
sql_create_context
CREATE TABLE table_7586 ( "1900s" real, "1920s" real, "1930s" real, "1940s" real, "1950s" real, "1960s" real, "1970s" real, "1980s" real, "1990s" real, "2000s to date" real, "Total to date" real )
What was the lowest in the 1930s, has more than 1 in the 1940s, 0 in the 1990s, and a total to date of less than 17?
SELECT MIN("1930s") FROM table_7586 WHERE "1940s" > '1' AND "1990s" < '1' AND "Total to date" < '17'
wikisql
CREATE TABLE table_23472 ( "Language" text, "Concepci\u00f3n Municipality (%)" real, "San Javier Municipality (%)" real, "San Ram\u00f3n Municipality (%)" real, "San Juli\u00e1n Municipality (%)" real, "San Antonio de Lomer\u00edo Municipality (%)" text, "Cuatro Ca\u00f1adas Municipality (%)...
What is the San Javier municipality percentage if the Cuatro Ca adas municipality percentage is 202?
SELECT "San Javier Municipality (%)" FROM table_23472 WHERE "Cuatro Ca\u00f1adas Municipality (%)" = '202'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
provide the number of patients with diagnoses icd9 code v1009 who were admitted before the year 2135.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2135" AND diagnoses.icd9_code = "V1009"
mimicsql_data
CREATE TABLE table_204_415 ( id number, "season" text, "tier" number, "division" text, "place" text )
after the 1994/95 season , how many first place finishes did the club have ?
SELECT COUNT(*) FROM table_204_415 WHERE "season" > '1994/95' AND "place" = 1
squall
CREATE TABLE table_name_41 ( score VARCHAR, player VARCHAR )
What is Score, when Player is 'Vijay Singh'?
SELECT score FROM table_name_41 WHERE player = "vijay singh"
sql_create_context
CREATE TABLE table_name_78 ( year VARCHAR, total VARCHAR, competitors VARCHAR )
In what Year did Yugoslavia have 4 Competitors with 0 medals Total?
SELECT year FROM table_name_78 WHERE total = "0" AND competitors = "4"
sql_create_context
CREATE TABLE table_name_83 ( country VARCHAR, iata VARCHAR )
Which Country that has a IATA of bal?
SELECT country FROM table_name_83 WHERE iata = "bal"
sql_create_context
CREATE TABLE hall_of_fame ( player_id TEXT, yearid INTEGER, votedby TEXT, ballots NUMERIC, needed NUMERIC, votes NUMERIC, inducted TEXT, category TEXT, needed_note TEXT ) CREATE TABLE pitching ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id...
For each year, return the year and the average number of attendance at home games, and I want to list by the X in desc please.
SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year DESC
nvbench
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE DE...
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students Plot them as bar chart, sort bar from low to high order.
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY STU_FNAME
nvbench
CREATE TABLE table_name_81 ( external_affairs VARCHAR, human_resources_ VARCHAR, _operations VARCHAR )
Who was in external affairs when Jakki Doyle was in Human Resources & Operations?
SELECT external_affairs FROM table_name_81 WHERE human_resources_ & _operations = "jakki doyle"
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...
what is primary disease and procedure icd9 code of subject id 4589?
SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "4589"
mimicsql_data
CREATE TABLE table_name_10 ( record VARCHAR, score VARCHAR )
What was the Record of the game with a Score of 118 105?
SELECT record FROM table_name_10 WHERE score = "118–105"
sql_create_context
CREATE TABLE table_29301050_1 ( train_name VARCHAR, arrival_lonavla VARCHAR )
which train name arrives in lonavla at 17:45
SELECT train_name FROM table_29301050_1 WHERE arrival_lonavla = "17:45"
sql_create_context
CREATE TABLE table_name_47 ( gold INTEGER, bronze VARCHAR, silver VARCHAR, rank VARCHAR )
What nation with Rank 1 won the fewest gold medals while winning more than 11 silver but fewer than 7 bronze medals?
SELECT MIN(gold) FROM table_name_47 WHERE silver > 11 AND rank = "1" AND bronze < 7
sql_create_context
CREATE TABLE table_name_5 ( result VARCHAR, date VARCHAR )
What was the result and score of the game on February 22?
SELECT result FROM table_name_5 WHERE date = "february 22"
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...
provide the number of patients whose primary disease is st elevated myocardial infarction\cardiac cath and admission year is less than 2197?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2197"
mimicsql_data
CREATE TABLE table_78765 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What player has 289 as the total?
SELECT "Player" FROM table_78765 WHERE "Total" = '289'
wikisql
CREATE TABLE table_name_89 ( report VARCHAR, venue VARCHAR )
Which report corresponds to the State Sports Centre?
SELECT report FROM table_name_89 WHERE venue = "state sports centre"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
is glucagon prescribed since 6 years ago to patient 28099?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28099) AND prescriptions.drug = 'glucagon' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-6 year')
mimic_iii
CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
A bar chart showing how many debates are held for each venue, and I want to show y-axis in asc order.
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY COUNT(Venue)
nvbench
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, ...
provide the number of patients whose primary disease is hyperglycemia and procedure icd9 code is 4576.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND procedures.icd9_code = "4576"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
How many patients with opn rt hemicolectomy nec remained admitted in hospital for more than 7 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.short_title = "Opn rt hemicolectomy NEC"
mimicsql_data
CREATE TABLE table_name_71 ( player VARCHAR, score VARCHAR )
Which Player has a Score of 72-69-73=214?
SELECT player FROM table_name_71 WHERE score = 72 - 69 - 73 = 214
sql_create_context
CREATE TABLE table_1723080_1 ( run_time VARCHAR, viewers__in_millions_ VARCHAR )
What is run time when there were 7.4 million viewers?
SELECT run_time FROM table_1723080_1 WHERE viewers__in_millions_ = "7.4"
sql_create_context
CREATE TABLE table_1626 ( "Series" text, "Title" text, "Broadcasts (TV) 1" real, "Episodes (TV+extra) 2" text, "Directors" text, "Aired in Japan 3" text, "US Release Date" text )
When galaxy angel aa is the title what was the series?
SELECT "Series" FROM table_1626 WHERE "Title" = 'Galaxy Angel AA'
wikisql
CREATE TABLE table_name_64 ( partial_failures INTEGER, failures VARCHAR, successes VARCHAR )
Failures larger than 0, and a Successes of 1 has what lowest partial failures?
SELECT MIN(partial_failures) FROM table_name_64 WHERE failures > 0 AND successes = 1
sql_create_context