context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_10294071_1 ( ties_played VARCHAR, total_w_l VARCHAR )
what is the total number of ties played where total w l is 38 24
SELECT COUNT(ties_played) FROM table_10294071_1 WHERE total_w_l = "38–24"
sql_create_context
CREATE TABLE table_12664 ( "Year(s)" real, "Final television commentator" text, "Radio commentator" text, "Spokesperson" text, "Semi-final television commentator" text, "Semi-final second television commentator" text )
What is the earliest year with colin berry as the spokesperson and ray moore as the radio commentator?
SELECT MIN("Year(s)") FROM table_12664 WHERE "Spokesperson" = 'colin berry' AND "Radio commentator" = 'ray moore'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
list the top three most common diagnoses this year?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '...
mimic_iii
CREATE TABLE table_name_88 ( season VARCHAR, finals VARCHAR )
Which Season has Finals of out of playoffs.?
SELECT season FROM table_name_88 WHERE finals = "out of playoffs."
sql_create_context
CREATE TABLE table_38347 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the result of the match on 3 March 2004?
SELECT "Result" FROM table_38347 WHERE "Date" = '3 march 2004'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
how many patients are with medicaid insurance and diagnosed with k.pneumoniae pneumonia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.short_title = "K. pneumoniae pneumonia"
mimicsql_data
CREATE TABLE table_32117 ( "Year" real, "Conference" text, "City" text, "Country" text, "Local Host(s)" text )
Who are the local hosts for the United States in years earlier than 2007?
SELECT "Local Host(s)" FROM table_32117 WHERE "Country" = 'united states' AND "Year" < '2007'
wikisql
CREATE TABLE table_17574 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
Is prothrombin time long when thromboplastin is prolonged?
SELECT "Prothrombin time" FROM table_17574 WHERE "Bleeding time" = 'Prolonged' AND "Partial thromboplastin time" = 'Prolonged'
wikisql
CREATE TABLE table_26957063_3 ( length__aa_ INTEGER, ncbi_accession_number VARCHAR )
What is the length (AA) of the animal whose NCBI accession number is CAM15594.1?
SELECT MIN(length__aa_) FROM table_26957063_3 WHERE ncbi_accession_number = "CAM15594.1"
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...
统计医疗记录中出院诊断为腔隙性脑梗死在医院4459052中的最低和最高医疗费总额各是多少钱?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '4459052' AND t_kc24.t_kc21_OUT_DIAG_DIS_NM = '腔隙性脑梗死')
css
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 procedures ( ...
For NEO*IV*Vancomycin, specify the type and route of drug administration.
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "NEO*IV*Vancomycin"
mimicsql_data
CREATE TABLE table_33061 ( "Year" text, "League" text, "Reg. Season" text, "Playoffs" text, "Attendance Average" text )
Which League showed 7,975 for an average attendance?
SELECT "League" FROM table_33061 WHERE "Attendance Average" = '7,975'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, Acc...
questions with only the statement tag.
SELECT Title, Tags FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '<statement>'
sede
CREATE TABLE table_2114308_1 ( broadcast_date VARCHAR, run_time VARCHAR )
Name the broadcast date of run time being 24:14
SELECT broadcast_date FROM table_2114308_1 WHERE run_time = "24:14"
sql_create_context
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 ...
门诊诊断的患者患有疾病J44.682的籍贯代码是多少以及名称叫什么和相应人数是多少?
SELECT hz_info.person_info_JGDM, hz_info.person_info_JGMC, COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDBM = 'J44.682' GROUP BY hz_info.person_info_JGDM
css
CREATE TABLE table_name_98 ( place VARCHAR, score VARCHAR )
In what place did the player with a score of 66-67=133 come in?
SELECT place FROM table_name_98 WHERE score = 66 - 67 = 133
sql_create_context
CREATE TABLE table_32862 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the largest crowd for any game where Footscray is the home team?
SELECT MAX("Crowd") FROM table_32862 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE table_79075 ( "Number" real, "Year Start" real, "Year End" real, "Name" text, "Home Club" text )
Which Number has a Name of hill, lucius t.?
SELECT MAX("Number") FROM table_79075 WHERE "Name" = 'hill, lucius t.'
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...
被门诊诊断为D87.114这个病的患者04324529,看看他的检测指标451191的结果定量及其单位
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 = 'D87.114' AND hz_info.RYB...
css
CREATE TABLE table_204_824 ( id number, "no." number, "train no:" text, "origin" text, "destination" text, "train name" text )
the number of passenger trains that left mangalore central is how many ?
SELECT COUNT(*) FROM table_204_824 WHERE "train name" = 'passenger'
squall
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) 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 ) ...
Show total number of id from each nationality
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality
nvbench
CREATE TABLE table_27192 ( "#" real, "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Rating" text, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" text, "Weekly Rank (#)" real )
How many timeslots received a rating of 5.7?
SELECT COUNT("Timeslot (EST)") FROM table_27192 WHERE "Rating" = '5.7'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
Number of questions by people with the Informed badge.
SELECT p.OwnerUserId AS Owner, p.Id AS "post_link", CASE WHEN NOT b.Id IS NULL THEN 1 ELSE 0 END AS Informed, CASE WHEN b.Id IS NULL THEN 1 ELSE 0 END AS Uninformed, p.Score, p.ViewCount AS Views FROM Posts AS p LEFT OUTER JOIN Badges AS b ON b.UserId = p.OwnerUserId AND b.Name = 'Informed' WHERE p.PostTypeId = 1 ORDER...
sede
CREATE TABLE table_626 ( "Tag ID" text, "Application" text, "Torque Rating" real, "1st" text, "2nd" text, "3rd" text, "4th" text, "5th" text, "6th" text, "Rev" text, "Input Splines" real, "Output Splines" real )
What is the rev for all of the Aston Martin applications?
SELECT "Rev" FROM table_626 WHERE "Application" = 'Aston Martin'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Number of 'Expert' Users By Year and Month.
SELECT COUNT(DisplayName), YEAR(CreationDate), MONTH(CreationDate) FROM Users WHERE Reputation >= 2000 GROUP BY YEAR(CreationDate), MONTH(CreationDate) ORDER BY YEAR(CreationDate), MONTH(CreationDate)
sede
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
A pie chart shows the proportion of All_Road and Team_ID.
SELECT All_Road, Team_ID FROM basketball_match
nvbench
CREATE TABLE table_19843 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
Where does team #55/#83 robby gordon motorsports rank in the top 10?
SELECT MAX("Top 10") FROM table_19843 WHERE "Team(s)" = '#55/#83 Robby Gordon Motorsports'
wikisql
CREATE TABLE qtb ( 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...
自02年4月10日起,到07年7月20日,医院7737144的哪些科室涉及的医疗费超过8492.85元
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7737144' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-04-10' AND '2007-07-20' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 8492.85 UNION SELECT gyb.MED_ORG_DEPT_CD FRO...
css
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_C...
Find the total number of hours have done for all students in each department Visualize by bar chart, could you list from high to low by the bars?
SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC
nvbench
CREATE TABLE table_204_107 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many european baseball championship gold medals does italy need in order to have the same total amount of any type of medal as netherlands ?
SELECT (SELECT "gold" FROM table_204_107 WHERE "nation" = 'netherlands') - (SELECT "gold" FROM table_204_107 WHERE "nation" = 'italy')
squall
CREATE TABLE table_16034882_2 ( games_played INTEGER )
What is the fewest number of games played?
SELECT MIN(games_played) FROM table_16034882_2
sql_create_context
CREATE TABLE table_66250 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Serial numbers" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
What manufacturer has a wheel arrangement of 4-6-6-4, and a Class of z-7?
SELECT "Manufacturer" FROM table_66250 WHERE "Wheel arrangement" = '4-6-6-4' AND "Class" = 'z-7'
wikisql
CREATE TABLE table_76954 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text )
What is Opponent, when Game is '37'?
SELECT "Opponent" FROM table_76954 WHERE "Game" = '37'
wikisql
CREATE TABLE table_name_29 ( writer_s_ VARCHAR, episode VARCHAR )
Which writer wrote episode 18-09 (652)?
SELECT writer_s_ FROM table_name_29 WHERE episode = "18-09 (652)"
sql_create_context
CREATE TABLE table_203_643 ( id number, "year" number, "award" text, "group" text, "result" text, "notes" text )
how many teen choice awards has he been nominated for ?
SELECT COUNT(*) FROM table_203_643 WHERE "award" = 'teen choice awards'
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and salary , and I want to rank by the X in asc.
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
64287856这个患者以前就诊的地方是哪里?
SELECT zzmzjzjlb.YLJGDM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '64287856' UNION SELECT fzzmzjzjlb.YLJGDM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AND hz_info.KH = fzzmzjzjlb.KH AND hz_i...
css
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...
CSV to rows and rows to CSV.
WITH data AS (SELECT o = 1, * FROM STRING_SPLIT('1,2,3', ',')) SELECT r = ROW_NUMBER() OVER (ORDER BY o), value FROM data
sede
CREATE TABLE table_203_136 ( id number, "year" number, "ibm model number" text, "name" text, "processor" text, "bus" text, "hd interface" text, "case" text, "notes" text )
which model was the first portable device ?
SELECT "ibm model number" FROM table_203_136 WHERE "case" = 'portable' ORDER BY id LIMIT 1
squall
CREATE TABLE table_14754 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original name" text, "Director" text )
What country is the film directed by Jean-Luc Godard in French from?
SELECT "Country" FROM table_14754 WHERE "Language" = 'french' AND "Director" = 'jean-luc godard'
wikisql
CREATE TABLE table_23248869_6 ( high_assists VARCHAR, team VARCHAR )
Who did the high assists in the game against Portland?
SELECT high_assists FROM table_23248869_6 WHERE team = "Portland"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
how many patients are diagnosed during this year with spinal stenosis nos?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'spinal stenosis nos') AND DATETIME(diagnoses_icd.charttime...
mimic_iii
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank i...
For each headquarter, what are the headquarter and how many companies are centered there Visualize by bar chart, and rank in asc by the x axis please.
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 ( EMPLO...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of last_name and employee_id , display LAST_NAME from high to low order.
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC
nvbench
CREATE TABLE table_name_23 ( record VARCHAR, date VARCHAR, event VARCHAR )
What is the record for the 400 m event on 4 september 2009?
SELECT record FROM table_name_23 WHERE date = "4 september 2009" AND event = "400 m"
sql_create_context
CREATE TABLE table_4768 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
Which report includes Bobby Unser as the Pole Position and Rick Mears as the Winning driver?
SELECT "Report" FROM table_4768 WHERE "Pole Position" = 'bobby unser' AND "Winning driver" = 'rick mears'
wikisql
CREATE TABLE table_30001 ( "Entry Date [A ]" text, "Single" text, "Artist" text, "Peak" real, "Peak Reached [A ]" text, "Weeks in top 10" real )
How long has the longest song spent in the top 10?
SELECT MAX("Weeks in top 10") FROM table_30001
wikisql
CREATE TABLE table_name_1 ( author VARCHAR, last_issue VARCHAR )
What is the Author of the Title with an Ongoing Last Issue?
SELECT author FROM table_name_1 WHERE last_issue = "ongoing"
sql_create_context
CREATE TABLE table_17230 ( "State" text, "Norwegian Americans (1980)" real, "Percent (1980)" text, "Norwegian Americans (1990)" real, "Percent (1990)" text, "Norwegian Americans (2000)" real, "Percent (2000)" text, "Norwegian Americans (2009)" real, "Percent (2009)" text )
what is the minimum norwegian americans (1980) where state is rhode island
SELECT MIN("Norwegian Americans (1980)") FROM table_17230 WHERE "State" = 'Rhode Island'
wikisql
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW tex...
检验结果指标记录19519716783是哪个审核人的,请提供审核人工号以及姓名
SELECT jyjgzbb.SHRGH, jyjgzbb.SHRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '19519716783'
css
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departu...
show me all the flights from PHILADELPHIA to CINCINNATI
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'C...
atis
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
how many times is nitroglycerin prescribed to patient 54825 since 3 years ago?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND prescriptions.drug = 'nitroglycerin' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
For each bed type, find the average base price of different bed type Show bar chart, rank X in ascending order.
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType
nvbench
CREATE TABLE table_54038 ( "Year" real, "Single" text, "Chart" text, "Position" real, "Weeks on chart" real )
What is the earliest year a song with a position less than 1 has?
SELECT MIN("Year") FROM table_54038 WHERE "Position" < '1'
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...
how many patients whose discharge location is snf and procedure icd9 code is 8960?
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.icd9_code = "8960"
mimicsql_data
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
has patient 83466 received any excise lg intestine les procedure in a year before?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'excise lg intestine les') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83466) AND DATETIME(pro...
mimic_iii
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
what was the name of the organism found during the first mini-bal microbiology examination of patient 31854 this month?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND microbiologyevents.spec_type_desc = 'mini-bal' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start ...
mimic_iii
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
last time, what drug was prescribed for patient 14671 in this month?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_3009 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
Name the reason for change when George W. Greene (D) was the vacator.
SELECT "Reason for change" FROM table_3009 WHERE "Vacator" = 'George W. Greene (D)'
wikisql
CREATE TABLE table_48298 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which To par has a Country of united states, and a Player of duffy waldorf?
SELECT "To par" FROM table_48298 WHERE "Country" = 'united states' AND "Player" = 'duffy waldorf'
wikisql
CREATE TABLE table_name_18 ( Local VARCHAR, local_location VARCHAR )
What is the local mission that has kingstown as a local location?
SELECT Local AS mission FROM table_name_18 WHERE local_location = "kingstown"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
Specify the number of patients with abdominal pain as their primary disease that were less than 59 years old.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "59"
mimicsql_data
CREATE TABLE table_28478 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text, "Nickname" text, "Primary Conference when joining the CSFL" text )
what was the primary conference when joining the csfl for the institution that joined in 2004-05?
SELECT "Primary Conference when joining the CSFL" FROM table_28478 WHERE "Joined" = '2004-05'
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_DIRE_CD text, MED_DIRE_NM text,...
这位患者00768748号在医院6769443出院时姓马的医生为其出院诊断出院结果是哪次?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '00768748' AND t_kc21.MED_SER_ORG_NO = '6769443' AND t_kc21.OUT_DIAG_DOC_NM LIKE '马%'
css
CREATE TABLE table_43803 ( "Release date" text, "Album title" text, "Record label" text, "Disc number" text, "Track number" text, "Title" text )
Which Album title has a Title of ?
SELECT "Album title" FROM table_43803 WHERE "Title" = '滑板'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title te...
among the patients of age 50s , what were the top five most frequent diagnoses?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_2786 ( "Release" text, "Oricon Albums Chart" text, "Peak Position" real, "Debut Sales (copies)" real, "Sales Total (copies)" real, "Chart Run" text )
Which charts had debut sales of 101976?
SELECT "Oricon Albums Chart" FROM table_2786 WHERE "Debut Sales (copies)" = '101976'
wikisql
CREATE TABLE table_name_91 ( finalist VARCHAR, week VARCHAR )
What is the finalist in the week of March 12?
SELECT finalist FROM table_name_91 WHERE week = "march 12"
sql_create_context
CREATE TABLE table_31316 ( "Year" text, "Conductor" text, "Opera House or Orchestra" text, "Label" text, "Countess" text, "Count" text, "Flamand" text, "Olivier" text, "La Roche" text, "Clairon" text )
When 1971 is the year what is the la roche?
SELECT "La Roche" FROM table_31316 WHERE "Year" = '1971'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
60963732这位患者在医疗就诊62213446252中自费金额最高的项目是哪个项目?
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 = '62213446252' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES...
css
CREATE TABLE table_18425346_2 ( city_area_km_2__ INTEGER )
What is the smallest city area?
SELECT MIN(city_area_km_2__) FROM table_18425346_2
sql_create_context
CREATE TABLE chip_model ( model_name text, launch_year number, ram_mib number, rom_mib number, slots text, wifi text, bluetooth text ) CREATE TABLE screen_mode ( graphics_mode number, char_cells text, pixels text, hardware_colours number, used_kb number, map text, ...
Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is 'LG-P760'.
SELECT T1.char_cells, T1.pixels, T1.hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.graphics_mode = T2.screen_mode WHERE T2.hardware_model_name = "LG-P760"
spider
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREAT...
What is the average age of male students in each city? Draw a bar chart, could you list in descending by the total number please?
SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY AVG(Age) DESC
nvbench
CREATE TABLE table_203_559 ( id number, "no." number, "name" text, "took office" text, "left office" text, "president served under" text, "notable for" text )
who became commissioner after george p. larrick ?
SELECT "name" FROM table_203_559 WHERE "took office" > (SELECT "took office" FROM table_203_559 WHERE "name" = 'george p. larrick') ORDER BY "took office" LIMIT 1
squall
CREATE TABLE table_73671 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
How many f/laps when he finished 8th?
SELECT MAX("F/Laps") FROM table_73671 WHERE "Position" = '8th'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
what was the top three most frequent microbiology tests ordered for patients in the same month after receiving a electrolyte administration until 2104?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'electrolyte administration' AND STRFTIME('%y...
eicu
CREATE TABLE table_61732 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Location" text )
What is the method when the location is Auckland, New Zealand, Darren Berry as the opponent, and resulted in a win?
SELECT "Method" FROM table_61732 WHERE "Location" = 'auckland, new zealand' AND "Result" = 'win' AND "Opponent" = 'darren berry'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Users with SOReadyToHelp Meta Posts.
SELECT DISTINCT P.OwnerUserId AS "user_link" FROM Posts AS P WHERE P.ParentId = 303988 OR P.ParentId = 303045 ORDER BY 'user_link' DESC
sede
CREATE TABLE table_name_84 ( crowd INTEGER, venue VARCHAR )
What is the average crowd size at Princes Park?
SELECT SUM(crowd) FROM table_name_84 WHERE venue = "princes park"
sql_create_context
CREATE TABLE table_25914 ( "Episode" text, "First broadcast" text, "Seans team" text, "Daves team" text, "Scores" text )
How many daves team entries are there on 27 october 2006?
SELECT COUNT("Daves team") FROM table_25914 WHERE "First broadcast" = '27 October 2006'
wikisql
CREATE TABLE table_40108 ( "Capacity" text, "Volts" text, "Temp." text, "Energy-to-weight ratio" text, "Power-to-weight ratio" text )
What is the capacity of 3500v volts?
SELECT "Capacity" FROM table_40108 WHERE "Volts" = '3500v'
wikisql
CREATE TABLE table_name_91 ( field_goals INTEGER, touchdowns VARCHAR, points VARCHAR )
How many field goals are there that have 8 touchdowns and more than 49 points?
SELECT SUM(field_goals) FROM table_name_91 WHERE touchdowns = 8 AND points > 49
sql_create_context
CREATE TABLE table_name_58 ( object_type VARCHAR, constellation VARCHAR )
Which Object type has a Constellation of cancer?
SELECT object_type FROM table_name_58 WHERE constellation = "cancer"
sql_create_context
CREATE TABLE table_name_31 ( out_of VARCHAR, year VARCHAR, source VARCHAR, rank VARCHAR )
Can you tell me the Out of that has the Source of united nations, and the Rank larger than 47, and the Year smaller than 2003?
SELECT out_of FROM table_name_31 WHERE source = "united nations" AND rank > 47 AND year < 2003
sql_create_context
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 prescription...
what is subject name and primary disease of subject id 7578?
SELECT demographic.name, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "7578"
mimicsql_data
CREATE TABLE table_19455 ( "Virtual" real, "Physical" real, "Call sign" text, "Branding" text, "Network" text, "Owner" text )
Name the owners for prairie public
SELECT COUNT("Owner") FROM table_19455 WHERE "Branding" = 'Prairie Public'
wikisql
CREATE TABLE table_51692 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
How many laps did John Love have on a grid less than 11?
SELECT "Laps" FROM table_51692 WHERE "Grid" < '11' AND "Driver" = 'john love'
wikisql
CREATE TABLE table_name_44 ( loss VARCHAR, opponent VARCHAR, record VARCHAR )
Name the less for opponent of @cle and record of 67-29
SELECT loss FROM table_name_44 WHERE opponent = "@cle" AND record = "67-29"
sql_create_context
CREATE TABLE table_53860 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the competition that took place on October 1, 1994?
SELECT "Competition" FROM table_53860 WHERE "Date" = 'october 1, 1994'
wikisql
CREATE TABLE table_name_96 ( player VARCHAR, place VARCHAR, score VARCHAR )
What T10 Place Player has a Score of 74-73-68=215?
SELECT player FROM table_name_96 WHERE place = "t10" AND score = 74 - 73 - 68 = 215
sql_create_context
CREATE TABLE table_15393 ( "Operator" text, "Shipyard" text, "Project" text, "Commissioned" text, "Status" text )
What is the commissioned for Vietnam?
SELECT "Commissioned" FROM table_15393 WHERE "Operator" = 'vietnam'
wikisql
CREATE TABLE table_name_21 ( venue VARCHAR, score VARCHAR, competition VARCHAR )
What is the name of the venue when the score was 5 0, and a Competition of 2007 caribbean cup qualifier?
SELECT venue FROM table_name_21 WHERE score = "5–0" AND competition = "2007 caribbean cup qualifier"
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description...
what kind of aircraft do you have flying from BOSTON to SAN FRANCISCO on 8 27
SELECT DISTINCT aircraft.aircraft_code 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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_numbe...
atis
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
how many patients have been admitted into a hospital during this year?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_33245 ( "Rank" text, "State" text, "Population" real, "Area (km\u00b2)" real, "Density" real )
Which population is the greatest, has a density of 20.3, and an area (km ) larger than 50,350?
SELECT MAX("Population") FROM table_33245 WHERE "Density" = '20.3' AND "Area (km\u00b2)" > '50,350'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, could you display by the Y in ascending?
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE prescribes ( physician number, patient number, medication number, date time, appointment number, dose text ) CREATE TABLE room ( roomnumber number,...
What are the names of patients who are not taking the medication of Procrastin-X.
SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN prescribes AS T2 ON T2.patient = T1.ssn JOIN medication AS T3 ON T2.medication = T3.code WHERE T3.name = 'Procrastin-X'
spider
CREATE TABLE table_name_55 ( total VARCHAR, national_university_of_ireland VARCHAR, labour_panel VARCHAR, administrative_panel VARCHAR )
Which Total has a Labour Panel smaller than 5, an Administrative Panel smaller than 1, and a National University of Ireland smaller than 2?
SELECT COUNT(total) FROM table_name_55 WHERE labour_panel < 5 AND administrative_panel < 1 AND national_university_of_ireland < 2
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
哪位医生是负责01742621044的出院诊断的,把医生的编码和名称找出来
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '01742621044'
css
CREATE TABLE table_49403 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Round" text )
What was the Score of the Semifinal 1?
SELECT "Score" FROM table_49403 WHERE "Round" = 'semifinal 1'
wikisql