context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_25737761_4 ( _number INTEGER, writer VARCHAR )
What episode number of the season did Tony Basgallop write?
SELECT MIN(_number) FROM table_25737761_4 WHERE writer = "Tony Basgallop"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text,...
indicate the monthly maximum amount of urine out void output that patient 26195 had had since 122 months ago.
SELECT MAX(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 = 26195)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri...
mimic_iii
CREATE TABLE table_name_79 ( attendance INTEGER, date VARCHAR )
What was the lowest attendance recorded at a game on September 28?
SELECT MIN(attendance) FROM table_name_79 WHERE date = "september 28"
sql_create_context
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABL...
icml papers in 2016 in deep learning
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'icml'
scholar
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 age and days of hospital stay of subject name jerry deberry?
SELECT demographic.age, demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
Get top users in Lithuania. Get top users by country
SELECT DISTINCT U.Reputation, U.Id AS "user_link" FROM Users AS U INNER JOIN Comments AS C ON C.UserId = U.Id INNER JOIN Posts AS P ON P.Id = C.PostId WHERE LOWER(U.Location) LIKE '%uruguay%' AND (P.Tags LIKE '%mvc%') ORDER BY U.Reputation DESC
sede
CREATE TABLE table_78504 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What driver has a grid greater than 19?
SELECT "Driver" FROM table_78504 WHERE "Grid" > '19'
wikisql
CREATE TABLE table_52453 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Tell me the team 2 for team 1 being la nuova piovese (veneto a)
SELECT "Team 2" FROM table_52453 WHERE "Team 1" = 'la nuova piovese (veneto a)'
wikisql
CREATE TABLE table_16105186_2 ( mid_atlantic_south__washington VARCHAR, _dc_ VARCHAR, alaska___juneau__ VARCHAR, california__san_francisco_ VARCHAR )
What was the emission rating in Mid-Atlantic South for the vehicle that was rated 90 g/mi (56 g/km) in Alaska and 110 g/mi (68 g/km) in California?
SELECT mid_atlantic_south__washington, _dc_ FROM table_16105186_2 WHERE alaska___juneau__ = "90 g/mi (56 g/km)" AND california__san_francisco_ = "110 g/mi (68 g/km)"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQ...
看一下住院就诊42136111810的出院状态如何?需要它的代码
SELECT wdmzjzjlb.CYZTDM FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '42136111810' UNION SELECT bdmzjzjlb.CYZTDM FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '42136111810'
css
CREATE TABLE table_50124 ( "Award" text, "Year" real, "Category" text, "Work" text, "Result" text )
How many times was the award inte awards?
SELECT COUNT("Year") FROM table_50124 WHERE "Award" = 'inte awards'
wikisql
CREATE TABLE table_name_88 ( actor_actress VARCHAR, tenure VARCHAR, character VARCHAR )
What Actor/Actress a Tenure of 2008 2011 played Stella Dagostino?
SELECT actor_actress FROM table_name_88 WHERE tenure = "2008–2011" AND character = "stella dagostino"
sql_create_context
CREATE TABLE table_10132 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did South Melbourne score when they were the Away team?
SELECT "Away team score" FROM table_10132 WHERE "Away team" = 'south melbourne'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int, paperid int...
how many papers did nicola dell and Brian DeRenzi write together
SELECT DISTINCT COUNT(1) FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'nicola dell' AND AUTHOR_1.authorname = 'Brian DeRenzi' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid
scholar
CREATE TABLE table_18115 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
Who was elected in 1972
SELECT "Incumbent" FROM table_18115 WHERE "First elected" = '1972'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
how many male patients have copd exacerbation as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "COPD EXACERBATION"
mimicsql_data
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE author ( authorid i...
keyphrases emina torlak used in papers written last year
SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, writes WHERE author.authorname = 'emina torlak' AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryT...
Number of non-deleted questions with answers per month.
WITH questionsWITHAnswerCount AS (SELECT p.Id, MAX(p.CreationDate) AS creationDate, COUNT(*) AS answers FROM Posts AS p INNER JOIN Posts AS a ON a.ParentId = p.Id AND a.PostTypeId = 2 WHERE p.PostTypeId = 1 GROUP BY p.Id) SELECT MIN(CreationDate), COUNT(*) AS "Questions WITH 1 or more answers" FROM questionsWITHAnswerC...
sede
CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating num...
What is the average song duration for the songs that are in mp3 format and whose resolution below 800?
SELECT AVG(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" AND T2.resolution < 800
spider
CREATE TABLE table_80113 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
Which team finished 3rd in class with 337 laps before 2008?
SELECT "Team" FROM table_80113 WHERE "Year" < '2008' AND "Laps" > '337' AND "Class Pos." = '3rd'
wikisql
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 ) ...
list the number of male patients born before 2098.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2098"
mimicsql_data
CREATE TABLE table_39562 ( "Role" text, "D'Oyly Carte 1920 Tour" text, "D'Oyly Carte 1930 Tour" text, "D'Oyly Carte 1939 Tour" text, "D'Oyly Carte 1945 Tour" text, "D'Oyly Carte 1950 Tour" text )
D'Oyly Carte 1920 Tour of hugh enes blackmore is what D'Oyly Carte 1930 Tour?
SELECT "D'Oyly Carte 1930 Tour" FROM table_39562 WHERE "D'Oyly Carte 1920 Tour" = 'hugh enes blackmore'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real )
Compare each editors' ages using a bar chart, sort by the Y-axis in descending please.
SELECT Name, Age FROM editor ORDER BY Age DESC
nvbench
CREATE TABLE table_name_41 ( brazil_scorers VARCHAR, score VARCHAR )
Who is the Brazil scorer who scored 6-0?
SELECT brazil_scorers FROM table_name_41 WHERE score = "6-0"
sql_create_context
CREATE TABLE table_name_77 ( date VARCHAR, partner VARCHAR )
On what Date was the match with partner Kira Nagy?
SELECT date FROM table_name_77 WHERE partner = "kira nagy"
sql_create_context
CREATE TABLE table_name_3 ( opponent VARCHAR, round VARCHAR, event VARCHAR )
Which Opponent has a Round larger than 1, and an Event of king of the cage 31?
SELECT opponent FROM table_name_3 WHERE round > 1 AND event = "king of the cage 31"
sql_create_context
CREATE TABLE table_name_92 ( team_2 VARCHAR )
What is the 2nd leg of team 2 Far rabat?
SELECT 2 AS nd_leg FROM table_name_92 WHERE team_2 = "far rabat"
sql_create_context
CREATE TABLE table_1557752_1 ( prothrombin_time VARCHAR, condition VARCHAR )
What is the prothrombin time in Von willebrand disease?
SELECT prothrombin_time FROM table_1557752_1 WHERE condition = "Von Willebrand disease"
sql_create_context
CREATE TABLE t_kc21 ( 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, ...
尤飞双这位患者在就诊期间购买的药物价格超了7155.47元的次数有几次?都对应了什么编号?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '尤飞双' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7155.47)
css
CREATE TABLE table_71913 ( "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What is Partner Tomas Behrend's Score in the final?
SELECT "Score in the final" FROM table_71913 WHERE "Partner" = 'tomas behrend'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number,...
count the number of patients who have received venous cath nec within 2 months after being diagnosed with acute kidney failure nos the previous year.
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 = 'acute kidney failu...
mimic_iii
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_...
List the name and the number of stations for all the cities that have at least 15 stations with a pie chart.
SELECT city, COUNT(*) FROM station GROUP BY city
nvbench
CREATE TABLE table_name_56 ( surface VARCHAR, date VARCHAR )
What was the surface in 1981?
SELECT surface FROM table_name_56 WHERE date = 1981
sql_create_context
CREATE TABLE table_7160 ( "Player" text, "League" real, "Malaysia Cup" real, "FA Cup" real, "Total" real )
What is the lowest FA cup that has mohd faizal desa as the player, with a total greater than 0?
SELECT MIN("FA Cup") FROM table_7160 WHERE "Player" = 'mohd faizal desa' AND "Total" > '0'
wikisql
CREATE TABLE table_name_88 ( result VARCHAR, award VARCHAR, category VARCHAR )
Which production won the drama desk award as well as the category of outstanding sound design?
SELECT result FROM table_name_88 WHERE award = "drama desk award" AND category = "outstanding sound design"
sql_create_context
CREATE TABLE table_42728 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What is the Margin of victory when rhys davies was runner-up?
SELECT "Margin of victory" FROM table_42728 WHERE "Runner(s)-up" = 'rhys davies'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
患者对应的门诊就诊中开出的检验报告单80578545144上的姓名是什么?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_44960 ( "Year" real, "E3 Harelbeke ( BEL )" text, "Gent\u2013Wevelgem ( BEL )" text, "Tour of Flanders ( BEL )" text, "Paris\u2013Roubaix ( FRA )" text )
Who won the Paris-Roubaix in 2006?
SELECT "Paris\u2013Roubaix ( FRA )" FROM table_44960 WHERE "Year" = '2006'
wikisql
CREATE TABLE table_40008 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real )
What is Name, when Spike is greater than 343, and when Date of Birth is 02.03.1973?
SELECT "Name" FROM table_40008 WHERE "Spike" > '343' AND "Date of Birth" = '02.03.1973'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
has there been any organism found in patient 65309's first urine,suprapubic aspirate microbiology test?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65309) AND microbiologyevents.spec_type_desc = 'urine,suprapubic aspirate' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiologyevents.charttime LIMIT 1
mimic_iii
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, ...
when did patient 3242 have a catheter tip-iv microbiology test for the first time in 01/2104?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3242) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2104-01' ORDER BY microbiologyev...
mimic_iii
CREATE TABLE table_52084 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where was the game played when the home team score was 11.9 (75)?
SELECT "Venue" FROM table_52084 WHERE "Home team score" = '11.9 (75)'
wikisql
CREATE TABLE table_name_56 ( album VARCHAR, release_info VARCHAR )
Which album had a release of heavenly (hvn95)?
SELECT album FROM table_name_56 WHERE release_info = "heavenly (hvn95)"
sql_create_context
CREATE TABLE table_name_69 ( position VARCHAR, venue VARCHAR, time VARCHAR )
What position has a time less than 40.2 at the rome venue?
SELECT position FROM table_name_69 WHERE venue = "rome" AND time < 40.2
sql_create_context
CREATE TABLE artwork ( artwork_id number, type text, name text ) CREATE TABLE festival_detail ( festival_id number, festival_name text, chair_name text, location text, year number, num_of_audience number ) CREATE TABLE nomination ( artwork_id number, festival_id number, ...
List the most common type of artworks.
SELECT type FROM artwork GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_30219 ( "Council" text, "TUV" real, "Democratic Unionist" real, "Ulster Unionist" real, "Alliance" real, "SDLP" real, "Sinn F\u00e9in" real, "Green (NI)" real, "Independent" real, "Others" text, "Total" real )
What is the SDLP of Belfast?
SELECT MAX("SDLP") FROM table_30219 WHERE "Council" = 'Belfast'
wikisql
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
A bar chart about what are the memories and carriers of phones?, could you list in ascending by the y-axis?
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G)
nvbench
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
Bar chart of how many date of completion from each date of completion, could you order in desc by the Y please?
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_completion) DESC
nvbench
CREATE TABLE table_65374 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Which Qual 1 has a Qual 2 of 58.861?
SELECT "Qual 1" FROM table_65374 WHERE "Qual 2" = '58.861'
wikisql
CREATE TABLE table_name_51 ( bronze INTEGER, nation VARCHAR, total VARCHAR )
what is the least bronze when the nation is soviet union and the total is less than 11?
SELECT MIN(bronze) FROM table_name_51 WHERE nation = "soviet union" AND total < 11
sql_create_context
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_addr...
A line chart shows the trend of monthly_rental over date_address_from .
SELECT date_address_from, monthly_rental FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_79529 ( "Region" text, "Date" text, "Label" text, "Format(s)" text, "Catalog" text )
Which catalog value has a region of world?
SELECT "Catalog" FROM table_79529 WHERE "Region" = 'world'
wikisql
CREATE TABLE table_1341604_10 ( candidates VARCHAR, incumbent VARCHAR )
who is the the candidates with incumbent being don fuqua
SELECT candidates FROM table_1341604_10 WHERE incumbent = "Don Fuqua"
sql_create_context
CREATE TABLE table_2845 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the most rebounds when the team record was 15-27?
SELECT "High rebounds" FROM table_2845 WHERE "Record" = '15-27'
wikisql
CREATE TABLE table_39632 ( "Score" text, "Opposition" text, "Venue" text, "City" text, "Year" real )
What score has Leicestershire as the opponent after 1906?
SELECT "Score" FROM table_39632 WHERE "Opposition" = 'leicestershire' AND "Year" > '1906'
wikisql
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...
有哪些人的医疗费总额与医疗就诊82639761234的完全相同?它们的医疗就诊记录的ID、人员姓名、公民身份号码、人员ID、人员性别、人员年龄都是啥呢?
SELECT qtb.MED_CLINIC_ID, qtb.PERSON_ID, qtb.PERSON_NM, qtb.IDENTITY_CARD, qtb.PERSON_SEX, qtb.PERSON_AGE FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '82639761234') UNION SELECT gyb.MED_CLINIC_ID, gyb.PERSON_...
css
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 days have passed since patient 006-133605 was given the procedure for the first time during their current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605...
eicu
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 procedure long title is hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_name_14 ( draw INTEGER, match VARCHAR, lost VARCHAR, team VARCHAR )
What is the average draw that has a lost less than 4, gwardia bydgoszcz as the team, with a match greater than 5?
SELECT AVG(draw) FROM table_name_14 WHERE lost < 4 AND team = "gwardia bydgoszcz" AND match > 5
sql_create_context
CREATE TABLE table_60283 ( "Year" real, "Date (Opening)" text, "Date (Closing)" text, "Opening Film" text, "Number of Screening" text )
What is Date (Opening), when Year is less than 2010, and when Date (Closing) is 'September 28'?
SELECT "Date (Opening)" FROM table_60283 WHERE "Year" < '2010' AND "Date (Closing)" = 'september 28'
wikisql
CREATE TABLE table_41572 ( "Engine type" text, "Scenario" text, "SFC in lb/(lbf\u00b7h)" real, "SFC in g/(kN\u00b7s)" real, "Specific impulse (s)" real, "Effective exhaust velocity (m/s)" real )
What is the highest SFC in g/(kN*s) for Rolls-Royce/Snecma Olympus 593 engines and SFCs under 1.195 lb/(lbf*h)?
SELECT MAX("SFC in g/(kN\u00b7s)") FROM table_41572 WHERE "Engine type" = 'rolls-royce/snecma olympus 593' AND "SFC in lb/(lbf\u00b7h)" < '1.195'
wikisql
CREATE TABLE table_train_5 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "protein_c" int, "liver_disease" bool, "chronic_respiratory_disease" bool, "child_pugh_score" int, "septic_shock" bool, "myocardial_infarction" bool, "NOUSE" float )
pregnancy
SELECT * FROM table_train_5 WHERE pregnancy_or_lactation = 1
criteria2sql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose gender is m and procedure icd9 code is 93?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "93"
mimicsql_data
CREATE TABLE table_61621 ( "Date" text, "Teams" text, "Score" text, "Team" text, "Venue" text )
What day was the score 1-0?
SELECT "Date" FROM table_61621 WHERE "Score" = '1-0'
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...
列出编号82401531269的医疗就诊中,所有开出的药品里定价上限金额不低于1503.26的那些药品
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '82401531269' AND t_kc22.UP_LIMIT_AMO > 1503.26
css
CREATE TABLE table_68643 ( "Year" real, "Song" text, "Film" text, "Music director(s)" text, "Lyricist" text )
Who wrote the lyrics for Mukti?
SELECT "Lyricist" FROM table_68643 WHERE "Film" = 'mukti'
wikisql
CREATE TABLE table_13512105_3 ( winning_team VARCHAR, winning_driver VARCHAR, fastest_lap VARCHAR )
which brand have drivers who won with the names of ryan briscoe and tomas scheckter
SELECT winning_team FROM table_13512105_3 WHERE winning_driver = "Ryan Briscoe" AND fastest_lap = "Tomas Scheckter"
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...
what is the total number of patients with mrsa septicemia who had a lab test for blood gas
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 = "MRSA septicemia" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d...
what is the percentile of 26.5 in a hematocrit lab test given the same age of patient 4495 during their first hospital visit?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.ag...
mimic_iii
CREATE TABLE table_45245 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text )
Which Poles have a position of 4th?
SELECT "Poles" FROM table_45245 WHERE "Position" = '4th'
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...
把2015年3月28日到2019年7月23日期间患者邹正初在0625386的医疗机构一共看检查过多少次查看一下
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '邹正初' AND t_kc22.STA_DATE BETWEEN '2015-03-28' AND '2019-07-23' AND t_kc22.t_kc21_MED_SER_ORG_NO = '0625386' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_53166 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
How many attended the game with weekes recording the decision?
SELECT "Attendance" FROM table_53166 WHERE "Decision" = 'weekes'
wikisql
CREATE TABLE table_39646 ( "Outcome" text, "Date" real, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Which Score in the final has an Outcome of winner, and a Surface of hard (i)?
SELECT "Score in the final" FROM table_39646 WHERE "Outcome" = 'winner' AND "Surface" = 'hard (i)'
wikisql
CREATE TABLE table_name_37 ( avoirdupois_value VARCHAR, russian VARCHAR )
What Avoirdupois value has a Russian of ?
SELECT avoirdupois_value FROM table_name_37 WHERE russian = "берковец"
sql_create_context
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Give me the comparison about meter_100 over the meter_600 , I want to sort by the Y-axis from high to low.
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 DESC
nvbench
CREATE TABLE table_79831 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What is the lowest amount of goals scored that has more than 19 goal conceded and played less than 18?
SELECT MIN("Goals Scored") FROM table_79831 WHERE "Goals Conceded" > '19' AND "Played" < '18'
wikisql
CREATE TABLE table_44575 ( "Skip" text, "Third" text, "Second" text, "Lead" text, "City" text )
WHAT IS TEH SECOND WITH REGINA AS CITY AND SKIP OF MICHELLE ENGLOT?
SELECT "Second" FROM table_44575 WHERE "City" = 'regina' AND "Skip" = 'michelle englot'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
how many days has it passed since the first time patient 027-120575 had a neurosurgery procedure during the current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120575...
eicu
CREATE TABLE table_45383 ( "Stop no." text, "Platform" text, "Line" text, "Stopping pattern" text, "Destination" text )
Which Line has a Platform of 3?
SELECT "Line" FROM table_45383 WHERE "Platform" = '3'
wikisql
CREATE TABLE table_19112_3 ( market_value__billion_$_ VARCHAR, company VARCHAR )
Name the market value for rhb capital
SELECT market_value__billion_$_ FROM table_19112_3 WHERE company = "RHB Capital"
sql_create_context
CREATE TABLE table_72047 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which score has a Record of 44-49?
SELECT "Score" FROM table_72047 WHERE "Record" = '44-49'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
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, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time by a bar chart.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_26 ( new_zealand_kennel_club_toy_group VARCHAR, australian_national_kennel_council_toy_dogs_group VARCHAR )
What is the New Zealand Kennel Club Toy Group with papillon as the Australian National Kennel Council Toy Dogs Group breed?
SELECT new_zealand_kennel_club_toy_group FROM table_name_26 WHERE australian_national_kennel_council_toy_dogs_group = "papillon"
sql_create_context
CREATE TABLE gyb ( CLINIC_ID 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, INSU_TYPE text, IN...
孙文心病患在一三年八月十二日到一八年六月十一日内期间主要看哪位医生?
SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '孙文心' AND qtb.IN_HOSP_DATE BETWEEN '2013-08-12' AND '2018-06-11' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '孙文心' AND gyb.IN_HOSP_DATE BETW...
css
CREATE TABLE table_5806 ( "Date" text, "Venue" text, "Opponent" text, "Score" text, "Competition" text )
What is the score for the game against Malacca at the Klfa Stadium, Cheras?
SELECT "Score" FROM table_5806 WHERE "Opponent" = 'malacca' AND "Venue" = 'klfa stadium, cheras'
wikisql
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...
get me the number of patients born before the year 2200 who had other bronchoscopy procedure.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2200" AND procedures.long_title = "Other bronchoscopy"
mimicsql_data
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 cost ( costid number, ...
count the number of patients who received a antiarrhythmics - class iii antiarrhythmic procedure during the same month after they have been diagnosed with signs and symptoms of sepsis (sirs) a year before.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'signs and symptoms of sepsis (sirs)' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRE...
eicu
CREATE TABLE table_59451 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What tournament had an opponent of Els Callens Nancy Feber?
SELECT "Tournament" FROM table_59451 WHERE "Opponents in the final" = 'els callens nancy feber'
wikisql
CREATE TABLE table_53944 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which driver has a Time/Retired of 2:45:46.2?
SELECT "Driver" FROM table_53944 WHERE "Time/Retired" = '2:45:46.2'
wikisql
CREATE TABLE table_19744915_17 ( rank INTEGER, vote_percentage VARCHAR )
If the vote percentage is 2.111%, what was the minimum rank?
SELECT MIN(rank) FROM table_19744915_17 WHERE vote_percentage = "2.111%"
sql_create_context
CREATE TABLE table_10015132_16 ( school_club_team VARCHAR, years_in_toronto VARCHAR )
which club was in toronto 2003-06
SELECT school_club_team FROM table_10015132_16 WHERE years_in_toronto = "2003-06"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在两千年三月二号到零九年九月十三号期间,04270747这名患者在医院7760452被开的所有的药的编号和药物名称都列一下
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '04270747' AND gwyjzb.MED_SER_ORG_NO = '7760452' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-03-02' AND '2009-09-13' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb...
css
CREATE TABLE table_31279 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
In what week was the first game played?
SELECT MIN("Week") FROM table_31279
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
provide the number of patients born before 2121 who had delta lab test status.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_58622 ( "Polling Firm" text, "Polling Dates" text, "Bob Chiarelli" text, "Alex Munter" text, "Larry O'Brien" text, "Terry Kilrea (dropped out)" text )
What are the polling dates for polling firm Holinshed when Terry Kilrea dropped out and Bob Chiarelli has 22.5%?
SELECT "Terry Kilrea (dropped out)" FROM table_58622 WHERE "Polling Firm" = 'holinshed' AND "Bob Chiarelli" = '22.5%'
wikisql
CREATE TABLE table_61698 ( "Goalkeeper" text, "Goals" real, "Matches" real, "Average" real, "Team" text )
What is the total of Matches with Goals of 18, and an Average larger than 0.55?
SELECT SUM("Matches") FROM table_61698 WHERE "Goals" = '18' AND "Average" > '0.55'
wikisql
CREATE TABLE table_28727 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. air date" text, "Production code" text, "U.S. viewers (million)" text )
What is the title of the episode directed by Christopher Petry with the production cod 3x6006?
SELECT "Title" FROM table_28727 WHERE "Directed by" = 'Christopher Petry' AND "Production code" = '3X6006'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients whose discharge location is home health care and procedure short title is fiber-optic bronchoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Fiber-optic bronchoscopy"
mimicsql_data
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 ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE STUDENT...
Find the number of students who took some course and got A or C and group by last name in a bar chart, show by the y-axis from low to high.
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 COUNT(STU_LNAME)
nvbench
CREATE TABLE table_4147 ( "Couple" text, "Week 1" real, "Week 2" real, "Week 3" real, "Week 4" text, "Week 5" text, "Week 6" text, "Week 7" text, "Week 8 Final" text )
How many week 2 scores have a week 7 score of 40 + 40 = 80?
SELECT COUNT("Week 2") FROM table_4147 WHERE "Week 7" = '40 + 40 = 80'
wikisql