context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
what are the top four most frequent diagnoses that patients have received in the same month after receiving a replace trach tube?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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 = admissi...
mimic_iii
CREATE TABLE table_name_21 ( laps VARCHAR, driver VARCHAR, grid VARCHAR )
What was John Watson's total laps with a grid of less than 7?
SELECT COUNT(laps) FROM table_name_21 WHERE driver = "john watson" AND grid < 7
sql_create_context
CREATE TABLE table_name_88 ( pitcher VARCHAR, date VARCHAR )
Who was the pitcher on June 8, 1961?
SELECT pitcher FROM table_name_88 WHERE date = "june 8, 1961"
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...
give the number of patients whose primary disease is st elevated myocardial infarction/ cardiac cath and procedure short title is cont inv mec ven less than 96 hours.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.short_title = "Cont inv mec ven <96 hrs"
mimicsql_data
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), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of first_name and manager_id , and show by the X in ascending.
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
nvbench
CREATE TABLE invoice_lines ( id number, invoice_id number, track_id number, unit_price number, quantity number ) CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, cit...
What are the names of all the playlists?
SELECT name FROM playlists
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
tell me the daily maximum respiration of patient 005-12192 since 12/26/2102.
SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-12192')) AND NOT vitalperiodic.respiration IS ...
eicu
CREATE TABLE table_18247 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the results for the candidates listed as bart gordon (d) 76.5% wallace embry (r) 23.5%?
SELECT "Result" FROM table_18247 WHERE "Candidates" = 'Bart Gordon (D) 76.5% Wallace Embry (R) 23.5%'
wikisql
CREATE TABLE table_51749 ( "Year" real, "Athlete" text, "Nation" text, "Time" text, "Location" text )
What location had 1:59:12 in time?
SELECT "Location" FROM table_51749 WHERE "Time" = '1:59:12'
wikisql
CREATE TABLE table_28781 ( "Year (Ceremony)" text, "English title" text, "Arabic title" text, "Director" text, "Result" text )
When salt of this sea is the english title who is the director?
SELECT "Director" FROM table_28781 WHERE "English title" = 'Salt of this Sea'
wikisql
CREATE TABLE table_22857 ( "Model" text, "Year" text, "Code name" text, "Fab ( nm )" real, "Bus interface" text, "Transistor count (Millions)" real, "Memory max ( MiB )" text, "Core ( MHz )" real, "Memory ( MHz )" text, "Type" text, "Bus Width ( Bit )" real, "DirectX" tex...
What's the bus width (in bit) of the model whose core is 650 MHz?
SELECT COUNT("Bus Width ( Bit )") FROM table_22857 WHERE "Core ( MHz )" = '650'
wikisql
CREATE TABLE table_61961 ( "President" text, "Treasurer" text, "Secretary" text, "Social AO" text, "Academic AO" text, "Internal CO" text, "External CO" text )
What Social AO has a President of harm van leeuwen?
SELECT "Social AO" FROM table_61961 WHERE "President" = 'harm van leeuwen'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, sort by the Y-axis in descending.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE table_21422977_1 ( coalition_parties VARCHAR, nº VARCHAR )
When n is 3, what are all the coaliton parties?
SELECT coalition_parties FROM table_21422977_1 WHERE nº = 3
sql_create_context
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
What is the relationship between Clean_Jerk and Total ?
SELECT Clean_Jerk, Total FROM body_builder
nvbench
CREATE TABLE table_name_48 ( state VARCHAR, member VARCHAR, term_in_office VARCHAR, party VARCHAR )
Which state has a Term in office of 1984 1996, a Party of labor, and a Member of robert tickner?
SELECT state FROM table_name_48 WHERE term_in_office = "1984–1996" AND party = "labor" AND member = "robert tickner"
sql_create_context
CREATE TABLE table_8260 ( "Name" text, "Company" text, "Tracking Method" text, "Latest stable release" text, "Price in USD" text )
Which Tracking Method has a Latest stable release of n/a, and a Price in USD of from $202/month?
SELECT "Tracking Method" FROM table_8260 WHERE "Latest stable release" = 'n/a' AND "Price in USD" = 'from $202/month'
wikisql
CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, city text, state text, country text, postal_code text, phone text, fax text, email text ) CREATE TABLE albums ( ...
What is the unit price of the tune 'Fast As a Shark'?
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark"
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 diagnoses ( ...
how many patients are admitted in emergency room and diagnosed primarily for transient ischemic attack?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK"
mimicsql_data
CREATE TABLE table_32871 ( "Adherents" real, "Regular Attendees" real, "% of adherents" text, "Monasteries" real, "Parishes" real, "Average Parish Size" real )
What is the lowest average parish size with 47.2% of adherents and 4,936 regular attendees?
SELECT MIN("Average Parish Size") FROM table_32871 WHERE "% of adherents" = '47.2%' AND "Regular Attendees" > '4,936'
wikisql
CREATE TABLE table_11598 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
On what surface was the tournament with opponents kathleen horvath marcella mesker in the finals?
SELECT "Surface" FROM table_11598 WHERE "Opponents in the final" = 'kathleen horvath marcella mesker'
wikisql
CREATE TABLE table_21571 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text )
If grid is 2, what is the minimum fin. pos number?
SELECT MIN("Fin. Pos") FROM table_21571 WHERE "Grid" = '2'
wikisql
CREATE TABLE table_8307 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of gold medals of slovakia, which has less than 1 silver medal?
SELECT COUNT("Gold") FROM table_8307 WHERE "Silver" < '1' AND "Nation" = 'slovakia'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
is there any results of the microbiology test carried out for patient 031-1337 in 05/this year?
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-1337')) AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIM...
eicu
CREATE TABLE table_1109 ( "Rank" real, "Country" text, "International tourist arrivals (2011)" text, "International tourist arrivals (2010)" text, "Change (2010 to 2011)" text, "Change (2009 to 2010)" text )
Name the international tourist arrivals for arrivals 2011 for 8.1 million
SELECT "International tourist arrivals (2010)" FROM table_1109 WHERE "International tourist arrivals (2011)" = '8.1 million'
wikisql
CREATE TABLE table_203_212 ( id number, "#" number, "district" text, "land area (km2)" number, "population\n(2010 census)" number, "density (persons/km2)" number )
saint lucia has how many districts with a population density below 200 persons per square kilometer ?
SELECT COUNT("district") FROM table_203_212 WHERE "density (persons/km2)" < 200
squall
CREATE TABLE table_38644 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real )
Name the average week for result of l 28 17
SELECT AVG("Week") FROM table_38644 WHERE "Result" = 'l 28–17'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
编号为07717128027的这个住院就诊中,出院状态对应的编码是什么
SELECT zyjzjlb.CYZTDM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '07717128027'
css
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real...
Show the names and heights of buildings with at least two institutions founded after 1880 Plot them as bar chart, and I want to show Y-axis in descending order.
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 ORDER BY Height_feet DESC
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of code , and group by attribute founder, rank y-axis in asc order.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_19248 ( "Year" real, "Boys singles" text, "Girls singles" text, "Boys doubles" text, "Girls doubles" text, "Mixed doubles" text )
When the girls doubles is ayu pratiwi anggi widia what is the boys doubles?
SELECT "Boys doubles" FROM table_19248 WHERE "Girls doubles" = 'Ayu Pratiwi Anggi Widia'
wikisql
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...
Draw a bar chart about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road, and order by the ACC_Road in desc.
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
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...
有哪些科室在编码为4788064的医院最长医疗住院时长少于20天?
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4788064' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MAX(gwyjzb.IN_HOSP_DAYS) < 20 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4788064' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MAX(fgwyjzb.IN_H...
css
CREATE TABLE table_name_51 ( equipment VARCHAR, position VARCHAR, points VARCHAR )
What is Equipment, when Position is greater than 28, and when Points is greater than 10?
SELECT equipment FROM table_name_51 WHERE position > 28 AND points > 10
sql_create_context
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 medication ( medi...
when did patient 007-2498 last receive a diagnosis of encephalopathy since 5 years ago?
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 = '007-2498')) AND diagnosis.diagnosisname = 'encephalopathy' AND DA...
eicu
CREATE TABLE table_11381701_3 ( date VARCHAR, bada VARCHAR )
On which dates was the value of Bada 0.05%?
SELECT date FROM table_11381701_3 WHERE bada = "0.05%"
sql_create_context
CREATE TABLE table_61900 ( "Year" real, "Edition" text, "Round" text, "Date" text, "Location" text, "Surface" text, "Against" text, "Opponent(s)" text, "Score" text, "Result" text )
Which Year has a Date of 5 6 february?
SELECT AVG("Year") FROM table_61900 WHERE "Date" = '5–6 february'
wikisql
CREATE TABLE table_2311410_5 ( erin_and_jake VARCHAR, week VARCHAR )
Name the erin and jake for week 4
SELECT erin_and_jake FROM table_2311410_5 WHERE week = 4
sql_create_context
CREATE TABLE table_51527 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text )
Name the nationality of the player with an overall of 74
SELECT "Nationality" FROM table_51527 WHERE "Overall" = '74'
wikisql
CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TAB...
Show the number of headquarters from each headquarters
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters
nvbench
CREATE TABLE table_23952 ( "Position" real, "Race number" text, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text )
What are the LOA (metres) of boat with sail number M10?
SELECT "LOA (Metres)" FROM table_23952 WHERE "Sail number" = 'M10'
wikisql
CREATE TABLE table_name_44 ( venue VARCHAR, competition VARCHAR, result VARCHAR )
What venue were the 1986 Asian games resulting in 2-0 played at?
SELECT venue FROM table_name_44 WHERE competition = "1986 asian games" AND result = "2-0"
sql_create_context
CREATE TABLE table_24899 ( "Code & location" text, "Missile Type" text, "Defense Area" text, "Dates" text, "Control Site condition/owner" text, "Launch Site condition/owner" text )
When is every date that control site condition or owner is machine shop on Martin Dr.?
SELECT "Dates" FROM table_24899 WHERE "Control Site condition/owner" = 'machine shop on Martin Dr.'
wikisql
CREATE TABLE table_13463790_2 ( city VARCHAR, name VARCHAR )
how many city with name being providence tower
SELECT COUNT(city) FROM table_13463790_2 WHERE name = "Providence Tower"
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...
王清俊病患的检验报告单对应的检验结果指标均正常的一共有哪些?其检验报告单号是多少?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '王...
css
CREATE TABLE table_65129 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What's Bulgaria's lane?
SELECT AVG("Lane") FROM table_65129 WHERE "Nationality" = 'bulgaria'
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, ...
从03年3月14日起到2009年1月3日为止病患柳飞星都进行了什么检测记录在检验结果指标记录里?
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJG...
css
CREATE TABLE table_name_34 ( nfl_club VARCHAR, pick VARCHAR, position VARCHAR )
What is the NFL club of the cornerback player with a pick greater than 63?
SELECT nfl_club FROM table_name_34 WHERE pick > 63 AND position = "cornerback"
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...
在2008-09-21到2015-12-28的这段时间,医疗机构7987100的总金额和统筹总金额分别是多少
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7987100' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-09-21' AND '2015-12-28'
css
CREATE TABLE table_name_41 ( outcome VARCHAR, opponent VARCHAR )
What was the outcome in mari andersson's tournament?
SELECT outcome FROM table_name_41 WHERE opponent = "mari andersson"
sql_create_context
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE...
Find the total number of students in each department. Show bar chart.
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name
nvbench
CREATE TABLE table_train_94 ( "id" int, "mini_mental_state_examination_mmse" int, "substance_dependence" bool, "psychiatric_disease" bool, "modified_hachinski_ischemia_scale" int, "smoking" bool, "alcohol_abuse" bool, "NOUSE" float )
the subject has a recent history ( within 2 years ) of alcohol or substance abuse / dependence.
SELECT * FROM table_train_94 WHERE alcohol_abuse = 1 OR substance_dependence = 1 OR substance_dependence = 1
criteria2sql
CREATE TABLE table_name_39 ( date VARCHAR, shooter VARCHAR )
What is the Date of Shooter New Targets from 1989's record?
SELECT date FROM table_name_39 WHERE shooter = "new targets from 1989"
sql_create_context
CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE performance ( songid number, bandmate numbe...
What are the song titles on the album 'A Kiss Before You Go: Live in Hamburg'?
SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = "A Kiss Before You Go: Live in Hamburg"
spider
CREATE TABLE table_78212 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text, "Tries" text, "Goals" text )
What were the goals on 3/10/97?
SELECT "Goals" FROM table_78212 WHERE "Date" = '3/10/97'
wikisql
CREATE TABLE table_name_33 ( debut INTEGER, player VARCHAR, years_played VARCHAR )
what is the debut when the play er is radoslava topalova and the years played is less than 2?
SELECT AVG(debut) FROM table_name_33 WHERE player = "radoslava topalova" AND years_played < 2
sql_create_context
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
What is the average age of captains in different classes?, order by the bars from high to low.
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE table_name_2 ( score VARCHAR, surface VARCHAR, opponent_in_the_final VARCHAR )
What is the score of the match played on a hard surface with an opponent in the final of Elena Likhovtseva?
SELECT score FROM table_name_2 WHERE surface = "hard" AND opponent_in_the_final = "elena likhovtseva"
sql_create_context
CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( i...
A bar chart about the number of end dates for incidents with incident type code 'NOISE' and bin by month.
SELECT date_incident_end, COUNT(date_incident_end) FROM Behavior_Incident WHERE incident_type_code = "NOISE"
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
Test - top 20 viewcount.
SELECT Id AS "post_link", Score, Tags, OwnerUserId, OwnerDisplayName, ParentId FROM Posts ORDER BY ViewCount DESC LIMIT 20
sede
CREATE TABLE table_4572 ( "Commodity" text, "2001-02" text, "2002-03" text, "2003-04" text, "2004-05" text, "2005-06" text, "2006-07" text )
What was the production in 2002-03 for the commodity that produced 1,725 in 2001-02?
SELECT "2002-03" FROM table_4572 WHERE "2001-02" = '1,725'
wikisql
CREATE TABLE table_22669375_1 ( race_name VARCHAR, date VARCHAR )
Name the race name for june 6
SELECT race_name FROM table_22669375_1 WHERE date = "June 6"
sql_create_context
CREATE TABLE table_37314 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
What were the points for a team that 414 points against?
SELECT "Points for" FROM table_37314 WHERE "Points against" = '414'
wikisql
CREATE TABLE table_15329 ( "County" text, "Kerry %" text, "Kerry #" real, "Bush %" text, "Bush #" real, "Others %" text, "Others #" real )
How many votes did Other receive where Bush received less than 154,204 votes, and Kerry received 41.7% and more than 98,066 votes?
SELECT COUNT("Others #") FROM table_15329 WHERE "Bush #" < '154,204' AND "Kerry %" = '41.7%' AND "Kerry #" > '98,066'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
在医疗就诊13308271628中,患者周阳飇自费金额最高的项目是哪一项?
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '13308271628' GROUP BY SOC_SRT_DIRE_CD ORDER BY SUM(SELF_PAY_AMO) DESC LIMIT 1
css
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在17年3月21日到18年10月30日期间,患者12922014曾到医院看过几次病
SELECT (SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '12922014' AND txmzjzjlb.JZKSRQ BETWEEN '2017-03-21' AND '2018-10-30' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjz...
css
CREATE TABLE table_76670 ( "Driver" text, "Team" text, "Race 1" text, "Race 2" text, "Points" real )
Which driver for Bob Holden Motors has fewer than 36 points and placed 7 in race 1?
SELECT "Driver" FROM table_76670 WHERE "Points" < '36' AND "Team" = 'bob holden motors' AND "Race 1" = '7'
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, ...
被诊断为疾病F95.742的患者张兴邦,他的检测指标517400的结果定量和单位如何
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose ethnicity is asian and drug name is talc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug = "Talc"
mimicsql_data
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE va...
Show the number of courses for each instructor in a bar chart.
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME
nvbench
CREATE TABLE table_29626583_1 ( pick__number INTEGER, mls_team VARCHAR )
how many pick# does the chivas usa mls team have
SELECT MAX(pick__number) FROM table_29626583_1 WHERE mls_team = "Chivas USA"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( ...
what were the first potassium from patient 29309 since 01/2103?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29309) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND STRFTIME('%y-%m', labevents.charttime) >= '2103-01' ORDER BY lab...
mimic_iii
CREATE TABLE table_50767 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the lowest Goals, when Played is greater than 30?
SELECT MIN("Goals for") FROM table_50767 WHERE "Played" > '30'
wikisql
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION v...
How many students taking a course who received an A or C? Group by students' last name with a bar chart, and display by the STU_LNAME in desc.
SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME ORDER BY STU_LNAME DESC
nvbench
CREATE TABLE table_name_34 ( zan_1 VARCHAR, nor_1 VARCHAR )
What is the zan 1 that has 11 as the nor 1?
SELECT zan_1 FROM table_name_34 WHERE nor_1 = "11"
sql_create_context
CREATE TABLE table_16083 ( "Headstamp ID" text, "Primer Annulus Color" text, "Bullet Tip Color" text, "Other Features" text, "Functional Type" text )
How many primers annulus colors were there when the color of the bullet tip was white?
SELECT COUNT("Primer Annulus Color") FROM table_16083 WHERE "Bullet Tip Color" = 'White'
wikisql
CREATE TABLE table_25352324_5 ( points VARCHAR, player VARCHAR )
How many values for points have Sophia Witherspoon as the player?
SELECT COUNT(points) FROM table_25352324_5 WHERE player = "Sophia Witherspoon"
sql_create_context
CREATE TABLE table_30090 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What episode number of the series is 'open water'?
SELECT "No. in series" FROM table_30090 WHERE "Title" = 'Open Water'
wikisql
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, da...
How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?
SELECT SUM(lesson_time) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
spider
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
Please draw a bar chart to show the total number of different color.
SELECT color, COUNT(color) FROM photos GROUP BY color
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
自2009年4月19日起,至2015年12月14日止,7542494的医院总共记录有多少医疗次数
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '7542494' AND IN_HOSP_DATE BETWEEN '2009-04-19' AND '2015-12-14'
css
CREATE TABLE table_64581 ( "Wager" text, "Winner" text, "Loser" text, "Location" text, "Date" text )
What is the date of the match where vampiro was the winner in Mexico City?
SELECT "Date" FROM table_64581 WHERE "Location" = 'mexico city' AND "Winner" = 'vampiro'
wikisql
CREATE TABLE table_204_833 ( id number, "game" number, "date" text, "team" text, "score" text, "high points" text, "high rebounds" text, "high assists" text, "location\nattendance" text, "record" text )
how many games was loss ?
SELECT COUNT(*) FROM table_204_833 WHERE "score" = 'l'
squall
CREATE TABLE table_50336 ( "Team" text, "Winners" real, "Runners-Up" real, "Years Won" text, "Years Runner-Up" text )
When the Runners-Up is larger than 0, what's the sum of winners?
SELECT SUM("Winners") FROM table_50336 WHERE "Runners-Up" > '0'
wikisql
CREATE TABLE table_203_36 ( id number, "parish" text, "locality" text, "parish priest" text, "founded" number, "closed" number )
how many parishes had fr frank thorpe as their parish priest ?
SELECT COUNT("parish") FROM table_203_36 WHERE "parish priest" = 'fr frank thorpe'
squall
CREATE TABLE table_78709 ( "Ending" text, "American" text, "British" text, "Australian" text, "Examples" text )
Which Australian has British of s?
SELECT "Australian" FROM table_78709 WHERE "British" = 'ɒs'
wikisql
CREATE TABLE table_19948664_1 ( countries_sampled INTEGER, ranking_la__2_ VARCHAR, author___editor___source VARCHAR, year_of_publication VARCHAR )
How many countries were sampled in the index created by The Economist, published in 2007 and ranked 2nd in the LA Ranking?
SELECT MAX(countries_sampled) FROM table_19948664_1 WHERE author___editor___source = "The Economist" AND year_of_publication = "2007" AND ranking_la__2_ = "2nd"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
how many times did patient 002-62161 receive the -polys test in 2105?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-62161')) AND lab.labname = '-polys' AND STRFTIME('%y', lab.labresulttime) = '2105'
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...
患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤...
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how many patients died after having been diagnosed with hemorrhage within the same hospital visit until 1 year ago?
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE table_name_79 ( year INTEGER, name VARCHAR )
What is the total time for one south broad?
SELECT SUM(year) FROM table_name_79 WHERE name = "one south broad"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
in 08/last year, what organism was found in patient 031-23724's last blood, venipuncture test?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIM...
eicu
CREATE TABLE table_62064 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which To par has a Place of t2, and a Player of mark james?
SELECT "To par" FROM table_62064 WHERE "Place" = 't2' AND "Player" = 'mark james'
wikisql
CREATE TABLE table_76724 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
What was the box score during a game that had a score of 86-96?
SELECT "Box Score" FROM table_76724 WHERE "Score" = '86-96'
wikisql
CREATE TABLE table_name_84 ( songwriter_s_ VARCHAR, production_credits VARCHAR, track VARCHAR )
Who was the songwriter for Track 4, produced by nigel wright and john smits?
SELECT songwriter_s_ FROM table_name_84 WHERE production_credits = "nigel wright and john smits" AND track = 4
sql_create_context
CREATE TABLE table_51556 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text )
What club/province does the prop player with over 45 caps play for?
SELECT "Club/province" FROM table_51556 WHERE "Caps" > '45' AND "Position" = 'prop'
wikisql
CREATE TABLE table_35411 ( "Constituency" text, "Electorate" real, "Turnout" text, "Spoilt" text, "Valid Poll" real, "Quota" text, "Seats" real, "Candidates" real )
What is the smallest electorate with 78,076 quota and less than 13 candidates?
SELECT MIN("Electorate") FROM table_35411 WHERE "Quota" = '78,076' AND "Candidates" < '13'
wikisql
CREATE TABLE table_60383 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
Can you tell me the 2010 that has the 2008 of grand slam tournaments?
SELECT "2010" FROM table_60383 WHERE "2008" = 'grand slam tournaments'
wikisql
CREATE TABLE table_62290 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What was the surface when the opponent was sergiy stakhovsky mikhail youzhny?
SELECT "Surface" FROM table_62290 WHERE "Opponents" = 'sergiy stakhovsky mikhail youzhny'
wikisql
CREATE TABLE table_55137 ( "Year" real, "Award" text, "Category" text, "Nominated work" text, "Result" text )
Which category was the berlin file up to win in 2013?
SELECT "Category" FROM table_55137 WHERE "Year" = '2013' AND "Nominated work" = 'the berlin file'
wikisql