context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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, ...
Pundit Progress With Future Outlook.
SELECT Id AS "comment_link", Score, CreationDate FROM Comments WHERE (UserId = @UserId AND Score >= 3) ORDER BY Score DESC
sede
CREATE TABLE table_name_77 ( height_in_ft VARCHAR, no_s_ VARCHAR )
What is the height in feet of number 10?
SELECT height_in_ft FROM table_name_77 WHERE no_s_ = "10"
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...
How many Black/Cape Verdean patients were given the drug bumetanide?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "Bumetanide"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
what is subject name and age of subject id 2560?
SELECT demographic.name, demographic.age FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_1214035_1 ( open_cup VARCHAR, year VARCHAR )
What open cups where played in 2002
SELECT open_cup FROM table_1214035_1 WHERE year = 2002
sql_create_context
CREATE TABLE table_78192 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the away team scored 11.12 (78), what was the date of the game?
SELECT "Date" FROM table_78192 WHERE "Away team score" = '11.12 (78)'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TAB...
StackOverflow Users filtered by Location sorted by Reputation.
SELECT Id, Reputation, DisplayName, Location, LastAccessDate, Views FROM Users WHERE Location LIKE '%##Location##%' ORDER BY Reputation DESC
sede
CREATE TABLE table_20987 ( "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 )
name the top 5 where the winnings is $52,595
SELECT "Top 5" FROM table_20987 WHERE "Winnings" = '$52,595'
wikisql
CREATE TABLE table_name_36 ( total VARCHAR )
What was the 2009 value for a total over 1 and 4th on 2010?
SELECT 2009 FROM table_name_36 WHERE total > 1 AND 2010 = "4th"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
在2005年8月29日到2007年4月15日之间名叫施博雅参保人员门诊手术费要多少钱?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '施博雅' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-08-29' AND '2007-04-15' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE table_23397386_2 ( viewers__millions_ VARCHAR, rating VARCHAR )
How many million viewers watched the episode that had a 2.6/7 rating/share (18-49)
SELECT viewers__millions_ FROM table_23397386_2 WHERE rating / SHARE(18 AS –49) = 2.6 / 7
sql_create_context
CREATE TABLE table_13179 ( "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, "4:30 pm" text, "5:00 pm" text, "6:30 pm"...
What is the 3pm program when Local Programs are on at 7:30am?
SELECT "3:00 pm" FROM table_13179 WHERE "7:30 am" = 'local programs'
wikisql
CREATE TABLE table_61905 ( "Player" text, "Height" real, "Position" text, "Year born (Age)" text, "Current Club" text )
What current club has a Height of 1.96?
SELECT "Current Club" FROM table_61905 WHERE "Height" = '1.96'
wikisql
CREATE TABLE table_name_87 ( byes INTEGER, lexton_plains VARCHAR )
Which Byes have a Lexton Plains of skipton?
SELECT MAX(byes) FROM table_name_87 WHERE lexton_plains = "skipton"
sql_create_context
CREATE TABLE table_name_69 ( position VARCHAR, player VARCHAR )
What is the position of Tayshaun Prince?
SELECT position FROM table_name_69 WHERE player = "tayshaun prince"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
小儿妇科内分泌因疾病Z32.698在2003年1月9日至2004年4月18日内住院的平均花费是多少?
SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '小儿妇科内分泌' AND IN_HOSP_DATE BETWEEN '2003-01-09' AND '2004-04-18' AND IN_DIAG_DIS_CD = 'Z32.698' AND CLINIC_TYPE = '住院'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
what is the average hospital cost that involves the procedure known as vascular surgery consultation in this year?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'vascular surgery consultation')) AND DATETIM...
eicu
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
列出在医院0779082中患者郑家美名称包含注意的门诊诊断有什么门诊就诊记录?
SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '郑家美' AND hz_info.YLJGDM = '0779082' AND txmzjzjlb.JZZDSM LIKE '%注意%' UNION SELECT * FROM person_info JOIN h...
css
CREATE TABLE table_name_31 ( top_25 INTEGER, events INTEGER )
Name the averae top 25 with events less than 0
SELECT AVG(top_25) FROM table_name_31 WHERE events < 0
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCAT...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by time, could you list by the Y in asc please?
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE table_74040 ( "Model" text, "Launch" text, "Model Number" text, "Code name" text, "Fab ( nm )" real, "Bus interface" text, "Memory ( MiB )" text, "Core ( MHz )" text, "Memory ( MHz )" text, "Config core 1" text, "Pixel ( GP /s)" text, "Texture ( GT /s)" text,...
What is the config core 1 of the model with a processing power GFLOPs of 432?
SELECT "Config core 1" FROM table_74040 WHERE "Processing Power GFLOPs" = '432'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Show me a bar chart for what are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?, and sort from low to high by the Y-axis please.
SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY SUM(Enrollment)
nvbench
CREATE TABLE table_58803 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text )
What was the result of the game that was attended by 80,886 people?
SELECT "Result" FROM table_58803 WHERE "Attendance" = '80,886'
wikisql
CREATE TABLE table_42244 ( "City" text, "Province" text, "Country" text, "IATA" text, "Airport" text )
Which airport's IATA is pen?
SELECT "Airport" FROM table_42244 WHERE "IATA" = 'pen'
wikisql
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
where is the best american restaurant in the bay area ?
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
restaurants
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 ) ...
what is the minimum age of patients whose admission type is urgent and year of birth is after 2087?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2087"
mimicsql_data
CREATE TABLE table_203_206 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what country won the largest number of gold medals ?
SELECT "nation" FROM table_203_206 ORDER BY "gold" DESC LIMIT 1
squall
CREATE TABLE table_18600760_15 ( township VARCHAR, land___sqmi__ VARCHAR )
Which township is 35.766 sqmi?
SELECT township FROM table_18600760_15 WHERE land___sqmi__ = "35.766"
sql_create_context
CREATE TABLE table_204_593 ( id number, "year" text, "chairperson" text )
for how many consecutive years was challa narasimha naidu the chairperson ?
SELECT "year" - "year" FROM table_204_593 WHERE "chairperson" = 'challanarasimhanaidu'
squall
CREATE TABLE table_name_40 ( pick INTEGER, position VARCHAR, overall VARCHAR )
WHAT IS THE PICK WITH K POSITION AND OVERALL SMALLER THAN 181?
SELECT SUM(pick) FROM table_name_40 WHERE position = "k" AND overall < 181
sql_create_context
CREATE TABLE table_name_29 ( host VARCHAR, ratings VARCHAR )
Who was the host that garnered ratings of 9.4/27?
SELECT host FROM table_name_29 WHERE ratings = "9.4/27"
sql_create_context
CREATE TABLE table_204_321 ( id number, "community" text, "currency" text, "region" text, "target date" number, "notes" text )
which one has the latest target date ?
SELECT "community" FROM table_204_321 ORDER BY "target date" DESC LIMIT 1
squall
CREATE TABLE table_68804 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Which stadium hosted the November 20 game?
SELECT "Stadium" FROM table_68804 WHERE "Date" = 'november 20'
wikisql
CREATE TABLE table_12239 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text )
What ship has a norway nationality?
SELECT "Ship" FROM table_12239 WHERE "Nationality" = 'norway'
wikisql
CREATE TABLE table_204_622 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
which 4x400 was faster , 2005 or 2003 ?
SELECT "year" FROM table_204_622 WHERE "year" IN (2005, 2003) ORDER BY "notes" LIMIT 1
squall
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, ...
count the number of patients whose item id is 51256 and lab test abnormal status is delta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51256" AND lab.flag = "delta"
mimicsql_data
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 mzjzjlb ( HXPLC number, HZXM ...
哪些工号及姓名的医务人员在患者沈云梦就诊过程中为他检测地高辛的,时间是从0二年二月六日到0四年五月十二日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB W...
css
CREATE TABLE table_41297 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Score, when the Country is United States, when the Place is T3, and when the Player is Chris Riley?
SELECT "Score" FROM table_41297 WHERE "Country" = 'united states' AND "Place" = 't3' AND "Player" = 'chris riley'
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...
provide the number of patients whose diagnoses short title is late effect injury nos and drug route is po/ng?
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.short_title = "Late effect injury NOS" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_name_76 ( played VARCHAR, drawn VARCHAR, tries_for VARCHAR )
Who was the player that had drawn 1 and tried for 20?
SELECT played FROM table_name_76 WHERE drawn = "1" AND tries_for = "20"
sql_create_context
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
For those ships that do not have a captain, tell me the total number of their classes using a pie chart, and rank in desc by the y-axis.
SELECT Class, COUNT(Class) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain) GROUP BY Class ORDER BY COUNT(Class) DESC
nvbench
CREATE TABLE table_73481 ( "#" real, "Name" text, "Country" text, "1" real, "2" real, "3" real, "Other placings" real, "Total" real, "First appearance" real, "Last appearance" real, "Federation" text )
What countries does the Rock come from?
SELECT COUNT("Country") FROM table_73481 WHERE "Name" = 'The Rock'
wikisql
CREATE TABLE table_name_87 ( week VARCHAR, attendance VARCHAR )
How many weeks has 54,187 as the attendance?
SELECT COUNT(week) FROM table_name_87 WHERE attendance = 54 OFFSET 187
sql_create_context
CREATE TABLE table_17261 ( "No." text, "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text )
What is the number of first class team with birthday of 5 december 1970?
SELECT COUNT("First Class Team") FROM table_17261 WHERE "Date of Birth" = '5 December 1970'
wikisql
CREATE TABLE table_52566 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What was John Watson's total laps with a grid of less than 7?
SELECT COUNT("Laps") FROM table_52566 WHERE "Driver" = 'john watson' AND "Grid" < '7'
wikisql
CREATE TABLE table_54673 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team scored 19.11 (125)?
SELECT "Home team" FROM table_54673 WHERE "Home team score" = '19.11 (125)'
wikisql
CREATE TABLE table_name_44 ( game INTEGER, points INTEGER )
What hame has points larger than 81?
SELECT SUM(game) FROM table_name_44 WHERE points > 81
sql_create_context
CREATE TABLE table_name_15 ( tournament_or_series VARCHAR, points_for___tests__ VARCHAR, played_in VARCHAR, games_played___tests__ VARCHAR )
What tournament or series was played in England, when games played was 4, points for were 121?
SELECT tournament_or_series FROM table_name_15 WHERE played_in = "england" AND games_played___tests__ = "4" AND points_for___tests__ = "121"
sql_create_context
CREATE TABLE table_59571 ( "Club" text, "Wins" real, "Byes" real, "Losses" real, "Against" real )
Which Byes has an Against smaller than 1297, and a Club of avoca, and Wins larger than 12?
SELECT AVG("Byes") FROM table_59571 WHERE "Against" < '1297' AND "Club" = 'avoca' AND "Wins" > '12'
wikisql
CREATE TABLE table_42371 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Location" text )
What is the location of the authors of Molnar?
SELECT "Location" FROM table_42371 WHERE "Authors" = 'molnar'
wikisql
CREATE TABLE table_name_10 ( Id VARCHAR )
What's the 2010 when they had a Q2 in 2009?
SELECT 2010 FROM table_name_10 WHERE 2009 = "q2"
sql_create_context
CREATE TABLE table_50733 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the highest attendance when the opponent is the Los Angeles Rams and the week is less than 11?
SELECT MAX("Attendance") FROM table_50733 WHERE "Opponent" = 'los angeles rams' AND "Week" < '11'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
since 6 years ago how many patients were discharged from the hospital?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-6 year')
eicu
CREATE TABLE table_78409 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What away team scored 9.18 (72)?
SELECT "Away team" FROM table_78409 WHERE "Away team score" = '9.18 (72)'
wikisql
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
How many parties of the time they took office, binning the took office into WEEKDAY interval, I want to show by the Y-axis in descending.
SELECT Took_office, COUNT(Took_office) FROM party ORDER BY COUNT(Took_office) DESC
nvbench
CREATE TABLE table_name_31 ( season VARCHAR, average VARCHAR )
Which season's average was 37.5?
SELECT season FROM table_name_31 WHERE average = 37.5
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...
在04年4月23日到10年10月25日内名叫马兴生的患者自费的金额比2352.85元高的药品量有多少?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '马兴生' AND t_kc22.STA_DATE BETWEEN '2004-04-23' AND '2010-10-25' AND t_kc22.SELF_PAY_AMO > 2352.85 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.P...
css
CREATE TABLE table_4030 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real )
What is the area of ?
SELECT "Area" FROM table_4030 WHERE "Simplified" = '罗山县'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_f...
COACH fares only weekdays for DENVER to BOSTON
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, days AS DAYS_2, days AS DAYS_3, days AS DAYS_4, days AS DAYS_5, days AS DAYS_6, days AS DAYS_7, days AS DAYS_8, days AS DAYS_9, fare, fare_basis A...
atis
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 demographic ...
count the number of patients whose primary disease is squamous cell carcinoma oral tongue/sda and admission year is less than 2176?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.admityear < "2176"
mimicsql_data
CREATE TABLE table_name_18 ( try_diff VARCHAR, points_diff VARCHAR )
What is Try Diff, when Points Diff is +71?
SELECT try_diff FROM table_name_18 WHERE points_diff = "+71"
sql_create_context
CREATE TABLE table_11201 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When did an away team have a crowd larger than 17,259 at Melbourne?
SELECT "Date" FROM table_11201 WHERE "Crowd" > '17,259' AND "Away team" = 'melbourne'
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...
以前,患者鲁芳华的哪些门诊诊断有什么?
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '鲁芳华'
css
CREATE TABLE table_80161 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which player is from Sweden?
SELECT "Player" FROM table_80161 WHERE "Country" = 'sweden'
wikisql
CREATE TABLE table_73009 ( "Six at" text, "Number of editions" real, "First ridden" real, "Last ridden" real, "Most wins by" text )
How many editions have a most wins value of Franco Marvulli (4)?
SELECT COUNT("Number of editions") FROM table_73009 WHERE "Most wins by" = 'Franco Marvulli (4)'
wikisql
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 prescriptions ( subject_id text, hadm_id...
provide the number of patients whose year of death is less than or equal to 2122 and item id is 51034?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2122.0" AND lab.itemid = "51034"
mimicsql_data
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
编号为46630486148的检验报告单上所有的结果定量、结果定性、检验指标的代码、名称、结果定量单位的参考值范围下限与上限都是什么样的?
SELECT JCZBDM, JCZBMC, JCZBJGDX, JCZBJGDL, JCZBJGDW, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE BGDH = '46630486148'
css
CREATE TABLE table_name_44 ( magnitude INTEGER, date VARCHAR )
What is the sum of Magnitude on february 12, 1953?
SELECT SUM(magnitude) FROM table_name_44 WHERE date = "february 12, 1953"
sql_create_context
CREATE TABLE table_name_72 ( county VARCHAR, name VARCHAR )
What is the County of Howard Street Tunnel?
SELECT county FROM table_name_72 WHERE name = "howard street tunnel"
sql_create_context
CREATE TABLE table_41452 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity" real, "Capacity in use" text )
What is the highest capacity of the airport in Rio de Janeiro, which was ranked greater than 6 and had more than 5,099,643 total passengers?
SELECT MAX("Capacity") FROM table_41452 WHERE "Rank" > '6' AND "Location" = 'rio de janeiro' AND "Total Passengers" > '5,099,643'
wikisql
CREATE TABLE table_name_71 ( city_or_town VARCHAR, longitude VARCHAR )
What is the City or Town of the monument with a Longitude of 89 11 w?
SELECT city_or_town FROM table_name_71 WHERE longitude = "89°11′w"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_dista...
what does code Y mean
SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'Y'
atis
CREATE TABLE school ( school_name VARCHAR, enrollment VARCHAR )
List the name of the school with the smallest enrollment.
SELECT school_name FROM school ORDER BY enrollment LIMIT 1
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, ...
算算看医院9557781全部医疗就诊的记录里不同科室患者的平均年龄以及出院诊断疾病不同的患者平均有多大
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9557781' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
please list all flights from DALLAS to PITTSBURGH on 7 4 1991
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 4 AND date_day.month_number = 7 AND...
atis
CREATE TABLE table_58192 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team played against Geelong?
SELECT "Home team" FROM table_58192 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE table_9606 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which college with a position of rb had a pick larger than 6 in round 28?
SELECT "College" FROM table_9606 WHERE "Pick" > '6' AND "Position" = 'rb' AND "Round" = '28'
wikisql
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_i...
Find the name and level of catalog structure with level between 5 and 10, could you sort by the catalog_level_name from high to low?
SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_name DESC
nvbench
CREATE TABLE table_name_39 ( event VARCHAR, year VARCHAR )
that was held in 1964?
SELECT event FROM table_name_39 WHERE year = 1964
sql_create_context
CREATE TABLE table_17312 ( "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 high assists on the date December 12?
SELECT "High assists" FROM table_17312 WHERE "Date" = 'December 12'
wikisql
CREATE TABLE table_71759 ( "Date" real, "Category" text, "Team" text, "Rider 1" text, "Rider 2" text )
Which category has a team of Cannondale Vredestein?
SELECT "Category" FROM table_71759 WHERE "Team" = 'cannondale vredestein'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
检验报告单14839053409的标本采集部位是什么部分?
SELECT BBCJBW FROM jybgb WHERE BGDH = '14839053409'
css
CREATE TABLE table_name_49 ( result VARCHAR, date VARCHAR )
What is the result of the game on May 14?
SELECT result FROM table_name_49 WHERE date = "may 14"
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, ...
列出患者74086370医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额超过4198.44元的
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '74086370' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4198.44)
css
CREATE TABLE table_261946_3 ( left INTEGER, location__all_in_ohio_ VARCHAR )
Which year did enrolled Gambier members leave?
SELECT MIN(left) FROM table_261946_3 WHERE location__all_in_ohio_ = "Gambier"
sql_create_context
CREATE TABLE table_203_221 ( id number, "name" text, "nationality" text, "matches played" number, "goals scored" number, "notes" text )
what player is australian and has played 91 matches for melbourne ?
SELECT "name" FROM table_203_221 WHERE "nationality" = 'australia' AND "matches played" = 91
squall
CREATE TABLE table_78358 ( "Year" real, "Network" text, "Lap-by-lap" text, "s Color commentator" text, "Pre-Race Host" text, "Pre-Race Analyst(s)" text, "Ratings" text, "Viewers" text )
Which Year is the lowest when the Viewers are 13.7 million?
SELECT MIN("Year") FROM table_78358 WHERE "Viewers" = '13.7 million'
wikisql
CREATE TABLE table_name_98 ( crowd INTEGER, home_team VARCHAR )
What was the largest crowd for North Melbourne
SELECT MAX(crowd) FROM table_name_98 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_name_57 ( title VARCHAR, japan VARCHAR )
Tell me the title for japan august 23, 2012
SELECT title FROM table_name_57 WHERE japan = "august 23, 2012"
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 ) ...
Count the number of patients who had procedure icd9 code 9920 and a drug route of iv bolus.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "9920" AND prescriptions.route = "IV BOLUS"
mimicsql_data
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 (...
count the number of patients whose ethnicity is asian and admission year is less than 2165?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2165"
mimicsql_data
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, ...
统计出院诊断为S71.183的在医院8274481的医疗记录中最低和最高医疗费总额分别是?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8274481' AND t_kc21.OUT_DIAG_DIS_CD = 'S71.183')
css
CREATE TABLE table_8004 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
Which Game is the highest one that has High rebounds of pau gasol (11)?
SELECT MAX("Game") FROM table_8004 WHERE "High rebounds" = 'pau gasol (11)'
wikisql
CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time...
Give me a bar chart to show the name and age for all drivers, list by the Y in ascending.
SELECT Name, Age FROM driver ORDER BY Age
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
what was the name of the drug that was prescribed two times to patient 67902 since 126 months ago?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67902) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-126 month') GROUP BY prescriptions.dr...
mimic_iii
CREATE TABLE table_6095 ( "Week of" text, "Tournament" text, "Winner" text, "Runner-up" text, "Semi-finalists" text )
Who was the winner in the event with a runner-up of Alberto Mancini?
SELECT "Winner" FROM table_6095 WHERE "Runner-up" = 'alberto mancini'
wikisql
CREATE TABLE table_23109 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What is the total number of John Merrick as a runner up?
SELECT COUNT("No.") FROM table_23109 WHERE "Runner(s)-up" = 'John Merrick'
wikisql
CREATE TABLE table_58458 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was St Kilda's home team opponents score?
SELECT "Home team score" FROM table_58458 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE table_26717 ( "Pitcher" text, "Strikeouts" real, "Season" real, "Team" text, "League" text, "Overall Rank" real )
Name the team ranked 4
SELECT COUNT("Team") FROM table_26717 WHERE "Overall Rank" = '4'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents...
what is the monthly minimum amount of po2 patient 6921 has until 2104?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6921) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND STRFTIME('%y', labevents.charttime) <= '2104' GROUP BY STRFTIME('%...
mimic_iii