context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
what was the last time patient 4401 intake time today?
SELECT inputevents_cv.charttime 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 = 4401)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'st...
mimic_iii
CREATE TABLE table_name_56 ( player VARCHAR, college VARCHAR )
What Player has a College that is alberta?
SELECT player FROM table_name_56 WHERE college = "alberta"
sql_create_context
CREATE TABLE table_32312 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How faced Geelong at home?
SELECT "Away team score" FROM table_32312 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE table_26561498_1 ( original_air_date VARCHAR, patient_portrayer VARCHAR )
what is the original air date for julie warner?
SELECT original_air_date FROM table_26561498_1 WHERE patient_portrayer = "Julie Warner"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Comments ( Id number, PostId number, ...
Compare the number of users in Switzerland and Mauritius.
SELECT b.Label, COUNT(*) FROM Users AS u JOIN (SELECT '%schweiz%', 'Switzerland' UNION ALL SELECT '%mauritius%', 'Mauritius') AS b(Mask, Label) ON LOWER(u.Location) LIKE b.Mask GROUP BY b.Label
sede
CREATE TABLE table_name_17 ( opponent VARCHAR, year VARCHAR )
Who is the opponent in 1992?
SELECT opponent FROM table_name_17 WHERE year = "1992"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
until 05/26/2100, what was the first value of arterial bp mean for patient 20165?
SELECT 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 = 20165)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_name_88 ( playoffs VARCHAR, year VARCHAR )
which playoffs took place during 2011?
SELECT playoffs FROM table_name_88 WHERE year = "2011"
sql_create_context
CREATE TABLE table_20036882_2 ( winning_pilot VARCHAR, country VARCHAR )
Name the winning pilot for hungary
SELECT winning_pilot FROM table_20036882_2 WHERE country = "Hungary"
sql_create_context
CREATE TABLE table_1984 ( "Name" text, "Home or representative town or province" text, "Age" real, "Season" text, "Total days in PBB House" real, "Duration" text, "Status" text )
When day 8-36 is the duration what is the season?
SELECT "Season" FROM table_1984 WHERE "Duration" = 'Day 8-36'
wikisql
CREATE TABLE table_65821 ( "Part Number" text, "Pins" text, "Body Width/mm" real, "Body Length/mm" real, "Lead Pitch/mm" real )
Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Part Number of tsop48?
SELECT MIN("Body Width/mm") FROM table_65821 WHERE "Lead Pitch/mm" < '0.55' AND "Part Number" = 'tsop48'
wikisql
CREATE TABLE table_name_87 ( driver VARCHAR, grid VARCHAR, time_retired VARCHAR )
What driver has a grid under 12 with a Time/Retired of + 3 laps?
SELECT driver FROM table_name_87 WHERE grid < 12 AND time_retired = "+ 3 laps"
sql_create_context
CREATE TABLE table_name_7 ( manager VARCHAR, team VARCHAR )
Which manager has sheffield wednesday as the team?
SELECT manager FROM table_name_7 WHERE team = "sheffield wednesday"
sql_create_context
CREATE TABLE table_name_40 ( share_of_votes VARCHAR, number_of_ndc_votes VARCHAR )
What is the share of votes with 3,567,021 NDC votes?
SELECT share_of_votes FROM table_name_40 WHERE number_of_ndc_votes = "3,567,021"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
What professor is teaching ULCS classes next Winter ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_69713 ( "Player" text, "Games" text, "Tries" text, "Goals" text, "F. Goals" text, "Points" text )
Name the points for games of 16 16
SELECT "Points" FROM table_69713 WHERE "Games" = '16 16'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
when did patient 010-28934 first get diagnosed with stroke - hemorrhagic stroke since 2105?
SELECT 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 = '010-28934')) AND diagnosis.diagnosisname = 'stroke - hemorrhagic ...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the marital status of subject id 3343?
SELECT demographic.marital_status FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_55133 ( "Name" text, "Actual version" text, "System" text, "Platform" text, "License" text )
Which Platform has an Actual version of 0.8.29?
SELECT "Platform" FROM table_55133 WHERE "Actual version" = '0.8.29'
wikisql
CREATE TABLE table_name_74 ( locomotive VARCHAR, gauge VARCHAR, serial_no VARCHAR )
What is the locomotive with a standard gauge and a serial number of 83-1015?
SELECT locomotive FROM table_name_74 WHERE gauge = "standard" AND serial_no = "83-1015"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
until 48 months ago, what was the first value of the hgb for patient 002-16314?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-16314')) AND lab.labname = 'hgb' AND DATETIME(lab.labresulttime) <= DATETIME(CURREN...
eicu
CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, ...
Find the names of the top 10 airlines that operate the most number of routes.
SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10
spider
CREATE TABLE table_name_25 ( record VARCHAR, date VARCHAR )
What is the record for April 22?
SELECT record FROM table_name_25 WHERE date = "april 22"
sql_create_context
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...
病人名叫周泰宁在11年11月14日到13年6月11日内什么时间审核检验报告单的具体时间都是什么?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '周泰宁' AND jybg...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose diagnoses long title is unspecified protein-calorie malnutrition and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified protein-calorie malnutrition" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
Top questions asked less than N weeks ago.
SELECT Score, Id AS "post_link", Tags, DATEDIFF(DAY, CreationDate, GETDATE()), CreationDate, GETDATE() FROM Posts WHERE 1 = 1 AND Score > 500 AND PostTypeId = 1 AND ClosedDate IS NULL AND DATEDIFF(DAY, CreationDate, GETDATE()) < 100 ORDER BY Score DESC
sede
CREATE TABLE table_1342149_24 ( candidates VARCHAR, first_elected VARCHAR )
Name the number of candidates for 1941
SELECT COUNT(candidates) FROM table_1342149_24 WHERE first_elected = 1941
sql_create_context
CREATE TABLE table_63707 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What was the high rebounds for the game that had a score of w 76-66?
SELECT "High rebounds" FROM table_63707 WHERE "Score" = 'w 76-66'
wikisql
CREATE TABLE table_27994 ( "Edition" text, "Class" text, "Legs" real, "In-Port Races" text, "Entries" text, "Start" text, "Finish" text, "Winning yacht" text, "Winning skipper" text )
Name the wininng yacht for 14 entries
SELECT "Winning yacht" FROM table_27994 WHERE "Entries" = '14'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者被门诊诊断为过敏性皮炎,患者的检测指标675208的参考值范围下限和上限都是啥呀?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '过敏性皮炎' AND jyjgzbb.JCZBDM = '675208' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is drug dose of drug name vancomycin hcl?
SELECT prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Vancomycin HCl"
mimicsql_data
CREATE TABLE table_name_89 ( season_7 VARCHAR, seat VARCHAR, season_3 VARCHAR )
Which Season 7 has a Seat larger than 1, and a Season 3 of w. brett wilson?
SELECT season_7 FROM table_name_89 WHERE seat > 1 AND season_3 = "w. brett wilson"
sql_create_context
CREATE TABLE table_50316 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What is the Opponent of the game in 1989?
SELECT "Opponent" FROM table_50316 WHERE "Date" = '1989'
wikisql
CREATE TABLE table_47643 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
How many years was there a peter jackson classic?
SELECT COUNT("Year") FROM table_47643 WHERE "Championship" = 'peter jackson classic'
wikisql
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 ...
医疗就诊18272921840中申请超过29份检验报告单的有哪些人?列出这些申请人工号和姓名分别是?
SELECT zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '18272921840' GROUP BY zyjybgb.SQRGH HAVING COUNT(*) > 29 UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '18272921840' GROUP BY mzjybgb.SQRGH HAVING COUNT(*) > 29
css
CREATE TABLE table_27770 ( "City/ municipality" text, "Type" text, "No. of Barangays" real, "Population (2010)" real, "Area (km\u00b2)" text, "Pop. density (per km\u00b2)" real, "Income Class" text, "Zip Code" real )
What is the minimum number of barangays where the type is component city?
SELECT MIN("No. of Barangays") FROM table_27770 WHERE "Type" = 'Component City'
wikisql
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...
在编号为3488295的医院就诊的医疗记录内在入院诊断中得了肾结石的患者医疗费的总额最低和最高是多少元?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '3488295' AND t_kc24.t_kc21_IN_DIAG_DIS_NM = '肾结石')
css
CREATE TABLE table_79192 ( "Year" real, "Awards show" text, "Nominees" text, "Nominated Work" text, "Results" text )
What was the results of the 71st Academy Awards show?
SELECT "Results" FROM table_79192 WHERE "Awards show" = '71st academy awards'
wikisql
CREATE TABLE artist ( Famous_Title VARCHAR, Artist VARCHAR )
What are the famous titles of the artist 'Triumfall'?
SELECT Famous_Title FROM artist WHERE Artist = "Triumfall"
sql_create_context
CREATE TABLE table_20195 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Name the school/club team for kevin ollie
SELECT "School/Club Team" FROM table_20195 WHERE "Player" = 'Kevin Ollie'
wikisql
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, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
when was the last time that patient 40435 was prescribed a medication via the vg route in the last hospital encounter?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.route = 'vg' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
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, ...
how many patients use the drug zyrtec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Zyrtec"
mimicsql_data
CREATE TABLE table_8892 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
Which name was in a position less than 4 with 2 losses?
SELECT "Name" FROM table_8892 WHERE "Position" < '4' AND "Lost" = '2'
wikisql
CREATE TABLE table_11332 ( "Municipalities" text, "Extension km\u00b2" text, "Population (hab)" text, "Density (hab/ km\u00b2 )" text, "Altitude m" text, "Distance Medell\u00edn Downtown ( km )" text )
What is the population (hab) when the distance medellin downtown (km) is * dane?
SELECT "Population (hab)" FROM table_11332 WHERE "Distance Medell\u00edn Downtown ( km )" = '* dane'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give the number of patients with private insurance whose discharge location is dead/expired.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "DEAD/EXPIRED"
mimicsql_data
CREATE TABLE table_21741 ( "Number" text, "Builder" text, "Type" text, "Date built" text, "Heritage" text, "Disposition" text, "Notes" text )
Name the builder for date built is january 1910
SELECT "Builder" FROM table_21741 WHERE "Date built" = 'January 1910'
wikisql
CREATE TABLE table_20188 ( "Class" text, "Wheel Arrangement" text, "Railway" text, "Number at Doncaster" real, "Number at Pyewipe" real, "Number at March" real )
Name the railway when class is j15
SELECT "Railway" FROM table_20188 WHERE "Class" = 'J15'
wikisql
CREATE TABLE table_name_71 ( constructor VARCHAR, driver VARCHAR )
Which constructor had Shinji Nakano as a driver?
SELECT constructor FROM table_name_71 WHERE driver = "shinji nakano"
sql_create_context
CREATE TABLE table_202_63 ( id number, "year" number, "position (after finals)" text, "coach" text, "captain" text, "best & fairest" text, "leading goalkicker (goals)" text )
who had the leading amount of goals kicked in 2004 ?
SELECT "leading goalkicker (goals)" FROM table_202_63 WHERE "year" = 2004
squall
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
Can you suggest some web technology courses that are easier than AEROSP 550 ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%web technology%' AND program_course.workload < (SELECT MIN(PROGRAM_COURS...
advising
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varch...
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time, and could you sort total number from low to high order?
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
For all employees in the same department and with the first name Clara, please give me a bar chart that bins hire date into the Month interval, and count how many employees in each month, and rank y axis in ascending order.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME = "Clara") ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
列出患者韦坚秉的检验报告单日期在零一年二月二十三日之前的所对应的门诊就诊的流水号
SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '韦坚秉' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2001-02-2...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what is the yearly minimum value of mpv in patient 021-155303 until 04/2102?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-155303')) AND lab.labname = 'mpv' AND STRFTIME('%y-%m', lab.labresulttime) <= ...
eicu
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年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来
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 = '47198797' AND jybgb.BGRQ BETWEEN '2007-11-06' AND '2012-05-08' UNION...
css
CREATE TABLE table_name_26 ( attendance INTEGER, opponent VARCHAR, date VARCHAR )
Name the attendance for atlanta braves opponent for september 9
SELECT AVG(attendance) FROM table_name_26 WHERE opponent = "atlanta braves" AND date = "september 9"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text,...
list flights from SAN FRANCISCO to PITTSBURGH
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_77612 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Who was the home team when the vistor team was the Montreal Canadiens on February 12?
SELECT "Home" FROM table_77612 WHERE "Visitor" = 'montreal canadiens' AND "Date" = 'february 12'
wikisql
CREATE TABLE table_170958_2 ( area_km_2 VARCHAR, official_name VARCHAR )
What is the land area of Hopewell parish in km2?
SELECT area_km_2 FROM table_170958_2 WHERE official_name = "Hopewell"
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what was the name of the lab test, which patient 64519 had first received in their last hospital visit?
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 = 64519 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY labevents.chartti...
mimic_iii
CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entry_id number, next_entry_id number, catalog_entry_name text, product_stock_number text, price_in_dollars number, price_in_euros number, price_in_pounds number...
Which catalog content has the highest height? Give me the catalog entry name.
SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
spider
CREATE TABLE technician ( Name VARCHAR, Age VARCHAR )
Show the name of technicians aged either 36 or 37
SELECT Name FROM technician WHERE Age = 36 OR Age = 37
sql_create_context
CREATE TABLE table_74001 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the district for anti-jacksonian
SELECT "District" FROM table_74001 WHERE "Party" = 'Anti-Jacksonian'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
what is the daily average of 8 hr total fluid removed output of patient 030-75705 last month?
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-75705')) AND intakeoutput.celllabel = '8 hr ...
eicu
CREATE TABLE table_name_93 ( score VARCHAR, name VARCHAR, champion VARCHAR )
What's the score of the Nice International Championships where Bj rn Borg was the champion?
SELECT score FROM table_name_93 WHERE name = "nice international championships" AND champion = "björn borg"
sql_create_context
CREATE TABLE table_name_74 ( engine VARCHAR, year INTEGER )
Which engine has a year larger than 1956?
SELECT engine FROM table_name_74 WHERE year > 1956
sql_create_context
CREATE TABLE table_21610 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the high assists for chauncey billups , carmelo anthony (18)
SELECT "High assists" FROM table_21610 WHERE "High points" = 'Chauncey Billups , Carmelo Anthony (18)'
wikisql
CREATE TABLE table_38515 ( "Games" real, "Drawn" real, "Lost" real, "Goal difference" text, "Points" real )
How many losses have points less than 3, with a drawn greater than 0?
SELECT SUM("Lost") FROM table_38515 WHERE "Points" < '3' AND "Drawn" > '0'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
had any organism found in the last sputum, tracheal specimen microbiology test of patient 031-9128 until 2104?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTIM...
eicu
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state...
show me all flights from SAN FRANCISCO to PITTSBURGH on a 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AN...
atis
CREATE TABLE table_13135 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
Which Country has a Finish of t32, and a Year(s) won of 1996?
SELECT "Country" FROM table_13135 WHERE "Finish" = 't32' AND "Year(s) won" = '1996'
wikisql
CREATE TABLE table_22556 ( "Date" real, "Single" text, "Backed with" text, "Record label" text, "Format" text, "Other details" text )
What record label corresponds to the single 'I can't stay'?
SELECT "Record label" FROM table_22556 WHERE "Single" = 'I Can''t Stay'
wikisql
CREATE TABLE table_12284476_8 ( reverse VARCHAR, series VARCHAR )
how many reverse with series being iii series
SELECT COUNT(reverse) FROM table_12284476_8 WHERE series = "III series"
sql_create_context
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
Show minimal enr from each state, could you display by the bar in desc?
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY state DESC
nvbench
CREATE TABLE table_204_147 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
how many games took place in july before the fourth of july ?
SELECT COUNT(*) FROM table_204_147 WHERE "date" = 7 AND "date" < 4
squall
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number...
how much does a procedure called knee synovectomy cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'knee synovectomy'))
mimic_iii
CREATE TABLE table_2715 ( "Edition" text, "Round" text, "Date" text, "Partnering" text, "Against" text, "Surface" text, "Opponents" text, "W/L" text, "Result" text )
Name the w/l for czech republic
SELECT "W/L" FROM table_2715 WHERE "Against" = 'Czech Republic'
wikisql
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, ...
calculate the total number of patients born in the year less than 2066
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2066"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
among patients who had a hospital stay of 16 days, calculate the minimum age of those who were discharged on short term hospital care.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.days_stay = "16"
mimicsql_data
CREATE TABLE table_48220 ( "Season" real, "Team 1" text, "Score" text, "Team 2" text, "Venue" text )
What is the name of team 1 that was after the 2005 season and with a 4-2 score?
SELECT "Team 1" FROM table_48220 WHERE "Season" > '2005' AND "Score" = '4-2'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId n...
Tag usage in Popular Questions.
SELECT t.TagName, COUNT(*) AS usage FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE p.PostTypeId = 1 AND p.ViewCount >= 1000 GROUP BY t.TagName ORDER BY COUNT(*) DESC
sede
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
看看编号74581993759的检验报告单是哪位报告人报告的,工号和姓名分别是什么
SELECT zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.BGDH = '74581993759' UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.BGDH = '74581993759'
css
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
i need a ticket from NASHVILLE TENNESSEE to SEATTLE
SELECT DISTINCT flight_id FROM flight WHERE (from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE (CITYalias0.city_name = 'NASHVILLE' AND CITYalias0.state_code IN (SELE...
atis
CREATE TABLE table_30133_1 ( export_volume_of_goods_and_services__percent_change_ VARCHAR, gdp_at_constant_prices__thb_trillions_ VARCHAR )
How many export volume of goods/services values are associated with GDP at constant prices values of 3.072?
SELECT COUNT(export_volume_of_goods_and_services__percent_change_) FROM table_30133_1 WHERE gdp_at_constant_prices__thb_trillions_ = "3.072"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
count the number of patients whose gender is m and drug code is hepa100syr?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "HEPA100SYR"
mimicsql_data
CREATE TABLE table_17202 ( "Round" real, "Overall" real, "Player" text, "Position" text, "Nationality" text, "Club team" text )
NAME THE OVERALL FOR THE OMAHA (USHL) CLUB TEAM
SELECT MIN("Overall") FROM table_17202 WHERE "Club team" = 'Omaha (USHL)'
wikisql
CREATE TABLE table_68520 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the loss of the game with a record of 77-65?
SELECT "Loss" FROM table_68520 WHERE "Record" = '77-65'
wikisql
CREATE TABLE table_name_75 ( week INTEGER, date VARCHAR )
What was the week of the game played December 6, 1964?
SELECT SUM(week) FROM table_name_75 WHERE date = "december 6, 1964"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Return a bar chart about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road, and could you show in asc by the names?
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_12923 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2009 entry for the row that has a 2007 entry of A and a tournament entry of US Open?
SELECT "2009" FROM table_12923 WHERE "2007" = 'a' AND "Tournament" = 'us open'
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTME...
A pie chart about what are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?
SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000
nvbench
CREATE TABLE table_name_33 ( title VARCHAR, role VARCHAR )
Which title did richard kolner play?
SELECT title FROM table_name_33 WHERE role = "richard kolner"
sql_create_context
CREATE TABLE table_77854 ( "Building" text, "Height" text, "Floors" real, "Year" real, "Status" text )
What is the status of the building with less than 18 floors and later than 2013?
SELECT "Status" FROM table_77854 WHERE "Floors" < '18' AND "Year" > '2013'
wikisql
CREATE TABLE table_39162 ( "Year" real, "Championship" text, "54 holes" text, "Winning score" text, "Margin" text, "Runner-up" text )
Name the winning score for jim barnes and year of 1924
SELECT "Winning score" FROM table_39162 WHERE "Runner-up" = 'jim barnes' AND "Year" = '1924'
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 ...
how many impacted feces removal procedures occurred until 3 years ago?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'impacted feces removal') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion ...
What are the gas station ids, locations, and manager names for the gas stations ordered by opening year?
SELECT station_id, location, manager_name FROM gas_station ORDER BY open_year
spider
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...
从08.12.31开始,截止到13.11.25,药品908952总共被医院开出给患者朱涵蓄多少次
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '朱涵蓄' AND t_kc22.STA_DATE BETWEEN '2008-12-31' AND '2013-11-25' AND t_kc22.SOC_SRT_DIRE_CD = '908952'
css
CREATE TABLE table_2297 ( "#" text, "Date" text, "at/vs." text, "Opponent" text, "Score" text, "Attendance" real, "Record" text )
Who is the opponent in game 5?
SELECT "Opponent" FROM table_2297 WHERE "#" = '5'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime ti...
when was the last time the respiratory rate of patient 594 was greater than 16.0, on 05/06/this 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 = 594)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirator...
mimic_iii
CREATE TABLE table_41716 ( "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text, "attendance" real )
What is the Score when the record was 9-3-0?
SELECT "Score" FROM table_41716 WHERE "Record" = '9-3-0'
wikisql