context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
医疗就诊14428902426中,患者是否结清了所有的费用明细项目
SELECT (SELECT SUM(STA_FLG) FROM t_kc22 WHERE MED_CLINIC_ID = '14428902426') = (SELECT COUNT(*) FROM t_kc22 WHERE MED_CLINIC_ID = '14428902426')
css
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, ...
how many of the patients with item id 51269 belonged to white ethnic origin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE" AND lab.itemid = "51269"
mimicsql_data
CREATE TABLE table_name_9 ( opponent VARCHAR, date VARCHAR )
Which Opponent has a Date of november 21, 1999?
SELECT opponent FROM table_name_9 WHERE date = "november 21, 1999"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight ( aircraft_code_sequence text, ...
lowest fare from SAN FRANCISCO to SAN DIEGO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis
CREATE TABLE table_name_66 ( week INTEGER, date VARCHAR )
What's the highest week for the day of October 21, 1956?
SELECT MAX(week) FROM table_name_66 WHERE date = "october 21, 1956"
sql_create_context
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
where is a good place in the yosemite and mono lake area for french food ?
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
has patient 006-167444 received a nicotine patch procedure in the other hospitals in 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-167444' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '006-167444' AND patient.hospitaldischargetime IS NULL)) AND ...
eicu
CREATE TABLE table_name_84 ( rank VARCHAR, laps VARCHAR, finish VARCHAR )
What rank had less than 200 laps with a finish of 26?
SELECT rank FROM table_name_84 WHERE laps < 200 AND finish = "26"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
Which class this semester is a prerequisite for the majority of classes I could take later ?
SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester...
advising
CREATE TABLE table_47377 ( "Rank" real, "Mountain Peak" text, "Region" text, "Mountain Range" text, "Location" text )
what is the mountain peak when the location is 53.1370 n 119.2667 w?
SELECT "Mountain Peak" FROM table_47377 WHERE "Location" = '53.1370°n 119.2667°w'
wikisql
CREATE TABLE table_22038 ( "Team" text, "Average" text, "Points" real, "Played" real, "1991-92" text, "1992-93" text, "1993-94" real )
Name the most played when points is 105
SELECT MAX("Played") FROM table_22038 WHERE "Points" = '105'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
Fall 2010 , is there a 1 -credit upper level class ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 1 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AND seme...
advising
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,...
查查39700520这个病人在医院6630727中,出院诊断疾病名称不包含脑外伤的医疗就诊记录编码
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '39700520' AND MED_SER_ORG_NO = '6630727' AND NOT OUT_DIAG_DIS_NM LIKE '%脑外伤%'
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...
给病患患有白内障的开出的药品编号是什么名称都叫啥?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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.IN_DIAG_DIS_NM = '白内障'
css
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) ...
what is the top five prescription drugs among the patients with an age 50s?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5
mimic_iii
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport_service ( city_code varchar, ...
show me the cheapest fare from DALLAS to BALTIMORE
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_name_58 ( rank INTEGER, heat INTEGER )
Which Rank has a Heat larger than 7?
SELECT MAX(rank) FROM table_name_58 WHERE heat > 7
sql_create_context
CREATE TABLE table_name_76 ( year INTEGER, actress VARCHAR )
When did Quvenzhan Wallis first win?
SELECT MIN(year) FROM table_name_76 WHERE actress = "quvenzhané wallis"
sql_create_context
CREATE TABLE table_18083 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What was the number of bonus tries when there were 522 points against?
SELECT "Try bonus" FROM table_18083 WHERE "Points against" = '522'
wikisql
CREATE TABLE table_37014 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Which home team has a score of 5 6?
SELECT "Home" FROM table_37014 WHERE "Score" = '5 – 6'
wikisql
CREATE TABLE table_name_97 ( athlete VARCHAR, time VARCHAR, country VARCHAR, place VARCHAR, year VARCHAR )
Which Athlete has a Place of 1, and a Year smaller than 1988, and a Country of gre, and a Time of 21:57:00?
SELECT athlete FROM table_name_97 WHERE place = 1 AND year < 1988 AND country = "gre" AND time = "21:57:00"
sql_create_context
CREATE TABLE table_52022 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the attendance when Footscray played as the away team?
SELECT COUNT("Crowd") FROM table_52022 WHERE "Away team" = 'footscray'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
What amount of 200 -level classes are available for Fall and Winter ?
SELECT COUNT(DISTINCT course.department, course.name, course.number, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_...
advising
CREATE TABLE bdmzjzjlb ( 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...
门诊就诊80538748012的就诊状态代码以及名称分别是什么?
SELECT wdmzjzjlb.JZZTDM, wdmzjzjlb.JZZTMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '80538748012' UNION SELECT bdmzjzjlb.JZZTDM, bdmzjzjlb.JZZTMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '80538748012'
css
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_addr...
Draw a bar chart about the distribution of date_address_from and the sum of monthly_rental bin date_address_from by weekday.
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_1 ( rank VARCHAR, gold VARCHAR, bronze VARCHAR, total VARCHAR )
How many ranks have a Bronze smaller than 8, and a Total smaller than 7, and a Gold smaller than 1?
SELECT COUNT(rank) FROM table_name_1 WHERE bronze < 8 AND total < 7 AND gold < 1
sql_create_context
CREATE TABLE table_72633 ( "Rank" real, "Country/Territory" text, "Miss World" real, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "5th Runner-up" real, "6th Runner-up" real, "Semifinalists" real, "Total" real )
What is the United States rank?
SELECT COUNT("Rank") FROM table_72633 WHERE "Country/Territory" = 'United States'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
6107007医疗机构在二零零二年十月九日到二零零六年十二月二十日期间一共有多少新生儿门诊的就诊记录
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '6107007' AND JZKSRQ BETWEEN '2002-10-09' AND '2006-12-20' AND ZSEBZ > 0
css
CREATE TABLE table_name_59 ( constructor VARCHAR, grid VARCHAR, rank VARCHAR )
Who was #16 rank constructor with a grid of more than 1?
SELECT constructor FROM table_name_59 WHERE grid > 1 AND rank = 16
sql_create_context
CREATE TABLE table_37816 ( "Week of" text, "Tournament" text, "Champions" text, "Runners-up" text, "Semifinalists" text )
Whose Runner-up has a Semifinalist of guillermo p rez-rold n andrea gaudenzi?
SELECT "Runners-up" FROM table_37816 WHERE "Semifinalists" = 'guillermo pérez-roldán andrea gaudenzi'
wikisql
CREATE TABLE table_name_56 ( world_record VARCHAR )
What's the 102kg when the snatch was snatch and the olympic record was the world record?
SELECT 102 AS kg FROM table_name_56 WHERE world_record = "olympic record" AND "snatch" = "snatch"
sql_create_context
CREATE TABLE table_255205_1 ( founded VARCHAR, nickname VARCHAR )
How many times this institution was founded that was nicknamed Beavers?
SELECT COUNT(founded) FROM table_255205_1 WHERE nickname = "Beavers"
sql_create_context
CREATE TABLE table_203_195 ( id number, "pump type and source" text, "typical use" text, "35 \u00b0c\n(e.g. heated screed floor)" number, "45 \u00b0c\n(e.g. heated screed floor)" number, "55 \u00b0c\n(e.g. heated timber floor)" number, "65 \u00b0c\n(e.g. radiator or dhw)" number, "75 \u0...
how many pump types have no typical use listed ?
SELECT COUNT("pump type and source") FROM table_203_195 WHERE "typical use" IS NULL
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
is there any history of microbiology test results for patient 031-3355's blood, venipuncture since 1 year ago?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME(microlab...
eicu
CREATE TABLE table_45998 ( "Pick" real, "Player" text, "Team" text, "Position" text, "Hometown/School" text )
What pick number was the rhp with a hometown/school of university of hawaii?
SELECT MIN("Pick") FROM table_45998 WHERE "Position" = 'rhp' AND "Hometown/School" = 'university of hawaii'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_204_95 ( id number, "name" text, "title" text, "first year\nin this position" number, "years at nebraska" text, "alma mater" text )
which coach listed started first ?
SELECT "name" FROM table_204_95 ORDER BY "first year\nin this position" LIMIT 1
squall
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
what was the name of the last lab test that was given to patient 51663 until 09/2105?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51663) AND STRFTIME('%y-%m', labevents.charttime) <= '2105-09' ORDER BY labevents.charttime DESC LIMIT 1)
mimic_iii
CREATE TABLE table_29353 ( "Programs" text, "World" real, "Africa" real, "Americas" real, "Asia" real, "Australasia" real, "Europe" real )
How many radio stations were built in Asia?
SELECT "Asia" FROM table_29353 WHERE "Programs" = 'Radio Stations'
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...
列出在2007年3月19日到2009年3月8日内患者22871857所有检验报告单什么时候审核的?
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '22871857' AND jybgb.BGRQ BETWEEN '2007-03-19' AND '2009-03-08' UNION...
css
CREATE TABLE table_name_65 ( location VARCHAR, method VARCHAR, time VARCHAR )
what is the location when the method is tko (punches) and the time is 2:48?
SELECT location FROM table_name_65 WHERE method = "tko (punches)" AND time = "2:48"
sql_create_context
CREATE TABLE table_16078390_2 ( institution VARCHAR, team_nickname VARCHAR )
Which school's team has the nickname of the Wildcats?
SELECT institution FROM table_16078390_2 WHERE team_nickname = "Wildcats"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
how much is patient 62983's total stool out ileostomy output on the first icu visit?
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 = 62983) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid...
mimic_iii
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT TOP(2) * FROM Users u2.
SELECT * FROM Users AS u2 LIMIT 2
sede
CREATE TABLE table_27091128_3 ( team VARCHAR, replaced_by VARCHAR )
Which team replaced their manager with Serhat G ller?
SELECT team FROM table_27091128_3 WHERE replaced_by = "Serhat Güller"
sql_create_context
CREATE TABLE table_47924 ( "Title" text, "Series" text, "Release" real, "Featuring" text, "Writer" text, "Director" text, "Length" text, "Release Date" text )
What was the length when James Swallow had a release longer than 2.1?
SELECT "Length" FROM table_47924 WHERE "Writer" = 'james swallow' AND "Release" > '2.1'
wikisql
CREATE TABLE table_76862 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text )
What is the Score of the Game with a Record of 13 12?
SELECT "Score" FROM table_76862 WHERE "Record" = '13–12'
wikisql
CREATE TABLE table_20638 ( "State" text, "Preliminary Average" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Semifinal Average" text )
What is the swimsuit when evening gown is 8.774 (6) ?
SELECT "Swimsuit" FROM table_20638 WHERE "Evening Gown" = '8.774 (6)'
wikisql
CREATE TABLE table_60101 ( "Year" real, "Time" real, "Windspeed" text, "City" text, "Date" text )
What is the most recent year with a time of 10.56?
SELECT MAX("Year") FROM table_60101 WHERE "Time" = '10.56'
wikisql
CREATE TABLE table_name_36 ( inhabitants INTEGER, election VARCHAR, party VARCHAR, municipality VARCHAR )
Which Inhabitants has a Party of south tyrolean people's party, a Municipality of bruneck, and an Election larger than 2010?
SELECT AVG(inhabitants) FROM table_name_36 WHERE party = "south tyrolean people's party" AND municipality = "bruneck" AND election > 2010
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how many days has it been since the last time that patient 016-18575 was diagnosed with acute respiratory failure on this hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575'...
eicu
CREATE TABLE table_train_123 ( "id" int, "bleeding" int, "systolic_blood_pressure_sbp" int, "anticoagulation" bool, "lumbar_puncture" bool, "blood_pressure_problem" bool, "stroke" bool, "substance_dependence" bool, "schizophrenia" bool, "major_mental_illness" bool, "multiple_...
contra _ indications to lumbar puncture ( bleeding disorder, platelet count < 100000 , anticoagulant treatment, major structural abnormality or sepsis in the area of the lumbosacral spine that would make a lumbar puncture technically difficult ) .
SELECT * FROM table_train_123 WHERE lumbar_puncture = 1 OR (bleeding = 1 OR platelet_count < 100000 OR anticoagulation = 1 OR sepsis = 1)
criteria2sql
CREATE TABLE table_22815568_7 ( status VARCHAR, poverty_rate VARCHAR )
What is the status in those places where the poverty rate is 8.6%?
SELECT status FROM table_22815568_7 WHERE poverty_rate = "8.6%"
sql_create_context
CREATE TABLE table_name_57 ( surpassed_by VARCHAR, year VARCHAR, period VARCHAR )
I need the surpassed for years before 1925 and period of 6 years
SELECT surpassed_by FROM table_name_57 WHERE year < 1925 AND period = "6 years"
sql_create_context
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
从02年10月11日到15年12月4日医疗机构9671953的风湿免疫科处理的住院就诊数情况如何?
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '9671953' AND JZKSMC = '风湿免疫科' AND RYDJSJ BETWEEN '2002-10-11' AND '2015-12-04'
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ...
was any kind of organism detected during the last pleural fluid microbiology test performed on patient 27703 a month before?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27703) AND microbiologyevents.spec_type_desc = 'pleural fluid' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of month')...
mimic_iii
CREATE TABLE table_29942205_1 ( country_territory VARCHAR )
How many women from Uruguay has become third runner-up in this pageant?
SELECT MAX(3 AS rd_runner_up) FROM table_29942205_1 WHERE country_territory = "Uruguay"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
凤雨筠这位患者之前会有哪些异常反应
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_77371 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the date during week 13?
SELECT "Date" FROM table_77371 WHERE "Week" = '13'
wikisql
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, ...
what is the number of patients whose gender is m and procedure icd9 code is 5110?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "5110"
mimicsql_data
CREATE TABLE table_77861 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
Name the home team score for south melbourne home team
SELECT "Home team score" FROM table_77861 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_203_371 ( id number, "round" number, "opponent" text, "result" text, "bro." number, "opp." number, "date" text, "venue" text, "crowd" number, "position" text )
what stadium other than anz stadium did the auckland warriors play in ?
SELECT "venue" FROM table_203_371 WHERE "venue" <> 'anz stadium' AND "opponent" = 'auckland warriors'
squall
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_cod...
what 's the latest flight out of DENVER that arrives in PITTSBURGH next monday
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 21 AND date_day.month_number = 2 A...
atis
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, ...
count the number of patients less than 49 years who had other closed [endoscopic] biopsy of biliary duct or sphincter of oddi.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "49" AND procedures.short_title = "Clo endosc bx bile duct"
mimicsql_data
CREATE TABLE table_204_941 ( id number, "#" number, "date" text, "visitor" text, "score" text, "home" text, "record" text )
how many games total are listed ?
SELECT COUNT(*) FROM table_204_941
squall
CREATE TABLE table_26958 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text )
Name the goals for mauricio pochettino
SELECT "Goals\u00b9" FROM table_26958 WHERE "Name" = 'Mauricio Pochettino'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
对于医疗费总额高于7064.81元的医疗记录属于患者62391480的,列出入院诊断疾病名称和编码是什么?
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '62391480' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 7064.81)
css
CREATE TABLE table_53238 ( "Season" text, "Player" text, "Nationality" text, "Club" text, "Goals" text )
Who belongs to the Bologna Milan club?
SELECT "Player" FROM table_53238 WHERE "Club" = 'bologna milan'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
have patient 004-65662 received lab tests since 2103?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-65662')) AND STRFTIME('%y', lab.labresulttime) >= '2103'
eicu
CREATE TABLE table_48375 ( "Season" real, "Team 1" text, "Score" text, "Team 2" text, "Venue" text )
What was the venue of the match where team 2 was pea and the score was 1:3?
SELECT "Venue" FROM table_48375 WHERE "Team 2" = 'pea' AND "Score" = '1:3'
wikisql
CREATE TABLE table_22692 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
When mount wondiwoi is the peak what is the island?
SELECT "Island" FROM table_22692 WHERE "Peak" = 'Mount Wondiwoi'
wikisql
CREATE TABLE table_67001 ( "Season" text, "Northumberland Senior Cup" text, "Northumberland Senior Benevolent Bowl" text, "Northumberland Minor Cup" text, "Northumberland Women's Cup" text )
Who wins the Northumberland Senior Cup, when the Northumberland Women's Cup is won by Whitley Bay Women, and when the Northumberland Senior Benevolent Bowl is won by Alnwick Town?
SELECT "Northumberland Senior Cup" FROM table_67001 WHERE "Northumberland Women's Cup" = 'whitley bay women' AND "Northumberland Senior Benevolent Bowl" = 'alnwick town'
wikisql
CREATE TABLE table_56775 ( "Year" text, "League" text, "Reg. Season" text, "Playoffs" text, "Avg. attendance" real )
What regular season result had an average attendance less than 942?
SELECT "Reg. Season" FROM table_56775 WHERE "Avg. attendance" < '942'
wikisql
CREATE TABLE table_63574 ( "Year" real, "U.S. Hot 100" text, "U.S. R&B" text, "U.S. Rap" text, "Album" text )
Which U.S. Hot has 13 as the U.S. R&B?
SELECT "U.S. Hot 100" FROM table_63574 WHERE "U.S. R&B" = '13'
wikisql
CREATE TABLE table_name_63 ( to_par VARCHAR, place VARCHAR )
What is the To par of the T3 Player?
SELECT to_par FROM table_name_63 WHERE place = "t3"
sql_create_context
CREATE TABLE table_21894 ( "Tournament Appearances" real, "Team" text, "League" text, "Wins" real, "Final Losses" real, "Semi-Final Losses" real, "Fourth-Place*" real, "Final Win %" text, "Years of appearance" text )
How many wins do the Erie Otters have?
SELECT "Wins" FROM table_21894 WHERE "Team" = 'Erie Otters'
wikisql
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 were the five drugs that were most frequently prescribed to male patients aged 20s in the same hospital visit after being diagnosed with pure hypercholesterolem in 2105?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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_...
mimic_iii
CREATE TABLE table_204_584 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many fewer laps did carlos pace complete than jochen mass ?
SELECT (SELECT "laps" FROM table_204_584 WHERE "driver" = 'jochen mass') - (SELECT "laps" FROM table_204_584 WHERE "driver" = 'carlos pace')
squall
CREATE TABLE table_19378 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "TV" text, "Result" text, "Record" text )
Name the week for kingdome
SELECT "Week" FROM table_19378 WHERE "Location" = 'Kingdome'
wikisql
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_J...
Find the average gpa of all students in each department with a bar chart, and sort by the DEPT_CODE in descending.
SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC
nvbench
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int...
What is the first name and GPA of every student that has a GPA lower than average Show bar chart, show x axis in descending 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 DESC
nvbench
CREATE TABLE table_name_95 ( award VARCHAR, category VARCHAR, nominee VARCHAR )
What award was Denis Lawson nominated for in the Best Actor in a Musical category?
SELECT award FROM table_name_95 WHERE category = "best actor in a musical" AND nominee = "denis lawson"
sql_create_context
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, ...
从04年7月19日开始到2019年1月14日结束姜玉石患者被开出布洛芬片(糖衣)药物的总次数的数量有几次?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '姜玉石' AND t_kc22.STA_DATE BETWEEN '2004-07-19' AND '2019-01-14' AND t_kc22.SOC_SRT_DIRE_NM = '布洛芬片(糖衣)' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgw...
css
CREATE TABLE table_31083 ( "Year" real, "Number of tropical storms" real, "Number of hurricanes" real, "Number of major hurricanes" real, "Deaths" text, "Strongest storm" text )
What is the lowest overall number of hurricanes?
SELECT MIN("Number of hurricanes") FROM table_31083
wikisql
CREATE TABLE table_17510 ( "Overall Pick #" real, "AFL Team" text, "Player" text, "Position" text, "College" text )
What position does Syracuse's player have?
SELECT "Position" FROM table_17510 WHERE "College" = 'Syracuse'
wikisql
CREATE TABLE table_name_8 ( crowd INTEGER, away_team VARCHAR )
How many spectators were at the game where Richmond was the away team?
SELECT SUM(crowd) FROM table_name_8 WHERE away_team = "richmond"
sql_create_context
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 EM...
Give me a histogram for what is the first name and GPA of every student that has a GPA lower than average?, and could you order in desc by the bars?
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 DESC
nvbench
CREATE TABLE table_name_55 ( score_1 VARCHAR, attendance VARCHAR )
What is the Score 1 of the game with Attendance of 2,571?
SELECT score_1 FROM table_name_55 WHERE attendance = "2,571"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
which patients underwent atrial cardioversion and are still alive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Atrial cardioversion"
mimicsql_data
CREATE TABLE table_18157 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Results" text, "Candidates" text )
When was Chaka Fattah first elected in the Pennsylvania 2 district?
SELECT "First elected" FROM table_18157 WHERE "District" = 'Pennsylvania 2'
wikisql
CREATE TABLE table_203_707 ( id number, "rank" number, "npc" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the total number of medals won by australia ?
SELECT "total" FROM table_203_707 WHERE "npc" = 'australia'
squall
CREATE TABLE table_42404 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What was the 1st leg for Team 2 Concepto Egile?
SELECT "1st leg" FROM table_42404 WHERE "Team 2" = 'concepto egile'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
count the number of patients whose admission type is emergency and drug route is ih.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number...
Consulta Registros de Posts - Setembro 2016.
SELECT Id, PostTypeId, Score, Title, Body, Tags, ViewCount, AnswerCount, CommentCount, FavoriteCount, CreationDate, DeletionDate, ClosedDate FROM Posts WHERE CreationDate BETWEEN '2016-09-30' AND '2016-10-20' AND Tags LIKE '%java%' AND (Tags LIKE '%maven%' OR Tags LIKE '%ant%' OR Tags LIKE '%jenkins%') AND ViewCount > ...
sede
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Are there any easy classes that fulfill the MDE requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE table_7383 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
How many teams picked Jason Webb?
SELECT COUNT("Pick") FROM table_7383 WHERE "Player" = 'jason webb'
wikisql
CREATE TABLE table_39722 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
How much Overall has a Round smaller than 6, and a Pick # of 26?
SELECT SUM("Overall") FROM table_39722 WHERE "Round" < '6' AND "Pick #" = '26'
wikisql
CREATE TABLE table_28003469_1 ( event_date VARCHAR, event_details VARCHAR )
How many event dates occurred when event details were women's sabre?
SELECT COUNT(event_date) FROM table_28003469_1 WHERE event_details = "Women's Sabre"
sql_create_context
CREATE TABLE table_name_1 ( year_named INTEGER, name VARCHAR )
What is the year that nahete colles was named?
SELECT MAX(year_named) FROM table_name_1 WHERE name = "nahete colles"
sql_create_context
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
how many entrepreneurs correspond to each investor?, show from high to low by the bars please.
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
nvbench