context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Stateme...
How many documents for each document type name? Visualize by a ar chart, sort in desc by the x-axis.
SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Type_Name DESC
nvbench
CREATE TABLE table_9443 ( "Name" text, "Born-Died" text, "Term start" text, "Term end" text, "Political Party" text )
Which Name has a Term end of 18 july 1944?
SELECT "Name" FROM table_9443 WHERE "Term end" = '18 july 1944'
wikisql
CREATE TABLE table_203_393 ( id number, "year" number, "film" text, "director" text, "cast" text, "details" text )
what director has credit for directing the most films ?
SELECT "director" FROM table_203_393 GROUP BY "director" ORDER BY COUNT("film") DESC LIMIT 1
squall
CREATE TABLE table_name_79 ( pos INTEGER, league VARCHAR, postseason VARCHAR )
What is the average position for tb2l teams promoted champion?
SELECT AVG(pos) FROM table_name_79 WHERE league = "tb2l" AND postseason = "promoted champion"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
已经被门诊诊断为疾病W41.056的这个患者96646392的D2聚体(肝素/EDTA)的结果定量及其单位分别是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON 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 mzjzjlb.JZZDBM = 'W41.056' AND hz_info.RYB...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalpe...
when had patient 002-3736 first been prescribed for calcium chloride and acetaminophen 1,000 mg/100 ml (10 mg/ml) iv soln at the same time in 02/2103?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'calcium chloride' AND patient.uniquepid = '002-3736' AND STRFTIME('%y-%m', medication.drugstarttime) = '2103-02') AS t1 J...
eicu
CREATE TABLE table_name_77 ( swimsuit INTEGER, average VARCHAR, evening_gown VARCHAR, state VARCHAR )
What is the sum of the swimsuit scores from Missouri that have evening gown scores less than 8.77 and average scores less than 8.823?
SELECT SUM(swimsuit) FROM table_name_77 WHERE evening_gown < 8.77 AND state = "missouri" AND average < 8.823
sql_create_context
CREATE TABLE table_261927_1 ( institution VARCHAR, nickname VARCHAR )
What is the institution with the nickname engineers?
SELECT institution FROM table_261927_1 WHERE nickname = "Engineers"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is maximum age of patients whose gender is m and death status is 0?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.expire_flag = "0"
mimicsql_data
CREATE TABLE table_name_28 ( years_played INTEGER, singles_win_loss VARCHAR, first_year_played VARCHAR )
How many years did the team that has a Singles win-Loss of 4-9 and first played before 1999?
SELECT SUM(years_played) FROM table_name_28 WHERE singles_win_loss = "4-9" AND first_year_played < 1999
sql_create_context
CREATE TABLE table_name_83 ( result VARCHAR, date VARCHAR )
What is the result for the date of august 23?
SELECT result FROM table_name_83 WHERE date = "august 23"
sql_create_context
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, ...
provide the number of patients whose diagnoses short title is hx-rectal & anal malign and lab test abnormal status is abnormal?
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.short_title = "Hx-rectal & anal malign" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_204_799 ( id number, "name" text, "built" text, "listed" text, "location" text, "county" text, "type" text )
how many total bridges are in copiah county ?
SELECT COUNT(DISTINCT "name") FROM table_204_799 WHERE "county" = 'copiah'
squall
CREATE TABLE table_25124 ( "Series #" real, "Season #" real, "Episode title" text, "Written by" text, "Directed by" text, "U.S. viewers (millions)" text, "Original air date" text )
How many u.s. viewers (millions) have 5 as the season #?
SELECT "U.S. viewers (millions)" FROM table_25124 WHERE "Season #" = '5'
wikisql
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
Find the names of the artists who are from Bangladesh and have never received rating higher than 7.
SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7
spider
CREATE TABLE table_1342218_11 ( first_elected VARCHAR, candidates VARCHAR )
What year was first elected william m. wheeler (d) unopposed?
SELECT first_elected FROM table_1342218_11 WHERE candidates = "William M. Wheeler (D) Unopposed"
sql_create_context
CREATE TABLE table_name_91 ( year VARCHAR, manager VARCHAR )
Manager of marty berghammer / nick allen is what year?
SELECT year FROM table_name_91 WHERE manager = "marty berghammer / nick allen"
sql_create_context
CREATE TABLE table_1876825_3 ( no_in_series VARCHAR, original_air_date VARCHAR )
What episode number in the series originally aired on February 25, 2001?
SELECT no_in_series FROM table_1876825_3 WHERE original_air_date = "February 25, 2001"
sql_create_context
CREATE TABLE table_10078 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
What is the country of player ian woosnam?
SELECT "Country" FROM table_10078 WHERE "Player" = 'ian woosnam'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
tell me the total number of patients in the tsicu careunits until 1 year ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-1 year'))
mimic_iii
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 whose first name is ending with the letter m, sum their salary for visualizing a bar chart, could you sort by the total number in ascending please?
SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY SUM(SALARY)
nvbench
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid ...
How many papers were accepted at sigmod 2016 ?
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'sigmod'
scholar
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
what is the total dosage of chlorhexidine gluconate 0.12% oral rinse that patient 57050 has been prescribed in this month?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND prescriptions.drug = 'chlorhexidine gluconate 0.12% oral rinse' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE table_30815 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
How may college/junior/club team has a the nhl team listed as Colorado Avalanche?
SELECT COUNT("College/junior/club team") FROM table_30815 WHERE "NHL team" = 'Colorado Avalanche'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
what's the average cost of a hospital with rbc, joint fluid in 2105?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, joint fluid')) AND STRFTIME('%y', cost.chargetime) = '2105' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_14756 ( "Series" text, "Name" text, "Hometown" text, "Occupation" text, "Status" text )
What is the status of Aden Theobald from the hometown of London?
SELECT "Status" FROM table_14756 WHERE "Hometown" = 'london' AND "Name" = 'aden theobald'
wikisql
CREATE TABLE table_name_69 ( score VARCHAR, place VARCHAR )
What is the score of T7 place?
SELECT score FROM table_name_69 WHERE place = "t7"
sql_create_context
CREATE TABLE table_name_18 ( frequency VARCHAR, format VARCHAR )
What is the frequency for the active rock format?
SELECT frequency FROM table_name_18 WHERE format = "active rock"
sql_create_context
CREATE TABLE table_name_12 ( name VARCHAR, directed___undirected VARCHAR, basis VARCHAR )
What is the name of the algorithm with a directed/undirected of both and a subgraph-centric basis?
SELECT name FROM table_name_12 WHERE directed___undirected = "both" AND basis = "subgraph-centric"
sql_create_context
CREATE TABLE table_name_1 ( attendance INTEGER, date VARCHAR )
Name the least attendance for may 6
SELECT MIN(attendance) FROM table_name_1 WHERE date = "may 6"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
患者李凯唱的异常情况,之前有哪些?
SELECT * 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_info.XM = '李凯唱'...
css
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Return a histogram on what is the average number of stars that each reviewer awards for a movie?, and I want to display x-axis in desc order please.
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name DESC
nvbench
CREATE TABLE table_31433 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (million)" text )
Who wrote 'yielding'?
SELECT "Written by" FROM table_31433 WHERE "Title" = 'Yielding'
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...
患者吴永嘉金额超过2273.34元的药品在哪几次医疗记录中被开出过?医疗就诊编号分别是多少?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '吴永嘉' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2273.34)
css
CREATE TABLE table_59754 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the tournament that was on july 6, 1987?
SELECT "Tournament" FROM table_59754 WHERE "Date" = 'july 6, 1987'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
how many patients were diagnosed with obstructive sleep apnea within the same month after being diagnosed with hypertension nos since 3 years ago.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'obstructive sleep ...
mimic_iii
CREATE TABLE table_name_97 ( bronze VARCHAR, gold VARCHAR, silver VARCHAR, total VARCHAR )
What is the total number of bronze a team with more than 0 silver, a total of 7 medals, and less than 1 gold medal has?
SELECT COUNT(bronze) FROM table_name_97 WHERE silver > 0 AND total = 7 AND gold < 1
sql_create_context
CREATE TABLE table_name_75 ( country VARCHAR, category VARCHAR, result VARCHAR, award VARCHAR )
Which Country has a Result of nominated, an Award of 17th bangkok critics assembly awards, and a Category of best screenplay?
SELECT country FROM table_name_75 WHERE result = "nominated" AND award = "17th bangkok critics assembly awards" AND category = "best screenplay"
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...
在门诊诊断为疾病X60.562的患者身上其抗凝血酶III的参考值范围下限和上限具体为多少数值?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE table_68098 ( "Year" real, "Group" text, "Award" text, "Film/Show" text, "Result" text )
What is the Award, when the Film/Show is East West 101, and when the year is before 2009, and when the Group is Logie Award?
SELECT "Award" FROM table_68098 WHERE "Film/Show" = 'east west 101' AND "Year" < '2009' AND "Group" = 'logie award'
wikisql
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...
13年10月30号到21年6月3号,患者07524990的苯巴比妥是怎样的
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_43877 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real )
What Country's Player scored 71-69-70-71=281?
SELECT "Country" FROM table_43877 WHERE "Score" = '71-69-70-71=281'
wikisql
CREATE TABLE table_name_87 ( time VARCHAR, country VARCHAR )
What did Denmark time at?
SELECT time FROM table_name_87 WHERE country = "denmark"
sql_create_context
CREATE TABLE order_items ( item_id number, order_item_status_code text, order_id number, product_id number, item_status_code text, item_delivered_datetime time, item_order_quantity text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, c...
Show the outcome code of mailshots along with the number of mailshots in each outcome code.
SELECT outcome_code, COUNT(*) FROM mailshot_customers GROUP BY outcome_code
spider
CREATE TABLE table_name_10 ( season VARCHAR, games VARCHAR, lost VARCHAR )
What's the season that had a lost of 9 with 72 games?
SELECT season FROM table_name_10 WHERE games = "72" AND lost = "9"
sql_create_context
CREATE TABLE Allergy_type ( allergytype VARCHAR )
Show all allergy types and the number of allergies in each type.
SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype
sql_create_context
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 was the total amount of po oral intake that patient 029-27704 had on 05/27/2105?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-27704')) AND intakeoutput.celllabel = 'po or...
eicu
CREATE TABLE table_name_34 ( track VARCHAR, catalogue VARCHAR )
Tell me the track that has the catalogue of apbo 0280
SELECT track FROM table_name_34 WHERE catalogue = "apbo 0280"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labi...
since 2101 how many patients were diagnosed with amphetamin depend-contin in the same month after the previous diagnosis of visceral aneurysm nec?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'amphetamin depend-...
mimic_iii
CREATE TABLE table_53414 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text )
Who holds third place in the tournament with a score of 2 6, 7 6(3), [10 5]?
SELECT "Third Place" FROM table_53414 WHERE "Score" = '2–6, 7–6(3), [10–5]'
wikisql
CREATE TABLE table_225095_4 ( reason_for_change VARCHAR, successor VARCHAR )
How many reasons for change were listed when Edward Hempstead was the successor?
SELECT COUNT(reason_for_change) FROM table_225095_4 WHERE successor = "Edward Hempstead"
sql_create_context
CREATE TABLE table_29107 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text )
Who directed series episode number 201?
SELECT "Director" FROM table_29107 WHERE "Series #" = '201'
wikisql
CREATE TABLE table_53975 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
For the Player from Brampton, ON what is their NBA Draft status?
SELECT "NBA Draft" FROM table_53975 WHERE "Hometown" = 'brampton, on'
wikisql
CREATE TABLE table_name_29 ( pos VARCHAR, driver VARCHAR )
What is Driver Brendan Gaughan's Pos?
SELECT pos FROM table_name_29 WHERE driver = "brendan gaughan"
sql_create_context
CREATE TABLE table_name_66 ( place VARCHAR, player VARCHAR )
What is Kirk Triplett's Place?
SELECT place FROM table_name_66 WHERE player = "kirk triplett"
sql_create_context
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE,...
Bin the settlement date for each settlement case into the day of week interval and count them for visualizing a bar chart.
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements
nvbench
CREATE TABLE table_name_13 ( simplified VARCHAR, density VARCHAR )
What shows for simplified when the density is 52?
SELECT simplified FROM table_name_13 WHERE density = "52"
sql_create_context
CREATE TABLE table_2508633_3 ( player VARCHAR, college VARCHAR )
Which player went to college at Tennessee?
SELECT player FROM table_2508633_3 WHERE college = "Tennessee"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) C...
what is the cost of flight DL 106 from PHILADELPHIA to BOSTON
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (((flight.airline_code = 'DL') AND flight.flight_number = 106) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' ...
atis
CREATE TABLE table_name_9 ( lost INTEGER, goals_against VARCHAR )
What are the lowest lost has 111 as the goals against?
SELECT MIN(lost) FROM table_name_9 WHERE goals_against = 111
sql_create_context
CREATE TABLE table_21676617_1 ( horse VARCHAR, year VARCHAR )
How many horses are mentioned competing in 1985?
SELECT COUNT(horse) FROM table_21676617_1 WHERE year = 1985
sql_create_context
CREATE TABLE table_34565 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall FHT points" text, "Overall WC points (Rank)" text )
Which Rank is the highest one that has Points smaller than 256.6?
SELECT MAX("Rank") FROM table_34565 WHERE "Points" < '256.6'
wikisql
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 of the patients admitted to emergency were on government insurance?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Government"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
Top 50 users from Iasi (Romania).
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, AboutMe, ProfileImageUrl FROM Users WHERE LOWER(Location) LIKE '%iasi%' ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE party ( party_name VARCHAR, party_id VARCHAR ) CREATE TABLE Member ( party_name VARCHAR, party_id VARCHAR )
Show names of parties that does not have any members.
SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member)
sql_create_context
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 lab test chart time is 2154-10-11 16:00:00?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2154-10-11 16:00:00"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
how many patients are below 64 years of age and administered in tp drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "64" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_73822 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
What is the population in (croatian: stari ednik)?
SELECT "Population (2011)" FROM table_73822 WHERE "Cyrillic Name Other Names" = 'Стари Жедник (Croatian: Stari Žednik)'
wikisql
CREATE TABLE table_204_160 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text )
from what country did the last place compete for ?
SELECT "nationality" FROM table_204_160 ORDER BY "rank" DESC LIMIT 1
squall
CREATE TABLE table_name_30 ( abb VARCHAR, disorder VARCHAR )
What is the abbreviation of the enzyme involved in carbamoyl phosphate synthetase i deficiency?
SELECT abb FROM table_name_30 WHERE disorder = "carbamoyl phosphate synthetase i deficiency"
sql_create_context
CREATE TABLE table_27439 ( "City" text, "Population" real, "Registered voters" text, "Democratic" text, "Republican" text, "D\u2013R spread" text, "Other" text, "No party preference" text )
What is the other is the city is Los Gatos?
SELECT "Other" FROM table_27439 WHERE "City" = 'Los Gatos'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, ...
what were the four most common specimen tests performed?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
what is the last ward for patient 74159 since 2105?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159) AND NOT transfers.wardid IS NULL AND STRFTIME('%y', transfers.intime) >= '2105' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_55932 ( "Club" text, "Position in 2012" text, "First season" text, "Number of seasons" real, "First season of current spell" real, "Titles" real, "Last title" text )
what is the position is 2012 when the last title is n/a and the first season is 2011?
SELECT "Position in 2012" FROM table_55932 WHERE "Last title" = 'n/a' AND "First season" = '2011'
wikisql
CREATE TABLE table_54644 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the grid total for david coulthard?
SELECT SUM("Grid") FROM table_54644 WHERE "Driver" = 'david coulthard'
wikisql
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, ...
Bar chart of mean age from each city code, I want to list by the total number in ascending.
SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age)
nvbench
CREATE TABLE table_dev_4 ( "id" int, "hypothyroidism" bool, "serum_bicarbonate" int, "c_peptide_level" float, "autoimmune_disease" bool, "hemoglobin_a1c_hba1c" float, "positive_serum" bool, "inhaled_steroids" bool, "diabetic_ketoacidosis" bool, "creatinine_clearance_cl" float, ...
c _ peptide < 1 ng / ml;
SELECT * FROM table_dev_4 WHERE c_peptide_level < 1
criteria2sql
CREATE TABLE table_36744 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text )
When was the incumbent from the south carolina 1 district first elected?
SELECT "First elected" FROM table_36744 WHERE "District" = 'south carolina 1'
wikisql
CREATE TABLE table_name_51 ( avg_g VARCHAR, gain VARCHAR, long VARCHAR, loss VARCHAR )
How much Avg/G has a Long of 51, and a Loss of 333, and a Gain larger than 2013?
SELECT COUNT(avg_g) FROM table_name_51 WHERE long = 51 AND loss = 333 AND gain > 2013
sql_create_context
CREATE TABLE table_24494 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
Who is every vacator if date of successors formal installation is August 8, 1960?
SELECT "Vacator" FROM table_24494 WHERE "Date of successors formal installation" = 'August 8, 1960'
wikisql
CREATE TABLE table_43158 ( "Week" real, "Date" text, "Time ( PT )" text, "Opponent" text, "Result" text, "Record" text, "Game site" text )
What game site has w 10-3 as the result?
SELECT "Game site" FROM table_43158 WHERE "Result" = 'w 10-3'
wikisql
CREATE TABLE table_name_11 ( player VARCHAR, pba_team VARCHAR )
Who is the player with the PBA team of Barangay Ginebra Kings?
SELECT player FROM table_name_11 WHERE pba_team = "barangay ginebra kings"
sql_create_context
CREATE TABLE table_name_41 ( silver INTEGER, rank INTEGER )
What is the lowest number of silver owned by a nation that is not ranked number 1?
SELECT MIN(silver) FROM table_name_41 WHERE rank < 1
sql_create_context
CREATE TABLE table_name_54 ( birthdate VARCHAR, birthplace VARCHAR )
On what date was the player from Melrose, Massachusetts born?
SELECT birthdate FROM table_name_54 WHERE birthplace = "melrose, massachusetts"
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...
在05年2月3日到15年9月8日期间医院8966457的科室065收取的医疗费总额是多少?
SELECT SUM(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 = '8966457' AND t_kc24.t_kc21_MED_ORG_DEPT_CD = '065') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-02-03' AND '2015-09-08'
css
CREATE TABLE table_49815 ( "Date From" text, "Date To" text, "Pos." text, "Name" text, "Moving To" text )
What is Moving To, when Name is 'Leon Andreasen'?
SELECT "Moving To" FROM table_49815 WHERE "Name" = 'leon andreasen'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varcha...
could you please tell me the first flight leaving BALTIMORE to SAN FRANCISCO on a 747 on 8 27
SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, equipment_sequence, flight WHERE (((aircraft.basic_type = '747' AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 ...
atis
CREATE TABLE table_name_31 ( game VARCHAR, record VARCHAR )
Which game number includes a record of 1-2?
SELECT game FROM table_name_31 WHERE record = "1-2"
sql_create_context
CREATE TABLE table_24132054_1 ( directed_by VARCHAR, no_in_series VARCHAR )
Who directed episode 28 in the series?
SELECT directed_by FROM table_24132054_1 WHERE no_in_series = 28
sql_create_context
CREATE TABLE table_63388 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
What is the Romanji Title of a show on TBS with less than 11 episodes?
SELECT "Romaji Title" FROM table_63388 WHERE "TV Station" = 'tbs' AND "Episodes" < '11'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
what is procedure icd9 code of subject id 14755?
SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "14755"
mimicsql_data
CREATE TABLE table_name_13 ( director VARCHAR, producer VARCHAR )
What is the name of the director who directed the movie that Raintree Pictures produced?
SELECT director FROM table_name_13 WHERE producer = "raintree pictures"
sql_create_context
CREATE TABLE table_4181 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What are the championship venues where the score was 6 7 (4 7) , 3 6?
SELECT "Championship" FROM table_4181 WHERE "Score" = '6–7 (4–7) , 3–6'
wikisql
CREATE TABLE table_23120 ( "Fleet #" text, "Year" real, "Manufacture" text, "Model" text, "Length (ft)" real, "Engine" text, "Transmission" text )
Which year had a transmission of Voith D863.4 and a Cummins ISM engine?
SELECT "Year" FROM table_23120 WHERE "Transmission" = 'Voith D863.4' AND "Engine" = 'Cummins ISM'
wikisql
CREATE TABLE table_name_12 ( res VARCHAR, opponent VARCHAR )
What is the result of the match against Ryan Schultz?
SELECT res FROM table_name_12 WHERE opponent = "ryan schultz"
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...
give me the number of patients whose ethnicity is black/african american and primary disease is liver transplant?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.diagnosis = "LIVER TRANSPLANT"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose days of hospital stay is greater than 2 and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE Products ( Product_ID VARCHAR(100), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Product_Description VARCHAR(255), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Invoices ( Invoice_ID INTEGER, Order_ID INTEGER, payment_method_code CHAR(15), Product...
Which workshop groups have bookings with status code 'stop'? Give me the names, and count them by a bar chart, list bars from low to high order please.
SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY Store_Name
nvbench
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
What prerequisites for AEROSP 740 have I already fulfilled ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'AEROSP' AND COURSE_1.number ...
advising
CREATE TABLE table_14364 ( "Club" text, "Played" 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 )
Name the point with points for of 255
SELECT "Points" FROM table_14364 WHERE "Points for" = '255'
wikisql