context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_29273 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
What was the original air date of the episode 'Keep Your Friends Close'?
SELECT "Original air date" FROM table_29273 WHERE "Title" = 'Keep Your Friends Close'
wikisql
CREATE TABLE table_9531 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Who was the runner(s)-up when the winning score was 13 (75-68-68=211)?
SELECT "Runner(s)-up" FROM table_9531 WHERE "Winning score" = '–13 (75-68-68=211)'
wikisql
CREATE TABLE table_14540 ( "Race" text, "Position" text, "Time" text, "Speed" text, "Replica" text )
What was the speed of the race that ended in 2nd place and had a time of 01:13:03.39?
SELECT "Speed" FROM table_14540 WHERE "Position" = '2nd' AND "Time" = '01:13:03.39'
wikisql
CREATE TABLE table_27073 ( "Team" text, "Hosted" real, "Average" real, "Highest" real, "Lowest" real, "Total" real, "Last Year" real, "Up/Down" text )
What is the average of the team where the total is 243017?
SELECT "Average" FROM table_27073 WHERE "Total" = '243017'
wikisql
CREATE TABLE table_204_843 ( id number, "volume" number, "year" text, "names" text, "articles" number, "pages" number, "images" number, "maps" number, "number of copies" number )
which one has the most images
SELECT "names" FROM table_204_843 ORDER BY "images" DESC LIMIT 1
squall
CREATE TABLE table_name_8 ( pilot VARCHAR, place VARCHAR, date VARCHAR )
What is Pilot, when Place is 'Goose Green', and when Date is '27 May 1982'?
SELECT pilot FROM table_name_8 WHERE place = "goose green" AND date = "27 may 1982"
sql_create_context
CREATE TABLE table_73007 ( "No. overall" real, "Title" text, "Director" text, "Writer" text, "Original air date" text, "Production code" real )
When did the episodes first air that had a production code of 107?
SELECT "Original air date" FROM table_73007 WHERE "Production code" = '107'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
在医院4385705中列出患者褚芳泽入院科室名称不包含青光眼的住院就诊记录各是哪几条?
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_train_36 ( "id" int, "do_not_resuscitate_dnr" bool, "active_infection" bool, "sepsis" bool, "vasospastic_diathesis" bool, "septic_shock" bool, "age" float, "NOUSE" float )
must have vasopressor dependent septic shock
SELECT * FROM table_train_36 WHERE vasospastic_diathesis = 1 AND septic_shock = 1
criteria2sql
CREATE TABLE table_26615633_1 ( voice_actor VARCHAR, species VARCHAR )
who was the voice actor when the species is hedgehog?
SELECT voice_actor FROM table_26615633_1 WHERE species = "Hedgehog"
sql_create_context
CREATE TABLE table_54896 ( "Block A" text, "Kaz Hayashi" text, "NOSAWA Rongai" text, "Super Crazy" text, "Toshizo" text )
Name the NOSAWA Rongai for petey williams
SELECT "NOSAWA Rongai" FROM table_54896 WHERE "Block A" = 'petey williams'
wikisql
CREATE TABLE gwyjzb ( 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, ...
患者姜承运在08年3月30日到2021年2月1日内被开出药品4940的次数一共有几次?
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 '2008-03-30' AND '2021-02-01' AND t_kc22.SOC_SRT_DIRE_CD = '4940' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb...
css
CREATE TABLE table_54599 ( "Year" real, "Date" text, "Type" text, "President" text, "Location" text )
What is the Type with a Location with justus lipsius building, brussels, and a Year of 2012, and a President with herman van rompuy (1st term), and a Date with 23 may?
SELECT "Type" FROM table_54599 WHERE "Location" = 'justus lipsius building, brussels' AND "Year" = '2012' AND "President" = 'herman van rompuy (1st term)' AND "Date" = '23 may'
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, ...
how many of the patients diagnosed with sepsis received ed therapy?
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 = "Sepsis" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_name_18 ( points INTEGER, artist VARCHAR )
What's the sum of points for artist hari mata hari?
SELECT SUM(points) FROM table_name_18 WHERE artist = "hari mata hari"
sql_create_context
CREATE TABLE table_60358 ( "Tournament" text, "1988" text, "1990" text, "1991" text, "1992" text, "1993" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "Career SR" text, "Career Win-Loss" text )
What is the 1999 for an A 1991, and a 1r 1997?
SELECT "1999" FROM table_60358 WHERE "1991" = 'a' AND "1997" = '1r'
wikisql
CREATE TABLE table_58186 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" real )
What area is the school with a decile of 8 in?
SELECT "Area" FROM table_58186 WHERE "Decile" = '8'
wikisql
CREATE TABLE table_name_97 ( team_1 VARCHAR )
What is 2nd Leg, when Team 1 is 'H'?
SELECT 2 AS nd_leg FROM table_name_97 WHERE team_1 = "h"
sql_create_context
CREATE TABLE table_51624 ( "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text )
What is Damien Martyn's bowling style?
SELECT "Bowling Style" FROM table_51624 WHERE "Player" = 'damien martyn'
wikisql
CREATE TABLE table_name_5 ( open_2nd_viii VARCHAR, u15_6th_quad VARCHAR, u16_1st_viii VARCHAR )
Which Open 2nd VIII had a U15 6th Quad of BGS and a U16 1st VII of TSS?
SELECT open_2nd_viii FROM table_name_5 WHERE u15_6th_quad = "bgs" AND u16_1st_viii = "tss"
sql_create_context
CREATE TABLE table_name_23 ( social_sec_leeds VARCHAR, season VARCHAR, fixtures_sec VARCHAR, general_sec VARCHAR )
Name the Social Sec Leeds has Fixtures Sec of n/a, and a General Sec of n/a, and the Season of 2005 2006?
SELECT social_sec_leeds FROM table_name_23 WHERE fixtures_sec = "n/a" AND general_sec = "n/a" AND season = "2005–2006"
sql_create_context
CREATE TABLE table_204_902 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text )
how long did it take for sandeno to finish ?
SELECT "time" FROM table_204_902 WHERE "name" = 'kaitlin sandeno'
squall
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, ...
李梦琪患者从2000年6月15日开始到2007年8月6日这一段时间里,所有检验结果指标记录的检测人为章丹红的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_i...
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what were the top four medicines that were frequently prescribed a year before?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, Targ...
Usu rios com 3000 pontos ou mais que acessaram o site neste m s.
SELECT COUNT(Users.Id) AS total FROM Users WHERE Users.Reputation >= 3000 AND MONTH(Users.LastAccessDate) = MONTH(CURRENT_TIMESTAMP()) AND YEAR(Users.LastAccessDate) = YEAR(CURRENT_TIMESTAMP())
sede
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
how many hours have passed since patient 021-80293 was admitted to icu?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-80293' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_name_48 ( example_code__huc_ VARCHAR, level VARCHAR )
How many HUC example codes have 1 level?
SELECT COUNT(example_code__huc_) FROM table_name_48 WHERE level = 1
sql_create_context
CREATE TABLE table_name_21 ( ensemble VARCHAR, silver_medals INTEGER )
Name the ensemble with silver medals more than 1
SELECT ensemble FROM table_name_21 WHERE silver_medals > 1
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees who did not have any job in the past, for department_id, hire_date, visualize the trend, show x axis from high to low order please.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_204_98 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how many years after the turin marathon did the berlin marathon occur ?
SELECT (SELECT "year" FROM table_204_98 WHERE "competition" = 'berlin marathon') - (SELECT "year" FROM table_204_98 WHERE "competition" = 'turin marathon')
squall
CREATE TABLE table_37221 ( "Disaster" text, "Type" text, "Location" text, "Deaths" text, "Date" text )
What is the disaster that was located in Ontario with 223 deaths?
SELECT "Disaster" FROM table_37221 WHERE "Location" = 'ontario' AND "Deaths" = '223'
wikisql
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( ...
How many papers in ACL 2016 ?
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
scholar
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
患者编号为99506528136在治疗的时候名中没管镜的科室开了编号为什么的检验报告单?
SELECT BGDH FROM jybgb WHERE JZLSH = '99506528136' AND NOT KSMC LIKE '%管镜%'
css
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 )
Which release is being downloaded the most?
SELECT groupname FROM torrents ORDER BY totalsnatched DESC LIMIT 1
whatcdhiphop
CREATE TABLE table_62482 ( "Name" text, "Score" text, "Balls" real, "Venue" text, "Date" text )
What is Name, when Score is '101'?
SELECT "Name" FROM table_62482 WHERE "Score" = '101'
wikisql
CREATE TABLE table_14925084_1 ( administrative_county VARCHAR, area_1961__statute_acres_ VARCHAR )
Name the number of administrative county for area 1961 and 176694
SELECT COUNT(administrative_county) FROM table_14925084_1 WHERE area_1961__statute_acres_ = 176694
sql_create_context
CREATE TABLE film_actor ( actor_id VARCHAR ) CREATE TABLE actor ( first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR )
Which film actor (actress) starred the most films? List his or her first name, last name and actor id.
SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is maximum age of patients whose days of hospital stay is 11 and year of death is less than 2173?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "11" AND demographic.dod_year < "2173.0"
mimicsql_data
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
Pie. what are the names of the different bank branches, and what are their total loan amounts?
SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname
nvbench
CREATE TABLE table_49656 ( "Team" text, "Coach" text, "Home Ground" text, "Location" text, "Founded" real )
Who is the coach located in Oakden?
SELECT "Coach" FROM table_49656 WHERE "Location" = 'oakden'
wikisql
CREATE TABLE table_14266 ( "Year" real, "Competition" text, "Location" text, "Weight Category" text, "Snatch" text, "Clean and Jerk" text, "Total" text, "Place" real )
Which competition led to a total weight of 428kg?
SELECT "Competition" FROM table_14266 WHERE "Total" = '428kg'
wikisql
CREATE TABLE table_name_66 ( assists VARCHAR, year VARCHAR )
What is the assists for the year 1995?
SELECT assists FROM table_name_66 WHERE year = "1995"
sql_create_context
CREATE TABLE table_26099252_1 ( vp9___webm__ VARCHAR, h264 VARCHAR )
When h.264 is 9.0, how much is vp9 ( webm )
SELECT vp9___webm__ FROM table_26099252_1 WHERE h264 = "9.0"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_...
how many times have patient 12572 been in the hospital a year before?
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 12572 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE pitstops ( driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR )
Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)
sql_create_context
CREATE TABLE table_51774 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What is the average attendance when Brewers are the opponent with a score of 6 3?
SELECT AVG("Attendance") FROM table_51774 WHERE "Opponent" = 'brewers' AND "Score" = '6–3'
wikisql
CREATE TABLE table_1304443_2 ( county VARCHAR, bush_percentage VARCHAR )
What's the name of the county where 54.6% voted for Bush?
SELECT county FROM table_1304443_2 WHERE bush_percentage = "54.6%"
sql_create_context
CREATE TABLE table_name_47 ( total_produced INTEGER, model VARCHAR )
What is the smallest total produced with a model of M-420?
SELECT MIN(total_produced) FROM table_name_47 WHERE model = "m-420"
sql_create_context
CREATE TABLE table_56561 ( "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
Tell me the 1st leg for asfa rabat
SELECT "1st leg" FROM table_56561 WHERE "Team #1" = 'asfa rabat'
wikisql
CREATE TABLE table_10966 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which team scored 4.11 (35) while playing away?
SELECT "Away team" FROM table_10966 WHERE "Away team score" = '4.11 (35)'
wikisql
CREATE TABLE table_70556 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the score for the game on June 30?
SELECT "Score" FROM table_70556 WHERE "Date" = 'june 30'
wikisql
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
for patients who took lingual thyroid excision since 6 years ago, what are the four most frequent procedures that were followed during the same month?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admi...
mimic_iii
CREATE TABLE table_21655 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
How many locations were recorded when the opponent Columbus Blue Jackets?
SELECT COUNT("Location") FROM table_21655 WHERE "Opponent" = 'Columbus Blue Jackets'
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
how many patients were discharged from the hospital last year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE artist ( Ar...
Please give me a bar chart to show the distribution of results of all music festival, and order Y from high to low order.
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY COUNT(Result) DESC
nvbench
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, A...
Find the parties associated with the delegates from district 1 Who served as governors of the parties, and count them by a bar chart, I want to show total number in ascending order please.
SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY COUNT(Governor)
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_203_336 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
after july 6 when was the next time murray scored a win ?
SELECT "date" FROM table_203_336 WHERE "win" = 'murray' AND "date" > 6 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_14 ( attendance INTEGER, match_no VARCHAR, score VARCHAR )
After Match 43, what was the Attendance of the Match with a Score of 2-4?
SELECT MAX(attendance) FROM table_name_14 WHERE match_no > 43 AND score = "2-4"
sql_create_context
CREATE TABLE table_name_84 ( player VARCHAR, score VARCHAR )
Who is the player with a score of 68-71=139?
SELECT player FROM table_name_84 WHERE score = 68 - 71 = 139
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...
how many patients whose gender is f and discharge location is left against medical advi?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI"
mimicsql_data
CREATE TABLE table_49806 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text )
What is the highest Game, when Opponent is 'Chicago Black Hawks', and when November is less than 16?
SELECT MAX("Game") FROM table_49806 WHERE "Opponent" = 'chicago black hawks' AND "November" < '16'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
find the number of patients who were given the drug oseltamivir had stayed in the hospital for more than 7 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "7" AND prescriptions.drug = "Oseltamivir"
mimicsql_data
CREATE TABLE table_name_92 ( part_2 VARCHAR, part_4 VARCHAR )
what is part 2 when part 4 is gebonden?
SELECT part_2 FROM table_name_92 WHERE part_4 = "gebonden"
sql_create_context
CREATE TABLE table_name_67 ( laps INTEGER, start VARCHAR, finish VARCHAR )
How many laps were completed with a start of 33, and a finish of 18?
SELECT MAX(laps) FROM table_name_67 WHERE start = "33" AND finish = "18"
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...
查询入院诊断为J45.129的最低和最高医疗费总额,主要针对医院7271121的医疗记录
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 = '7271121' AND t_kc24.t_kc21_IN_DIAG_DIS_CD = 'J45.129')
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
in the case of patients who were diagnosed with hypercarbia until 2 years ago, what are the top five most common diagnoses that followed during the same month?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypercarbia' AND DATETIME(diagnosis.diag...
eicu
CREATE TABLE operate_company ( id number, name text, type text, principal_activities text, incorporated_in text, group_equity_shareholding number ) CREATE TABLE flight ( id number, vehicle_flight_number text, date text, pilot text, velocity number, altitude number, a...
What is maximum group equity shareholding of the companies?
SELECT MAX(group_equity_shareholding) FROM operate_company
spider
CREATE TABLE table_23299 ( "#" real, "Player" text, "Age" real, "Australian Open" real, "French Open" real, "Wimbledon" real, "US Open" real )
At what age did Roy Emerson complete the Grand Slam?
SELECT MAX("Age") FROM table_23299 WHERE "Player" = 'Roy Emerson'
wikisql
CREATE TABLE Performance ( bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR ) CREATE TABLE Songs ( SongId VARCHAR, Title VARCHAR ) CREATE TABLE Band ( firstname VARCHAR, lastname VARCHAR, id VARCHAR )
Who is performing in the back stage position for the song 'Der Kapitan'? Show the first name and last name.
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Der Kapitan" AND T1.StagePosition = "back"
sql_create_context
CREATE TABLE table_name_68 ( s_wicket VARCHAR, player VARCHAR )
Which value for s wicket is associated with Shaun Young?
SELECT s_wicket FROM table_name_68 WHERE player = "shaun young"
sql_create_context
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...
2555130这个医院涉及医疗费总额低于5728.03元的科室有多少?时间范围是16年1月8日到19年9月30日
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2555130' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-01-08' AND '2019-09-30' GROUP B...
css
CREATE TABLE table_43784 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the highest played when there was less than 74 goals against and points 1 of 36 2?
SELECT MAX("Played") FROM table_43784 WHERE "Points 1" = '36 2' AND "Goals Against" < '74'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
What number of patients had the procedure of incision of abdominal wall and their hospital stay was more than 3 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "3" AND procedures.long_title = "Incision of abdominal wall"
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...
what is the admission location and primary disease of subject id 18480?
SELECT demographic.admission_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "18480"
mimicsql_data
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 demographic ( subject_id text, hadm_id t...
look for the time of discharge for the patient with patient id 2560.
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
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, ...
what was the percentile of 7.49 in the ph lab test with the same age of patient 035-1391 in the last hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'ph' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '035-1391' AND NOT patient.hos...
eicu
CREATE TABLE table_name_81 ( building VARCHAR, floors VARCHAR, year VARCHAR )
For the Year 2013 what building(s) had more than 15 Floors?
SELECT building FROM table_name_81 WHERE floors > 15 AND year = "2013"
sql_create_context
CREATE TABLE table_50924 ( "Institution" text, "Location" text, "Nickname" text, "Enrollment" real, "Established" real )
What year was the team with the nickname pride established?
SELECT COUNT("Established") FROM table_50924 WHERE "Nickname" = 'pride'
wikisql
CREATE TABLE table_72119 ( "Rd" real, "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
The winning team of the race, los angeles times 500 is who?
SELECT "Winning team" FROM table_72119 WHERE "Name" = 'Los Angeles Times 500'
wikisql
CREATE TABLE table_46749 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the To par of the Player with a Score of 70-72-73=215?
SELECT "To par" FROM table_46749 WHERE "Score" = '70-72-73=215'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients whose religion is greek orthodox and item id is 51288?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "GREEK ORTHODOX" AND lab.itemid = "51288"
mimicsql_data
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE ref_locations ( location_code text, location_name text, location_description text ) CREATE TABLE employees ( employee_id number, role_code text, employe...
What is the role with the smallest number of employees? Find the role codes.
SELECT role_code FROM employees GROUP BY role_code ORDER BY COUNT(*) LIMIT 1
spider
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 demographic ...
how many patients are of american indian/alaska native ethnicity and admitted before the year 2144?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.admityear < "2144"
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...
give me the number of patients whose lab test chart time is 2111-12-31 12:16:00?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2111-12-31 12:16:00"
mimicsql_data
CREATE TABLE table_name_19 ( release_date VARCHAR, isbn VARCHAR, year VARCHAR )
What was release date in 1992 with the ISBN #0?
SELECT release_date FROM table_name_19 WHERE isbn = 0 AND year = 1992
sql_create_context
CREATE TABLE table_65176 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
Which Episodes have a TV Station of ntv, and a Japanese Title of ?
SELECT AVG("Episodes") FROM table_65176 WHERE "TV Station" = 'ntv' AND "Japanese Title" = 'あいのうた'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients with abnormal lab test status who were less than 62 years of age?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "62" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_7 ( result INTEGER, name VARCHAR )
What is Anna Rogowska's average result?
SELECT AVG(result) FROM table_name_7 WHERE name = "anna rogowska"
sql_create_context
CREATE TABLE table_441 ( "Overall Pick #" real, "AFL Team" text, "Player" text, "Position" text, "College" text )
What is the position of john charles?
SELECT "Position" FROM table_441 WHERE "Player" = 'John Charles'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
Which is less demanding out of EECS 545 and EECS 562 ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 545 OR course.number = 562) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
when was the last time patient 035-2057 had intake on the first icu visit?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2057') AND NOT patient.unitdischargetime IS NULL ...
eicu
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) 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 varch...
Are upper-level classes all 12 credits ?
SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 12 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_4635 ( "Date" text, "Pages" text, "Hero" text, "Story" text, "Story code" text )
How many pages does the story h 87112 have?
SELECT "Pages" FROM table_4635 WHERE "Story code" = 'h 87112'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在多少次的医疗记录里面记录了患者吕格菲使用了均价不足2770.51元的药物?当时就诊的编号都是多少?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '吕格菲' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 2770.51)
css
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Next semester , which classes are Dr. Zehra Igsiz teaching ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Zehra Igsiz%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer...
advising
CREATE TABLE table_name_64 ( scorers VARCHAR, opponent VARCHAR, date VARCHAR )
Who were the scorers in the game against neuch tel xamax played on 10 December 1985?
SELECT scorers FROM table_name_64 WHERE opponent = "neuchâtel xamax" AND date = "10 december 1985"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ...
Who has published both in ICML and ACL ?
SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename IN ('ICML', 'ACL') AND writes.paperid = paper.paperid GROUP BY writes.authorid HAVING COUNT(DISTINCT venue.venueid) = 2
scholar
CREATE TABLE table_20173 ( "Club" text, "Position in 2013" text, "First season" real, "First season of current spell" real, "Number of seasons in Superettan" real, "Number of seasons in second tier" text )
What position is the player whose first year is 2014
SELECT "Position in 2013" FROM table_20173 WHERE "First season" = '2014'
wikisql
CREATE TABLE table_29958 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the most game for us airways center 16,470
SELECT MIN("Game") FROM table_29958 WHERE "Location Attendance" = 'US Airways Center 16,470'
wikisql