context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_203_741 ( id number, "season" text, "competition" text, "round" text, "opponent" text, "home" text, "away" text, "aggregate" text )
who was the last opponent according to this chart ?
SELECT "opponent" FROM table_203_741 ORDER BY id DESC LIMIT 1
squall
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...
二零零三年七月一日到二零二一年三月二十九日,医疗机构3916890处理异地就诊的次数有多少
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3916890' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3916890' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-07...
css
CREATE TABLE roller_coaster ( Status VARCHAR )
Please show the most common status of roller coasters.
SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在2009年3月25日到2012年4月22日以内,患者朱元纬医保的个人账户支出共有多少钱?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '朱元纬' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-03-25' AND '2012-04-22' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '朱元纬' A...
css
CREATE TABLE table_name_99 ( round INTEGER, player VARCHAR )
What was the lowest round that Melvin Johnson played?
SELECT MIN(round) FROM table_name_99 WHERE player = "melvin johnson"
sql_create_context
CREATE TABLE table_14732 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Name the men's singles for when doubles are suresh goel morin d'souza
SELECT "Men's singles" FROM table_14732 WHERE "Mixed doubles" = 'suresh goel morin d''souza'
wikisql
CREATE TABLE Apartment_Buildings ( building_short_name VARCHAR, building_manager VARCHAR )
Show the short names of the buildings managed by 'Emma'.
SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma"
sql_create_context
CREATE TABLE table_54274 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date did the away team score 13.10 (88)?
SELECT "Date" FROM table_54274 WHERE "Away team score" = '13.10 (88)'
wikisql
CREATE TABLE table_name_1 ( location VARCHAR, game VARCHAR )
What is the location of game 7?
SELECT location FROM table_name_1 WHERE game = 7
sql_create_context
CREATE TABLE table_18963 ( "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 )
Which club has 565 points?
SELECT "Club" FROM table_18963 WHERE "Points for" = '565'
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, ...
how many patients aged below 74 years had the procedure short title form cutan ileoureterost?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Form cutan ileoureterost"
mimicsql_data
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
what is the name of the medication prescribed to patient 54386 within 2 days after having received a entral infus nutrit sub procedure on their last hospital encounter?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 54386 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ...
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and I want to show by the X-axis in ascending.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE party ( party_id number, minister text, took_office text, left_office text, region_id number, party_name text ) CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE region ( region_id number, ...
What are the different region names, ordered by labels?
SELECT DISTINCT region_name FROM region ORDER BY label
spider
CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, ...
A bar chart about what are the statuses and average populations of each city?, and sort names in descending order.
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY Status DESC
nvbench
CREATE TABLE table_33961 ( "Element" text, "Wood" text, "Fire" text, "Earth" text, "Metal" text, "Water" text )
Which water has green wood?
SELECT "Water" FROM table_33961 WHERE "Wood" = 'green'
wikisql
CREATE TABLE table_62717 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
Which PBA team has a College of nu?
SELECT "PBA team" FROM table_62717 WHERE "College" = 'nu'
wikisql
CREATE TABLE table_58998 ( "Title" text, "Developer" text, "Genre" text, "Release date" text, "Version" real )
What is Title, when Developer is '2Play Mobile', and when Genre is 'Action'?
SELECT "Title" FROM table_58998 WHERE "Developer" = '2play mobile' AND "Genre" = 'action'
wikisql
CREATE TABLE table_1341897_45 ( result VARCHAR, incumbent VARCHAR )
What was the result of the election in which Lindley Beckworth was the incumbent?
SELECT result FROM table_1341897_45 WHERE incumbent = "Lindley Beckworth"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
During Spring-Summer 2019 , will I be able to take PHIL 466 ?
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDat...
getting a simple query done.
SELECT * FROM PostHistoryTypes
sede
CREATE TABLE table_17622423_12 ( high_points VARCHAR, date VARCHAR )
Name the high points for may 29
SELECT high_points FROM table_17622423_12 WHERE date = "May 29"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
let me know the death status and days for which patient paul dunn was hospitalized.
SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Paul Dunn"
mimicsql_data
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 zyjzjlb ( CYBQDM text, CYBQMC...
在编码为4909298的医院中病患华寒香门诊诊断名称不包含持久的门诊就诊记录分别是有哪几条?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
provide the number of patients born before 2024 diagnosed with other chronic nonalcoholic liver disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2024" AND diagnoses.short_title = "Chronic liver dis NEC"
mimicsql_data
CREATE TABLE table_name_35 ( original_title VARCHAR, film_title_used_in_nomination VARCHAR )
What is Original title, when Film title used in nomination is Train Without A Timetable?
SELECT original_title FROM table_name_35 WHERE film_title_used_in_nomination = "train without a timetable"
sql_create_context
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...
看看医院7093559有多少科室在门诊就诊中开出超过28张检验报告单,时间为2013年7月16日到2015年11月17日
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B...
css
CREATE TABLE table_name_15 ( station VARCHAR, height_above_sea_level__m_ VARCHAR )
Which station that sat 54m above seal level is now Closed?
SELECT station FROM table_name_15 WHERE height_above_sea_level__m_ = "54m" AND "closed" = "closed"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
What options do I have for my Core in ORTHO ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%ORTHO%' AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what number of patients diagnosed under icd9 code e8786 had abormal lab test result?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "E8786" AND lab.flag = "abnormal"
mimicsql_data
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, ...
give me the number of patients whose admission location is clinic referral/premature and primary disease is atrial fibrillation\thoracoscopic maze procedure bilateral/sda?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA"
mimicsql_data
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, ...
患者的门诊诊断为2型糖尿病的低密度脂蛋白胆固醇的参考值范围下限和上限均为什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '2型糖尿病' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇'
css
CREATE TABLE table_26208 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Who were the opponents in the final where the score was 6 4, 2 6, 6 4, 7 6(3)?
SELECT "Opponents in the final" FROM table_26208 WHERE "Score in the final" = '6–4, 2–6, 6–4, 7–6(3)'
wikisql
CREATE TABLE table_name_64 ( round VARCHAR, opposing_team VARCHAR )
Which round has an Opposing Team of manchester united?
SELECT round FROM table_name_64 WHERE opposing_team = "manchester united"
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 me the number of inpatient hospital patients who had an administration of inhaled nitric oxide procedure.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.short_title = "Adm inhal nitric oxide"
mimicsql_data
CREATE TABLE table_14865 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Which women's double took place in 2006?
SELECT "Women's doubles" FROM table_14865 WHERE "Year" = '2006'
wikisql
CREATE TABLE table_67189 ( "Year" real, "Film" text, "Director" text, "Nationality of director" text, "Award" text )
ilm of taukukauppiaat has how many total number of years?
SELECT COUNT("Year") FROM table_67189 WHERE "Film" = 'taukukauppiaat'
wikisql
CREATE TABLE table_name_96 ( title VARCHAR, imprint VARCHAR, artist VARCHAR )
what is the title when the imprint is dengeki bunko and the artist is kiyotaka haimura?
SELECT title FROM table_name_96 WHERE imprint = "dengeki bunko" AND artist = "kiyotaka haimura"
sql_create_context
CREATE TABLE table_75528 ( "Date" text, "Home" text, "Score" text, "Visitor" text, "Record" text )
Who visited on April 29?
SELECT "Visitor" FROM table_75528 WHERE "Date" = 'april 29'
wikisql
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime tim...
what were the four diagnoses that had the highest five year mortality rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_43261 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text )
Who were the semi finalists when Alexia Dechaume-Balleret Sandrine testud was the runner-up?
SELECT "Semi finalists" FROM table_43261 WHERE "Runner-up" = 'alexia dechaume-balleret sandrine testud'
wikisql
CREATE TABLE table_name_20 ( finish VARCHAR, total VARCHAR )
What is the Finish of the Player with a Total of 273?
SELECT finish FROM table_name_20 WHERE total = 273
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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_airlin...
show me round trip flights from BURBANK to SEATTLE
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id ...
atis
CREATE TABLE table_30819 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What college team did Milan Kostolny play for?
SELECT "College/junior/club team" FROM table_30819 WHERE "Player" = 'Milan Kostolny'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number , sort in desc by the Y-axis.
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC
nvbench
CREATE TABLE perpetrator ( perpetrator_id number, people_id number, date text, year number, location text, country text, killed number, injured number ) CREATE TABLE people ( people_id number, name text, height number, weight number, home town text )
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
SELECT country, COUNT(*) FROM perpetrator GROUP BY country
spider
CREATE TABLE table_name_90 ( us_modern_rock VARCHAR, code VARCHAR )
What is the US modern rock rank of code bad 0003?
SELECT us_modern_rock FROM table_name_90 WHERE code = "bad 0003"
sql_create_context
CREATE TABLE domain ( did int, name varchar ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE cite ( cited int, citing int ) CREATE TABLE conference ( cid int, ...
return me the papers by ' H. V. Jagadish ' on VLDB conference after 2000 .
SELECT publication.title FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE table_name_35 ( year INTEGER, entrant VARCHAR )
What year did Cooper Car Company enter?
SELECT AVG(year) FROM table_name_35 WHERE entrant = "cooper car company"
sql_create_context
CREATE TABLE table_name_26 ( total INTEGER, player VARCHAR )
Which mean total had Tim Sills as a player?
SELECT AVG(total) FROM table_name_26 WHERE player = "tim sills"
sql_create_context
CREATE TABLE table_name_2 ( poll_source VARCHAR, peg_luksik VARCHAR, dates_administered VARCHAR )
Which Poll source has a Peg Luksik of 9%, and Dates administered of may 12, 2010?
SELECT poll_source FROM table_name_2 WHERE peg_luksik = "9%" AND dates_administered = "may 12, 2010"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
when was the last prescription time for morphine sulfate for patient 010-38092 since 97 months ago?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-38092')) AND medication.drugname = 'morphine sulfate' AND ...
eicu
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
i would like a morning flight from MILWAUKEE to DENVER COLORADO please
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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name...
atis
CREATE TABLE table_6049 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
What is the opponent from April 19?
SELECT "Opponent" FROM table_6049 WHERE "Date" = 'april 19'
wikisql
CREATE TABLE table_75846 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What date has alamodome, san antonio, united states as the venue?
SELECT "Date" FROM table_75846 WHERE "Venue" = 'alamodome, san antonio, united states'
wikisql
CREATE TABLE table_name_81 ( week VARCHAR, tv_time VARCHAR )
What is the Week of the game with TV Time of Fox 4:15ET?
SELECT COUNT(week) FROM table_name_81 WHERE tv_time = "fox 4:15et"
sql_create_context
CREATE TABLE table_31107 ( "Rank 2011" real, "Country" text, "Production in 2011 (1,000 ton)" real, "Share 2011" text, "Rank 2010" real, "Production in 2010 (1,000 ton)" real )
When 5 is the rank of 2011 what is the country?
SELECT "Country" FROM table_31107 WHERE "Rank 2011" = '5'
wikisql
CREATE TABLE table_8920 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which country is Jay Haas from when he had a to par of E?
SELECT "Country" FROM table_8920 WHERE "To par" = 'e' AND "Player" = 'jay haas'
wikisql
CREATE TABLE table_26313 ( "Year" real, "Winner (number of titles)" text, "Runners-up" text, "Top Team in Regular Season (points)" text, "Top Scorer (points)" text, "Winning Coach" text )
If the runner-up is the Fort Lauderdale Strikers, what is the winner (number of titles)?
SELECT "Winner (number of titles)" FROM table_26313 WHERE "Runners-up" = 'Fort Lauderdale Strikers'
wikisql
CREATE TABLE table_name_43 ( george_hw_bush VARCHAR, pat_robertson VARCHAR, bob_dole VARCHAR )
When Pat Robertson had 19%, and Bob Dole had 26%, what did George H.W. Bush have?
SELECT george_hw_bush FROM table_name_43 WHERE pat_robertson = "19%" AND bob_dole = "26%"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Return a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, and display in asc by the bars please.
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_name_63 ( ihsaa_class__football_ VARCHAR, school VARCHAR )
What is Bishop Luers IHSAA class in football?
SELECT ihsaa_class__football_ FROM table_name_63 WHERE school = "bishop luers"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
which patients have lab test item id 51200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51200"
mimicsql_data
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Distribution of the owners of the Epic badge by their estimated rep at the time of getting the badge.
WITH Raw AS (SELECT Posts.OwnerUserId AS "user_link", SUM(CASE WHEN Votes.VoteTypeId = 1 THEN 15 WHEN Votes.VoteTypeId = 2 THEN 10 ELSE -2 END) AS EstRep FROM Posts, Votes, Users, Badges WHERE Badges.Name = 'Epic' AND Badges.TagBased = 0 AND Badges.UserId = Users.Id AND Posts.OwnerUserId = Users.Id AND Posts.PostTypeId...
sede
CREATE TABLE TRANSACTIONS ( share_count INTEGER, amount_of_transaction INTEGER )
Show the maximum share count of transactions where the amount is smaller than 10000
SELECT MAX(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000
sql_create_context
CREATE TABLE table_name_82 ( height VARCHAR, stories VARCHAR )
How tall is the 52 story building?
SELECT height FROM table_name_82 WHERE stories = 52
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid ...
did patient 1457 get a lab magnesium test since 2 years ago?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1457) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year')
mimic_iii
CREATE TABLE table_name_68 ( crowd VARCHAR, away_team VARCHAR )
What is the listed crowd when essendon is the away squad?
SELECT COUNT(crowd) FROM table_name_68 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the number of patients whose item id is 51464?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51464"
mimicsql_data
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
For each type, how many ships are there. Plot them as bar chart.
SELECT Type, COUNT(*) FROM ship GROUP BY Type
nvbench
CREATE TABLE table_203_762 ( id number, "#" number, "date" text, "film" text, "gross" text, "notes" text )
what is the lowest grossing film listed before march 3 , 2002 ?
SELECT "film" FROM table_203_762 WHERE "date" < (SELECT "date" FROM table_203_762 WHERE "date" = 'march 3, 2002') GROUP BY "film" ORDER BY SUM("gross") LIMIT 1
squall
CREATE TABLE table_name_94 ( wins INTEGER, matches VARCHAR, no_result VARCHAR )
What is the number of wins when there are 14 matches, and the No Result was less than 0?
SELECT AVG(wins) FROM table_name_94 WHERE matches = 14 AND no_result < 0
sql_create_context
CREATE TABLE table_name_35 ( away_team VARCHAR, venue VARCHAR )
What is the team score of the away team at Junction Oval?
SELECT away_team AS score FROM table_name_35 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_29141354_3 ( scores VARCHAR, episode VARCHAR )
How many scores had an episode of 03x06?
SELECT COUNT(scores) FROM table_29141354_3 WHERE episode = "03x06"
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 demographic ( subject_id text, hadm_id t...
what is the number of patients whose diagnoses long title is other and unspecified alcohol dependence, unspecified and drug route is pr?
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 = "Other and unspecified alcohol dependence, unspecified" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
how many patients whose admission type is urgent and procedure icd9 code is 14?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "14"
mimicsql_data
CREATE TABLE table_name_68 ( date VARCHAR, record VARCHAR )
Which Date has a Record of 4 2 0?
SELECT date FROM table_name_68 WHERE record = "4–2–0"
sql_create_context
CREATE TABLE table_name_70 ( bronze INTEGER, gold VARCHAR, rank VARCHAR )
Name the highest Bronze which has a Gold larger than 2 and a Rank of total?
SELECT MAX(bronze) FROM table_name_70 WHERE gold > 2 AND rank = "total"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
when was the first time when patient 030-30152 was prescribed naloxone 0.4 mg/1 ml sdv inj and sublimaze at the same time in 07/this year?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'naloxone 0.4 mg/1 ml sdv inj' AND patient.uniquepid = '030-30152' AND DATETIME(medication.drugstarttime, 'start of year')...
eicu
CREATE TABLE table_30310 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
How many year locations are there for the womens doubles in jing junhong li jiawei?
SELECT COUNT("Year Location") FROM table_30310 WHERE "Womens Doubles" = 'Jing Junhong Li Jiawei'
wikisql
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Facilities ( apt_id I...
Use a bar chart to show the number of start dates of all the apartment bookings made by guests with gender code 'Female' for each weekday, display Y from low to high order.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_name_19 ( country VARCHAR, total VARCHAR, player VARCHAR )
What is Country, when Total is less than 148, and when Player is 'Gary Player'?
SELECT country FROM table_name_19 WHERE total < 148 AND player = "gary player"
sql_create_context
CREATE TABLE table_43990 ( "Name" text, "Rating" real, "Comp" real, "Long" real, "Yds/game" real )
Name the highest Comp which has a Yds/game larger than 0, bostick, and a Rating smaller than 91.77?
SELECT MAX("Comp") FROM table_43990 WHERE "Yds/game" > '0' AND "Name" = 'bostick' AND "Rating" < '91.77'
wikisql
CREATE TABLE table_name_68 ( overall_rank INTEGER, heat_rank VARCHAR, lane VARCHAR )
Tell me the highest overall rank for heat rank more than 4 and lane less than 2
SELECT MAX(overall_rank) FROM table_name_68 WHERE heat_rank > 4 AND lane < 2
sql_create_context
CREATE TABLE table_name_22 ( overall INTEGER, name VARCHAR, round VARCHAR )
What is the sum of Overall, when Name is 'Tim Smiley', and when Round is less than 5?
SELECT SUM(overall) FROM table_name_22 WHERE name = "tim smiley" AND round < 5
sql_create_context
CREATE TABLE grants ( grant_id number, organisation_id number, grant_amount number, grant_start_date time, grant_end_date time, other_details text ) CREATE TABLE organisation_types ( organisation_type text, organisation_type_description text ) CREATE TABLE research_outcomes ( outco...
What details are there on the research staff? List the result in ascending alphabetical order.
SELECT staff_details FROM research_staff ORDER BY staff_details
spider
CREATE TABLE table_62140 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the lowest goal difference of club real betis, who has less than 18 wins?
SELECT MIN("Goal Difference") FROM table_62140 WHERE "Club" = 'real betis' AND "Wins" < '18'
wikisql
CREATE TABLE table_204_798 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
how many times did imamura place at least 5th ?
SELECT COUNT(*) FROM table_204_798 WHERE "position" <= 5
squall
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE icustays ( ro...
since 2104, what were the top four most frequent microbiology tests given to patients within 2 months after receiving a other gastrostomy?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_name_88 ( democrat VARCHAR, lead_margin VARCHAR )
What is Democrat: Carl Levin, when Lead Margin is 22?
SELECT democrat AS :_carl_levin FROM table_name_88 WHERE lead_margin = 22
sql_create_context
CREATE TABLE table_14754471_1 ( asian___percentage_ VARCHAR, year VARCHAR )
What percentage of Asians are there in the year 2004?
SELECT asian___percentage_ FROM table_14754471_1 WHERE year = 2004
sql_create_context
CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int )
Plot how many country by grouped by country as a bar graph
SELECT Country, COUNT(Country) FROM member GROUP BY Country
nvbench
CREATE TABLE Project_outcomes ( project_id VARCHAR ) CREATE TABLE Projects ( organisation_id VARCHAR, project_id VARCHAR )
List the organisation id with the maximum outcome count, and the count.
SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_29775 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What are December 10's high points?
SELECT "High points" FROM table_29775 WHERE "Date" = 'December 10'
wikisql
CREATE TABLE table_name_9 ( construction_completed VARCHAR, listed VARCHAR, deleted VARCHAR )
When was construction completed that was listed on 09/21/1984 and a Deleted of 11/04/1999?
SELECT construction_completed FROM table_name_9 WHERE listed = "09/21/1984" AND deleted = "11/04/1999"
sql_create_context
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text )
what are the entries by each specific artist/group?
SELECT groupname, artist FROM torrents
whatcdhiphop
CREATE TABLE table_name_29 ( experience VARCHAR, year_at_cu VARCHAR, position VARCHAR )
The graduate assistant who was in the 1st year at CU has what experience?
SELECT experience FROM table_name_29 WHERE year_at_cu = "1st" AND position = "graduate assistant"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_i...
what is the total ondansetron dose that patient 1561 was prescribed in 12/this year?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561) AND prescriptions.drug = 'ondansetron' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND ...
mimic_iii
CREATE TABLE table_62637 ( "Club" text, "Head Coach" text, "City" text, "Stadium" text, "2002-2003 season" text )
Head Coach casemiro mior is at which Club?
SELECT "Club" FROM table_62637 WHERE "Head Coach" = 'casemiro mior'
wikisql
CREATE TABLE table_203_2 ( id number, "name" text, "mineral" text, "opened" text, "closed" text, "years connected" text, "notes" text )
the ffestiniog railway serviced at most how many slate quarries ?
SELECT COUNT(*) FROM table_203_2 WHERE "mineral" = 'slate'
squall