context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_12 ( stadium VARCHAR, date VARCHAR )
What is the stadium when the date of the game is December 14?
SELECT stadium FROM table_name_12 WHERE date = "december 14"
sql_create_context
CREATE TABLE table_name_36 ( record VARCHAR, home VARCHAR )
What was the record when the team played at Oakland Seals?
SELECT record FROM table_name_36 WHERE home = "oakland seals"
sql_create_context
CREATE TABLE table_name_54 ( country VARCHAR, player VARCHAR )
What is Country, when Player is 'Dow Finsterwald'?
SELECT country FROM table_name_54 WHERE player = "dow finsterwald"
sql_create_context
CREATE TABLE table_name_76 ( rank INTEGER, lane VARCHAR, notes VARCHAR, time___sec__ VARCHAR )
What is the rank when time is 11.15 and lane is bigger than 7 with notes Q, PB?
SELECT SUM(rank) FROM table_name_76 WHERE notes = "q, pb" AND time___sec__ = 11.15 AND lane > 7
sql_create_context
CREATE TABLE table_6321 ( "Competition" text, "Played" real, "Blackpool" real, "Draw" real, "Preston North End" real )
Which Blackpool has a Preston North End smaller than 46, and a Competition of other, and a Draw larger than 1?
SELECT SUM("Blackpool") FROM table_6321 WHERE "Preston North End" < '46' AND "Competition" = 'other' AND "Draw" > '1'
wikisql
CREATE TABLE table_3573 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
How many production codes had a US viewership of 4.43 million?
SELECT COUNT("Production code") FROM table_3573 WHERE "U.S. viewers (millions)" = '4.43'
wikisql
CREATE TABLE table_59246 ( "County" text, "Precincts" text, "E. Greenberg" text, "G. Hager" text, "T. Wyka" text )
Which Precincts has a G. Hager of 2,260 (15%)?
SELECT "Precincts" FROM table_59246 WHERE "G. Hager" = '2,260 (15%)'
wikisql
CREATE TABLE table_54736 ( "Date" real, "Country" text, "Place" text, "Building" text, "Size" text )
Name the place with building of victoria hall
SELECT "Place" FROM table_54736 WHERE "Building" = 'victoria hall'
wikisql
CREATE TABLE table_46724 ( "Year" real, "Manufacturer" text, "Start" real, "Finish" real, "Team" text )
Which manufacturer was used after 1969 with a finish position of 34?
SELECT "Manufacturer" FROM table_46724 WHERE "Year" > '1969' AND "Finish" = '34'
wikisql
CREATE TABLE table_name_32 ( city_area_km_2__ INTEGER, district VARCHAR, city_population__2009_ VARCHAR )
What is the sum of the area for the bahawalnagar district with a population more than 134,936?
SELECT SUM(city_area_km_2__) FROM table_name_32 WHERE district = "bahawalnagar district" AND city_population__2009_ > 134 OFFSET 936
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
门诊就诊51309268056的治病结束时间是啥时候?
SELECT txmzjzjlb.JZJSSJ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '51309268056' UNION SELECT ftxmzjzjlb.JZJSSJ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '51309268056'
css
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...
how many patients below 50 years of age have procedure icd9 code 4131?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "50" AND procedures.icd9_code = "4131"
mimicsql_data
CREATE TABLE table_204_965 ( id number, "year" text, "city" text, "state, province, dept., etc." text, "country" text, "notes" text )
what is the difference in foundation date between cusco and motul ?
SELECT ABS((SELECT "year" FROM table_204_965 WHERE "city" = 'cusco') - (SELECT "year" FROM table_204_965 WHERE "city" = 'motul'))
squall
CREATE TABLE table_name_90 ( rounds VARCHAR, engine VARCHAR, chassis VARCHAR )
Name the round for engine of ford cosworth dfv 3.0 v8 with chassis fo 751
SELECT rounds FROM table_name_90 WHERE engine = "ford cosworth dfv 3.0 v8" AND chassis = "751"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, ...
Accept rate in a tag vs global accept rate per month.
SELECT YEAR(q.CreationDate) + MONTH(q.CreationDate) / 12.0 AS "m", ROUND(COUNT(q.AcceptedAnswerId) * 100.0 / COUNT(*), 2) AS "global_%_accepted", ROUND(COUNT(CASE WHEN NOT q.AcceptedAnswerId IS NULL AND q.Tags LIKE '%##Tag##%' THEN 1 ELSE NULL END) * 100.0 / NULLIF(COUNT(CASE WHEN q.Tags LIKE '%##Tag##%' THEN 1 ELSE NU...
sede
CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, engineer_id INTEGER, fault_log_entry_id INTEGE...
A bar chart listing the number of faults for different description of skills required to fix them, rank y axis from high to low order.
SELECT skill_description, COUNT(skill_description) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description ORDER BY COUNT(skill_description) DESC
nvbench
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Visualize a bar chart about the distribution of name and ID , and sort from high to low by the Y-axis.
SELECT name, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
Number of users by age.
SELECT Age, COUNT(17) FROM Users GROUP BY Age ORDER BY Age
sede
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
What is the average age for all person?
SELECT AVG(age) FROM person
spider
CREATE TABLE table_14903627_1 ( mens_doubles VARCHAR, womens_doubles VARCHAR )
WHAT IS THE NAME OF THE MENS DOUBLES PLAYER WHEN THE WOMENS DOUBLES PLAYER IS HELEN REINO KAI-RIIN SALUSTE?
SELECT mens_doubles FROM table_14903627_1 WHERE womens_doubles = "Helen Reino Kai-Riin Saluste"
sql_create_context
CREATE TABLE table_41262 ( "Year" text, "Dates" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winner's share ($)" real )
What Year was the United States the country for aug 3 5?
SELECT "Year" FROM table_41262 WHERE "Country" = 'united states' AND "Dates" = 'aug 3–5'
wikisql
CREATE TABLE table_1439045_5 ( die_size__mm_2___ VARCHAR, model VARCHAR )
What is the die size(mm 2) for model sgx531?
SELECT die_size__mm_2___ AS "1" FROM table_1439045_5 WHERE model = "SGX531"
sql_create_context
CREATE TABLE table_26067 ( "Place came" text, "Artist" text, "Category" text, "Act" text, "Semi-final" text, "Result" text )
During the act, Performance of 'Lost' by Anouk, what was the result?
SELECT COUNT("Result") FROM table_26067 WHERE "Act" = 'Performance of "Lost" by Anouk'
wikisql
CREATE TABLE fgwyjzb ( 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, ...
查一下17172279这个病人在医院7202022的就诊记录中,给他开出的药品中哪个药的单价是最高的?药品的编号和名称及其单价分别是啥
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '17172279' AND gwyjzb.MED_SER_ORG_NO = '7202022' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '17172279' AND fg...
css
CREATE TABLE table_60171 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is the weight of Damir Buri ?
SELECT "Weight" FROM table_60171 WHERE "Name" = 'damir burić'
wikisql
CREATE TABLE table_name_96 ( teams VARCHAR, away VARCHAR )
What teams has 1-5 as the away?
SELECT teams FROM table_name_96 WHERE away = "1-5"
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...
what is primary disease and diagnoses icd9 code of subject name josette orr?
SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Josette Orr"
mimicsql_data
CREATE TABLE table_43226 ( "Card" text, "Weight Class" text, "Round" real, "Time" text, "Method" text )
What is the smallest round for the welterweight class with a preliminary card?
SELECT MIN("Round") FROM table_43226 WHERE "Weight Class" = 'welterweight' AND "Card" = 'preliminary'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
孙和煦病患在号码是4311972的医院门诊中所诊断的名称含有脑血管病的门诊就诊记录列出来?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjz...
css
CREATE TABLE people ( name VARCHAR, people_id VARCHAR ) CREATE TABLE wedding ( male_id VARCHAR, female_id VARCHAR, year INTEGER )
Show the pair of male and female names in all weddings after year 2014
SELECT T2.name, T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014
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...
按照科室的名字不同、入院诊断的疾病编码不同看看医院5031026所有的就诊记录里患者平均是多大年纪
SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5031026' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5031026' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.IN_...
css
CREATE TABLE document_functional_areas ( document_code text, functional_area_code text ) CREATE TABLE roles ( role_code text, role_description text ) CREATE TABLE functional_areas ( functional_area_code text, parent_functional_area_code text, functional_area_description text ) CREATE TABL...
What are the average access counts of documents that have the functional area description 'Acknowledgement'?
SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgement"
spider
CREATE TABLE table_26642 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
What was the vacator for georgia 2nd?
SELECT "Vacator" FROM table_26642 WHERE "District" = 'Georgia 2nd'
wikisql
CREATE TABLE table_70586 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
What is the Engine used before 1983?
SELECT "Engine" FROM table_70586 WHERE "Year" < '1983'
wikisql
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 yearly minimum amount of ultrafiltrate ultrafiltrate that patient 20034 had until 12/21/2105?
SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20034)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ult...
mimic_iii
CREATE TABLE table_name_50 ( digital_analog_signal VARCHAR, chipset_based_on VARCHAR )
What is the Digital/analog signal with a Chipset based on with radeon 8500?
SELECT digital_analog_signal FROM table_name_50 WHERE chipset_based_on = "radeon 8500"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
when was the last time patient 030-44598 had a lab test, this month?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-44598')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T...
eicu
CREATE TABLE table_44929 ( "Season" text, "Club" text, "Country" text, "Apps." real, "Goals" real, "Assists" real )
what is the most assists when the goals is less than 0?
SELECT MAX("Assists") FROM table_44929 WHERE "Goals" < '0'
wikisql
CREATE TABLE table_63781 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the most bronze when the total is 9?
SELECT MAX("Bronze") FROM table_63781 WHERE "Total" = '9'
wikisql
CREATE TABLE table_23381 ( "Rank" real, "Dismissals" real, "Player" text, "Caught" real, "Stumped" real, "Matches" real, "Innings" real )
what is the highest number of dismissals in a match with 8 innings
SELECT COUNT("Dismissals") FROM table_23381 WHERE "Innings" = '8'
wikisql
CREATE TABLE table_25998 ( "Province" text, "Mahmoud Ahmadinejad" real, "Mehdi Karroubi" real, "Mir-Hossein Mousavi" real, "Mohsen Rezaee" real, "Spoiled ballots" real, "Total votes" real )
What is the highest score for candidate Mohsen Rezaee when candidate mir-hossein mousavi scored 837858 votes?
SELECT MAX("Mohsen Rezaee") FROM table_25998 WHERE "Mir-Hossein Mousavi" = '837858'
wikisql
CREATE TABLE table_28836 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text )
What date did series number 32 premiere?
SELECT "Original air date" FROM table_28836 WHERE "No. in series" = '32'
wikisql
CREATE TABLE table_204_886 ( id number, "rank" number, "swimmer" text, "country" text, "time" text, "note" text )
who was the last competitor to actually finish the preliminaries ?
SELECT "swimmer" FROM table_204_886 ORDER BY "rank" DESC LIMIT 1
squall
CREATE TABLE table_59700 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text, "Transfer fee" text, "Source" text )
WHAT TRANSFER FEE HAS A TYPE OF TRANSFER FOR DOS SANTOS?
SELECT "Transfer fee" FROM table_59700 WHERE "Type" = 'transfer' AND "Name" = 'dos santos'
wikisql
CREATE TABLE submission ( Author VARCHAR, College VARCHAR )
Show the names of authors from college 'Florida' or 'Temple
SELECT Author FROM submission WHERE College = "Florida" OR College = "Temple"
sql_create_context
CREATE TABLE table_26845 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" text, "Points won" real, "New points" real, "Status" text )
What player had 1420 points coming in?
SELECT "Player" FROM table_26845 WHERE "Points" = '1420'
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...
在00年1月17日直到11年5月4日这一段时间,病患云天干内所有检验结果指标记录中的仪器编号以及名称分别叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybg...
css
CREATE TABLE table_41695 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Which Wins has a Tournament of totals, and a Cuts made larger than 42?
SELECT AVG("Wins") FROM table_41695 WHERE "Tournament" = 'totals' AND "Cuts made" > '42'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
tell me the total amount of propofol that patient 022-78423 has taken since 11/29/2104?
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 = '022-78423')) AND intakeoutput.celllabel = 'propo...
eicu
CREATE TABLE table_47397 ( "Rank" real, "Rider" text, "Team" text, "Time" text, "Speed" text )
What time did rider steve plater have?
SELECT "Time" FROM table_47397 WHERE "Rider" = 'steve plater'
wikisql
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...
get me the difference between patient 1784's total volume of input and output since 05/20/2101.
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1784)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2101-05-20') - (SELE...
mimic_iii
CREATE TABLE table_30503 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
During the Big Seven Conference which team was the regular season winner?
SELECT "Regular Season Winner" FROM table_30503 WHERE "Conference" = 'Big Seven Conference'
wikisql
CREATE TABLE table_19462 ( "Rnd" real, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Report" text )
who is the the pole position with date being august 10
SELECT "Pole position" FROM table_19462 WHERE "Date" = 'August 10'
wikisql
CREATE TABLE table_name_8 ( points INTEGER, november VARCHAR )
What is the average points on November 6?
SELECT AVG(points) FROM table_name_8 WHERE november = 6
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
tell me the yearly maximum sao2 of patient 015-94542.
SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94542')) AND NOT vitalperiodic.sao2 IS NULL GROUP BY ...
eicu
CREATE TABLE table_1795 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
How many total reason for change are listed corresponding to the successor Leonard B. Jordan (r)?
SELECT COUNT("Reason for change") FROM table_1795 WHERE "Successor" = 'Leonard B. Jordan (R)'
wikisql
CREATE TABLE table_2889300_6 ( snare_pad VARCHAR, drumset_name VARCHAR )
for the drumset name td-15k how many snare pads are
SELECT COUNT(snare_pad) FROM table_2889300_6 WHERE drumset_name = "TD-15K"
sql_create_context
CREATE TABLE table_1404456_1 ( capital VARCHAR, population_census_2009 VARCHAR )
how many capital with population census 2009 being 284657
SELECT COUNT(capital) FROM table_1404456_1 WHERE population_census_2009 = 284657
sql_create_context
CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE channel ( channel_id number, name text, owner text, share_in_percent numb...
Find the names of channels that are not owned by CCTV.
SELECT name FROM channel WHERE owner <> 'CCTV'
spider
CREATE TABLE table_41926 ( "Round" text, "Opposition" text, "First leg" text, "Second leg" text, "Aggregate score" text )
What was the first leg score in the 2nd round?
SELECT "First leg" FROM table_41926 WHERE "Round" = '2nd'
wikisql
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE tak...
How many courses with more than one prerequisite for each title? Return a bar chart, show by the bar in desc.
SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title DESC
nvbench
CREATE TABLE table_64837 ( "Japanese Title" text, "English Title" text, "Year" real, "First publisher" text, "ISBN" text )
What is the Year of Kodansha Novels' Tokyo Nightmare?
SELECT "Year" FROM table_64837 WHERE "First publisher" = 'kodansha novels' AND "English Title" = 'tokyo nightmare'
wikisql
CREATE TABLE table_61660 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm"...
WHAT IS THE 4:30PM WITH 1:30PM LOCAL PROGRAMS?
SELECT "4:30 pm" FROM table_61660 WHERE "1:30 pm" = 'local programs'
wikisql
CREATE TABLE table_name_26 ( status VARCHAR, membership_application VARCHAR )
What is the status of the membership application on 2008-12-15?
SELECT status FROM table_name_26 WHERE membership_application = "2008-12-15"
sql_create_context
CREATE TABLE table_name_92 ( points INTEGER, chassis VARCHAR, year VARCHAR )
Name the least points with chassis of kurtis kraft 3000 and year before 1951
SELECT MIN(points) FROM table_name_92 WHERE chassis = "kurtis kraft 3000" AND year < 1951
sql_create_context
CREATE TABLE table_204_47 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents" text, "score" text )
has she won more doubles tournaments on clay or on hard ?
SELECT "surface" FROM table_204_47 WHERE "surface" IN ('clay', 'hard') GROUP BY "surface" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_204_501 ( id number, "institution" text, "location" text, "nickname" text, "founded" number, "type" text, "enrollment" number, "joined" number )
out of v hawks and mustangs , who has the least enrollment ?
SELECT "nickname" FROM table_204_501 WHERE "nickname" IN ('v-hawks', 'mustangs') ORDER BY "enrollment" LIMIT 1
squall
CREATE TABLE table_53279 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
If the home team scored 14.15 (99), who was the away team?
SELECT "Away team" FROM table_53279 WHERE "Home team score" = '14.15 (99)'
wikisql
CREATE TABLE table_45365 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
On what date was the result w 26 20?
SELECT "Date" FROM table_45365 WHERE "Result" = 'w 26–20'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code...
can you list costs of DENVER RENTAL CAR
SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE table_name_90 ( game_site VARCHAR, week VARCHAR )
Where did the Oakland Raiders play in week 12 of their 1976 season?
SELECT game_site FROM table_name_90 WHERE week = 12
sql_create_context
CREATE TABLE table_59228 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" text )
What year was the rank final of 6?
SELECT "Year" FROM table_59228 WHERE "Rank-Final" = '6'
wikisql
CREATE TABLE table_name_63 ( date VARCHAR, school VARCHAR )
What is the Date of the Player from Marshfield High School?
SELECT date FROM table_name_63 WHERE school = "marshfield high school"
sql_create_context
CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE el...
What are the names of the county that the delegates on 'Appropriations' committee belong to?
SELECT T1.county_name FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district WHERE T2.committee = "Appropriations"
spider
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 ) ...
how many patients discharged to snf had incision of aorta procedure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.short_title = "Incision of aorta"
mimicsql_data
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...
从零一年二月二十五日到零九年十月二十四日医疗机构7045795的统筹金额消耗最多的有哪11个科室?
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7045795' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-02-25' AND '2009-10-24' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 11 UNION SELECT fg...
css
CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, regi...
What is the number of branches that have more than the average number of memberships?
SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch)
spider
CREATE TABLE table_26470 ( "World record" text, "Hicham El Guerrouj ( MAR )" text, "3:26.00" text, "Rome , Italy" text, "14 July 1998" text )
What is the world record when 14 July 1998 is 13 August 1997?
SELECT "World record" FROM table_26470 WHERE "14 July 1998" = '13 August 1997'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
药品排序在团伙成员何欣欣最常开的中,有什么?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '何欣欣' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what was the difference in weight of patient 14987 second measured on the first hospital visit compared to the first value measured on the first hospital visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14987 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev...
mimic_iii
CREATE TABLE table_56886 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
How many laps had a grid number of 7?
SELECT SUM("Laps") FROM table_56886 WHERE "Grid" = '7'
wikisql
CREATE TABLE table_23284597_3 ( opponent_in_the_final VARCHAR, score_in_the_final VARCHAR )
Name the opponent in the final for 3 6, 1 6
SELECT opponent_in_the_final FROM table_23284597_3 WHERE score_in_the_final = "3–6, 1–6"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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...
患者92569406自二零零九年三月十六日开始,截止到二零一八年十一月二十五日,由哪几位医务人员为其检测指标591618的,查查这些医务人员的工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM ...
css
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...
查一下患者朱高翰在医院2154200中从二零年一月二十五日到二一年九月十五日的这段时间里开的所有的药和药品编码
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '朱高翰' AND t_kc22.t_kc21_MED_SER_ORG_NO = '2154200' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2020-01-25' AND '2021-09-15')
css
CREATE TABLE table_2315 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text )
How tall is the contestant from Guatemala?
SELECT "Height (cm)" FROM table_2315 WHERE "Country" = 'Guatemala'
wikisql
CREATE TABLE table_13213 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Total has Gold smaller than 12, and a Nation of hong kong (hkg)?
SELECT MAX("Total") FROM table_13213 WHERE "Gold" < '12' AND "Nation" = 'hong kong (hkg)'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
5 YEAR TREND FOR NON-EXPERTS.
SELECT * FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE CreationDate >= '20130101' AND CreationDate < '20130201' AND LastAccessDate >= '20190101' AND Reputation >= 551) AND PostTypeId = 1 AND CreationDate >= '20180101' AND CreationDate < '20190101' ORDER BY OwnerUserId, CreationDate
sede
CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name ...
Find the common login name of course authors and students.
SELECT login_name FROM course_authors_and_tutors INTERSECT SELECT login_name FROM students
spider
CREATE TABLE table_name_39 ( state VARCHAR, electorate VARCHAR )
In which state is the Petrie electorate?
SELECT state FROM table_name_39 WHERE electorate = "petrie"
sql_create_context
CREATE TABLE table_27604 ( "Team" text, "Played" real, "Won" real, "Lost" real, "No-Result" real, "Abandoned" real, "Bonus Points" real, "Total Points" real, "Net Run Rate" text )
How many wins did Canterbury Wizards have?
SELECT MAX("Won") FROM table_27604 WHERE "Team" = 'Canterbury Wizards'
wikisql
CREATE TABLE table_53633 ( "Manufacturer" text, "Type" text, "Quantity" real, "PTRD Nos." text, "GWR Nos." text )
What is the highest Quantity for PTRD Nos. 3, 15?
SELECT MAX("Quantity") FROM table_53633 WHERE "PTRD Nos." = '3, 15'
wikisql
CREATE TABLE table_17088 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
What player's hometown is Roebuck, South Carolina?
SELECT "Player" FROM table_17088 WHERE "Hometown" = 'Roebuck, South Carolina'
wikisql
CREATE TABLE table_32000 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" text )
Tell me the overall rank for roland schoeman
SELECT "Overall Rank" FROM table_32000 WHERE "Swimmer" = 'roland schoeman'
wikisql
CREATE TABLE table_53007 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the total of a crowd with an Away team score of 8.17 (65)?
SELECT SUM("Crowd") FROM table_53007 WHERE "Away team score" = '8.17 (65)'
wikisql
CREATE TABLE table_28338 ( "Country" text, "Exports" text, "Imports" text, "Total Trade" text, "Trade Balance" text )
In the country Switzerland, what is the total trade?
SELECT "Total Trade" FROM table_28338 WHERE "Country" = 'Switzerland'
wikisql
CREATE TABLE table_59817 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text )
What was the Attendance at Jobing.com Arena?
SELECT COUNT("Attendance") FROM table_59817 WHERE "Arena" = 'jobing.com arena'
wikisql
CREATE TABLE table_11251601_2 ( carbon_dioxide_emissions_per_year__10_6_tons___2006_ INTEGER, country VARCHAR )
HOW MANY TONS OF CO2 EMISSIONS DID RUSSIA PRODUCE IN 2006?
SELECT MAX(carbon_dioxide_emissions_per_year__10_6_tons___2006_) FROM table_11251601_2 WHERE country = "Russia"
sql_create_context
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 ) ...
provide the number of patients whose admission location is emergency room admit and procedure short title is percutan aspiration gb?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Percutan aspiration gb"
mimicsql_data
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 diagnoses long title is transient neonatal thrombocytopenia and drug type is additive?
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 = "Transient neonatal thrombocytopenia" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_79 ( class VARCHAR, frequency_mhz VARCHAR )
The frequency 89.3 belongs to what class?
SELECT class FROM table_name_79 WHERE frequency_mhz = 89.3
sql_create_context