context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_60275 ( "Model" text, "Year" text, "Type" text, "Engine" text, "Displacement cc" text )
What type of car has the model 6cm?
SELECT "Type" FROM table_60275 WHERE "Model" = '6cm'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For all employees who have the letters D or S in their first name, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday by a bar chart, sort by the y axis from low to high please.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE playe...
what are the draft pick numbers and draft classes for players who play the Defender position?, rank by the X in ascending.
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class
nvbench
CREATE TABLE table_10798928_1 ( director VARCHAR, original_title VARCHAR )
Who directed Dulcinea?
SELECT director FROM table_10798928_1 WHERE original_title = "Dulcinea"
sql_create_context
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 ...
when in their last hospital visit was the first time patient 85131 received non-invasive mech vent?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'non-invasive mech vent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85131 AND NO...
mimic_iii
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
What is the total number of captains with different classes?, sort by the bars in desc.
SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE table_name_90 ( rank__number VARCHAR, attendance VARCHAR )
What rank were the Buckeyes when there were 68,586 in attendance?
SELECT rank__number FROM table_name_90 WHERE attendance = "68,586"
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE weather ( date TEX...
For those dates that have the 5 highest cloud cover rates, please bin the date into day of the week interval and compute their average cloud cover, and display y-axis in ascending order.
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover)
nvbench
CREATE TABLE table_38365 ( "State" text, "Revenue (millions)" text, "Population" real, "Revenue per capita" text, "Spending (millions)" text, "Spending per capita" text, "Net contribution per capita" text )
What is the Revenue of the population of more than 1,499,402, with Spending (millions) of $13,986?
SELECT "Revenue (millions)" FROM table_38365 WHERE "Population" > '1,499,402' AND "Spending (millions)" = '$13,986'
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...
年龄在10岁以下的病人的医疗记录的平均医疗费总额有多少
SELECT AVG(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_PERSON_AGE < 10)
css
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 minimum age of patients whose admission type is emergency and year of birth is greater than 2078?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "2078"
mimicsql_data
CREATE TABLE table_name_74 ( year VARCHAR, record VARCHAR )
How many years have a Record of 73-65?
SELECT COUNT(year) FROM table_name_74 WHERE record = "73-65"
sql_create_context
CREATE TABLE table_name_14 ( visitor VARCHAR, date VARCHAR )
Which visitor visited on February 21?
SELECT visitor FROM table_name_14 WHERE date = "february 21"
sql_create_context
CREATE TABLE table_55036 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text )
Which surface has an Opponent of fernando verdasco?
SELECT "Surface" FROM table_55036 WHERE "Opponent" = 'fernando verdasco'
wikisql
CREATE TABLE table_30303 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
Who won the mens doubles when wang hao won the mens singles?
SELECT "Mens Doubles" FROM table_30303 WHERE "Mens Singles" = 'Wang Hao'
wikisql
CREATE TABLE table_41692 ( "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
Which 2nd leg has pamesa valencia for team #2?
SELECT "2nd leg" FROM table_41692 WHERE "Team #2" = 'pamesa valencia'
wikisql
CREATE TABLE table_13501 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the average gold when rank is total and silver is more than 20?
SELECT AVG("Gold") FROM table_13501 WHERE "Rank" = 'total' AND "Silver" > '20'
wikisql
CREATE TABLE table_56113 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team scored 12.11 (83)?
SELECT "Home team" FROM table_56113 WHERE "Home team score" = '12.11 (83)'
wikisql
CREATE TABLE table_204_214 ( id number, "pos" text, "no." number, "rider" text, "manufacturer" text, "laps" number, "time/retired" text, "grid" number, "points" number )
which rider came in first with 25 points ?
SELECT "rider" FROM table_204_214 WHERE "points" = 25
squall
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, ...
32713764439那个门诊就诊的病人体征记录是哪一天
SELECT JLSJ FROM mzjzjlb WHERE JZLSH = '32713764439'
css
CREATE TABLE table_name_32 ( attendance INTEGER, opponent VARCHAR, week VARCHAR )
What is the attendance for the game against the Kansas City Chiefs earlier than week 13?
SELECT AVG(attendance) FROM table_name_32 WHERE opponent = "kansas city chiefs" AND week < 13
sql_create_context
CREATE TABLE table_name_95 ( place VARCHAR, to_par VARCHAR, player VARCHAR )
With a To par of 5, what is Nick Faldo's Place?
SELECT place FROM table_name_95 WHERE to_par = "–5" AND player = "nick faldo"
sql_create_context
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built tex...
Show the number of the countries that have managers of age above 50 or below 46, and could you show by the bars from low to high?
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE table_43140 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
What was the score of the game with the Broadview Hawks as the home team?
SELECT "Score" FROM table_43140 WHERE "Home" = 'broadview hawks'
wikisql
CREATE TABLE table_204_928 ( id number, "year" number, "album" text, "territory" text, "label" text, "notes" text )
how many total albums did this group have under capitol records ?
SELECT COUNT("album") FROM table_204_928 WHERE "label" = 'capitol records'
squall
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, ...
what was the top four most frequent procedures performed since 5 years ago that patients were given within 2 months after the diagnosis of malig neo bladder nos?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many patients are diagnosed with primary disease rash and suggested with drug route via iv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "RASH" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_71400 ( "Date" text, "Tournament" text, "Surface" text, "Tier" text, "Partner" text, "Opponents in the final" text, "Score" text )
Which date has opponents, Akgul Amanmuradova Nina Bratchikova, in the final?
SELECT "Date" FROM table_71400 WHERE "Opponents in the final" = 'akgul amanmuradova nina bratchikova'
wikisql
CREATE TABLE table_34593 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the largest played number when the difference is - 8 and position is more than 8?
SELECT MAX("Played") FROM table_34593 WHERE "Difference" = '- 8' AND "Position" > '8'
wikisql
CREATE TABLE table_203_163 ( id number, "year" number, "total" number, "serbs" text, "hungarians" text, "germans" text, "romanians" text, "slovaks" text )
what was the first year that the romanian population was less than 51,000 ?
SELECT MIN("year") FROM table_203_163 WHERE "romanians" < 51000
squall
CREATE TABLE zyb ( 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...
在2009年06月17日到2018年12月02日期间,医疗机构7756841一共有多少医疗费
SELECT SUM(t_kc24.MED_AMOUT) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7756841' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-06-17' AND '2018-12-02' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO...
css
CREATE TABLE table_name_72 ( power__kw_ VARCHAR, frequency VARCHAR )
What is the Power (kW) for the station with a frequency of 95.1mhz?
SELECT power__kw_ FROM table_name_72 WHERE frequency = "95.1mhz"
sql_create_context
CREATE TABLE table_69060 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text )
What is the total of Frequency MHz with a Class of b1?
SELECT SUM("Frequency MHz") FROM table_69060 WHERE "Class" = 'b1'
wikisql
CREATE TABLE table_50221 ( "Date" text, "Opponent#" text, "Rank #" text, "Site" text, "Result" text, "Attendance" text )
Who was the opponent when the result was w24-7?
SELECT "Opponent#" FROM table_50221 WHERE "Result" = 'w24-7'
wikisql
CREATE TABLE table_64829 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many bronzes have west germany as the nation?
SELECT SUM("Bronze") FROM table_64829 WHERE "Nation" = 'west germany'
wikisql
CREATE TABLE table_20374 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text )
Name the content for sky famiglia for italian and dar 16:9 for mtv hits
SELECT "Content" FROM table_20374 WHERE "Package/Option" = 'Sky Famiglia' AND "Language" = 'Italian' AND "DAR" = '16:9' AND "Television service" = 'MTV Hits'
wikisql
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE weather ( date TEX...
What are the number of the dates with a maximum temperature higher than 85?, I want to show the number of date from low to high order.
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date)
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( r...
how many hours has it been since the first time patient 65582 visited ward 50 in this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582 AND admissions.dischtime IS NULL)) AND transfers...
mimic_iii
CREATE TABLE stadium ( id number, name text, capacity number, city text, country text, opening_year number ) CREATE TABLE swimmer ( id number, name text, nationality text, meter_100 number, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter...
Which countries do not have a stadium that was opened after 2006?
SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006
spider
CREATE TABLE table_name_83 ( scored VARCHAR, points VARCHAR, draws VARCHAR, wins VARCHAR )
How many points are in the scored category for the team that has less than 5 draws, 8 total wins, and total overall points less than 27?
SELECT COUNT(scored) FROM table_name_83 WHERE draws < 5 AND wins = 8 AND points < 27
sql_create_context
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...
Draw a scatter chart about the correlation between Team_ID and ACC_Percent , and group by attribute All_Games.
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games
nvbench
CREATE TABLE table_41533 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the average number played of the team with 1 drawn and 24 against?
SELECT AVG("Played") FROM table_41533 WHERE "Drawn" = '1' AND "Against" = '24'
wikisql
CREATE TABLE table_64076 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year Joined" text, "Previous Conference" text, "Year Left" text )
what is the mascot when the school is warsaw?
SELECT "Mascot" FROM table_64076 WHERE "School" = 'warsaw'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
what were the first outputs of patient 12885 on 06/28/last year?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 12885)) AND DATETIME(outputevents.charttim...
mimic_iii
CREATE TABLE table_26580 ( "Processor" text, "Brand name" text, "Model (list)" text, "Cores" real, "L2 Cache" text, "Socket" text, "TDP" text )
What's the model of the processor with a 5.5 w TDP?
SELECT "Model (list)" FROM table_26580 WHERE "TDP" = '5.5 W'
wikisql
CREATE TABLE table_19818 ( "Ido" text, "English" text, "Italian" text, "French" text, "German" text, "Russian" text, "Spanish" text )
What is the french word for the Russian word filtrovat ( )?
SELECT "French" FROM table_19818 WHERE "Russian" = 'filtrovat (фильтровать)'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Whats the age demographic per tag?. I tried to make this accept the tag as a parameter but I kepy getting an error.
SELECT TagName, COUNT(TagName) AS TagsPerAge, Age FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE TagName = 'php' AND age > 0 GROUP BY Age, TagName ORDER BY TagsPerAge DESC
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
how many patients whose primary disease is acute subdural hematoma and year of death is less than or equal to 2183?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.dod_year <= "2183.0"
mimicsql_data
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ...
Answers with word '.BY' for 'data.table' tag posts.
SELECT OwnerUserId AS "user_link", Id AS "post_link" FROM Posts WHERE ParentId IN (SELECT Id FROM Posts WHERE Tags LIKE '%data.table%' AND Body COLLATE Latin1_General_CS_AS LIKE '%column%') AND Body COLLATE Latin1_General_CS_AS LIKE '%.BY%'
sede
CREATE TABLE table_11214772_1 ( score VARCHAR, year VARCHAR )
what's the score where year is 2007
SELECT score FROM table_11214772_1 WHERE year = "2007"
sql_create_context
CREATE TABLE table_33623 ( "Year" text, "1st Position" text, "2nd Position" text, "9th Position" text, "10th Position" text )
What is in the ninth position where the tenth position is rabat ajax?
SELECT "9th Position" FROM table_33623 WHERE "10th Position" = 'rabat ajax'
wikisql
CREATE TABLE table_69835 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the lowest round for Southern College?
SELECT MIN("Round") FROM table_69835 WHERE "College" = 'southern'
wikisql
CREATE TABLE table_54881 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
What is the away team score of a Melbourne team that has a home team score of 12.7 (79)?
SELECT "Away team score" FROM table_54881 WHERE "Home team score" = '12.7 (79)' AND "Away team" = 'melbourne'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what was patient 25733's first ward identification in their current hospital encounter?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733 AND admissions.dischtime IS NULL) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime LIMIT 1
mimic_iii
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 prescriptions...
what is admission location and discharge location of subject id 17787?
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "17787"
mimicsql_data
CREATE TABLE table_18772 ( "Serial & Branch" real, "Seaman" text, "Mechanical" text, "Secretariat" text, "Supply" text, "Electrical" text, "Radio Electrical" text, "Regulating" text, "Medical" text )
What are radio electricals when secretariat is wtr i?
SELECT "Radio Electrical" FROM table_18772 WHERE "Secretariat" = 'WTR I'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number...
calculate the number of patients who have been hospitalized since 4 years ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_name_56 ( date VARCHAR, tie_no VARCHAR )
What was the date of the game that tied at 3?
SELECT date FROM table_name_56 WHERE tie_no = "3"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
08728091这个患者曾有过什么异常情况?
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_7412 ( "Tournament" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text )
In the Tennis Masters Cup, how did Ji Nov k do in 1997?
SELECT "1997" FROM table_7412 WHERE "Tournament" = 'tennis masters cup'
wikisql
CREATE TABLE table_name_73 ( place VARCHAR, player VARCHAR )
What is the place of player john cook?
SELECT place FROM table_name_73 WHERE player = "john cook"
sql_create_context
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 ( ...
provide the number of patients with lab test item id 51067 who were younger than 44 years.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "44" AND lab.itemid = "51067"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
what was the number of times insulin lispro, recombinant was prescribed for patient 010-5308 in 01/this year?
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-5308')) AND medication.drugname = 'insulin lispro, recombinant' AND DATETI...
eicu
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...
曹斌蔚这个病人在2013年12月22日以前在哪些门诊做过检验报告?查一下这些门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Find meter_200 and the sum of meter_100 , and group by attribute meter_200, and visualize them by a bar chart, list x-axis in descending order.
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC
nvbench
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 procedures ( ...
How many of the patients born before 2083 have confirmed death status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.dob_year < "2083"
mimicsql_data
CREATE TABLE table_12362 ( "Rank" real, "Athlete" text, "Qiangshu" real, "Jianshu" real, "Total" real )
What is the number of Jianshu when the total is more than 19.16, for Nguyen Huy Thanh ( vie ), and Qiangshu is more than 9.66?
SELECT COUNT("Jianshu") FROM table_12362 WHERE "Total" > '19.16' AND "Athlete" = 'nguyen huy thanh ( vie )' AND "Qiangshu" > '9.66'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Visualize a bar chart about the distribution of meter_600 and ID , display by the Y in asc.
SELECT meter_600, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE table_7703 ( "Name/ designation" text, "Year of intro" real, "Country of origin" text, "Primary cartridge" text, "Type" text )
What is Country of Origin, when Year of Intro is greater than 1985, and when Primary Cartridge is 125mm?
SELECT "Country of origin" FROM table_7703 WHERE "Year of intro" > '1985' AND "Primary cartridge" = '125mm'
wikisql
CREATE TABLE table_name_20 ( loss VARCHAR, date VARCHAR )
Name the loss on may 29
SELECT loss FROM table_name_20 WHERE date = "may 29"
sql_create_context
CREATE TABLE table_name_7 ( historical_references VARCHAR, run_time VARCHAR )
What is the topic of the episode that runs 6:07?
SELECT historical_references FROM table_name_7 WHERE run_time = "6:07"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
flights from LAS VEGAS to PHOENIX
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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOE...
atis
CREATE TABLE table_6640 ( "102." real, "28 February" text, "Friendly" text, "Croatia" text, "Austria" text )
What is shown for Austria when Croatia shows Ireland?
SELECT "Austria" FROM table_6640 WHERE "Croatia" = 'ireland'
wikisql
CREATE TABLE table_47868 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
WHAT SCORE HAD A RECORD OF 1-1?
SELECT "Score" FROM table_47868 WHERE "Record" = '1-1'
wikisql
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date D...
Show the number of accounts in a bar chart that groups by other account details, and sort in desc by the x-axis please.
SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details ORDER BY other_account_details DESC
nvbench
CREATE TABLE table_name_59 ( thursday VARCHAR, series VARCHAR )
Which Thursday does big brother 13 air?
SELECT thursday FROM table_name_59 WHERE series = "big brother 13"
sql_create_context
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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restrict...
give me flights from BALTIMORE to DENVER on UA that offer FIRST class
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, fare, fare_basis, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_...
atis
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime t...
what percentile of sodium is 144.0 in patients of the same age as patient 97330 on the current hospital encounter?
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 = 'sodium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = ...
mimic_iii
CREATE TABLE table_name_68 ( attendance VARCHAR, visitor VARCHAR )
How many people went to the game with Indiana visiting?
SELECT attendance FROM table_name_68 WHERE visitor = "indiana"
sql_create_context
CREATE TABLE table_52544 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
Who's from Bay City, TX?
SELECT "Player" FROM table_52544 WHERE "Hometown" = 'bay city, tx'
wikisql
CREATE TABLE table_name_34 ( school_club_team VARCHAR, player VARCHAR )
Which School/Club Team did Andre Wakefield play for?
SELECT school_club_team FROM table_name_34 WHERE player = "andre wakefield"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
show me all flights and fares from DENVER to SAN FRANCISCO
SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPO...
atis
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
What are the last names of students studying major 50?
SELECT lname FROM student WHERE major = 50
spider
CREATE TABLE zzmzjzjlb ( 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, MZZYZDZ...
55379841354这次门诊就诊中的病人的卡号及卡类型是什么
SELECT zzmzjzjlb.KH, zzmzjzjlb.KLX FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '55379841354' UNION SELECT fzzmzjzjlb.KH, fzzmzjzjlb.KLX FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '55379841354'
css
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...
the list of the patient ids of patients diagnosed with assault nos since 2101.
SELECT 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 = 'assault nos') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2101')
mimic_iii
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 ...
查查这位钱康复的患者身高和体重指标
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '钱康复'
css
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 ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
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.
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_9803 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score when the margin of victory was a playoff for the Tournament of safeco classic?
SELECT "Winning score" FROM table_9803 WHERE "Margin of victory" = 'playoff' AND "Tournament" = 'safeco classic'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is age and religion of subject id 1121?
SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE table_name_38 ( score VARCHAR, attendance VARCHAR )
What was the score of the game when the attendance was 1,644?
SELECT score FROM table_name_38 WHERE attendance = "1,644"
sql_create_context
CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
Show me distance by name in a histogram, display X in descending order.
SELECT name, distance FROM aircraft ORDER BY name DESC
nvbench
CREATE TABLE table_23795 ( "Interior/Roof" text, "Black (UA)" real, "Red (E8)" real, "White (ZR)" real, "Green (SW)" real, "Totals" real )
How many different results for red (e8) does the model with parchment/saddle interior/roof have?
SELECT COUNT("Red (E8)") FROM table_23795 WHERE "Interior/Roof" = 'Parchment/saddle'
wikisql
CREATE TABLE table_41805 ( "Country" text, "1997" real, "1998" real, "1999" real, "2000" real, "2001" real, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real, "2012" real, ...
How many countries in 2009 have fewer than 1 in 1999, more than 0 in 2006 and none in 1997?
SELECT COUNT("2009") FROM table_41805 WHERE "1999" < '1' AND "2006" > '0' AND "1997" < '0'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is subject name of subject id 66411?
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "66411"
mimicsql_data
CREATE TABLE table_2668336_24 ( result VARCHAR, candidates VARCHAR )
What is the result when the candidates are alexander smyth (dr) 100%
SELECT result FROM table_2668336_24 WHERE candidates = "Alexander Smyth (DR) 100%"
sql_create_context
CREATE TABLE table_204_322 ( id number, "township" text, "fips" number, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text )
which township has the most residents ?
SELECT "township" FROM table_204_322 ORDER BY "population" DESC LIMIT 1
squall
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...
are there any 400 o'clock flights from WASHINGTON to DENVER
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time = 400 AND flight.to_airport = AIRPORT_SERVICE_1.airport...
atis
CREATE TABLE table_18917 ( "Country" text, "Currency name" text, "Month with highest inflation rate" text, "Highest monthly inflation rate" text, "Equivalent daily inflation rate" text, "Time required for prices to double" text )
how many equivalent daily inflation rate with time required for prices to double being 3.7 days
SELECT COUNT("Equivalent daily inflation rate") FROM table_18917 WHERE "Time required for prices to double" = '3.7 days'
wikisql
CREATE TABLE table_51567 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who constructed the car with a grid over 19 that retired due to suspension?
SELECT "Constructor" FROM table_51567 WHERE "Grid" > '19' AND "Time/Retired" = 'suspension'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
有哪些人审核超过13份检验报告单在医疗就诊71249027132中?列出这些审核人工号和姓名分别是?
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '71249027132' GROUP BY zyjybgb.SHRGH HAVING COUNT(*) > 13 UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '71249027132' GROUP BY mzjybgb.SHRGH HAVING COUNT(*) > 13
css