context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of manager_id over the hire_date bin hire_date by weekday by a bar chart, and could you rank from low to high by the mean manager id?
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_47825 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real )
What is the average To Par, when Player is 'Julius Boros'?
SELECT AVG("To par") FROM table_47825 WHERE "Player" = 'julius boros'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, ...
what kind of ground transportation is there in WASHINGTON
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WASHINGTON' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_38821 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the location attendance from Dwyane Wade (27) high points?
SELECT "Location Attendance" FROM table_38821 WHERE "High points" = 'dwyane wade (27)'
wikisql
CREATE TABLE table_76962 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Which Score has a Place of t6, and a Country of paraguay?
SELECT "Score" FROM table_76962 WHERE "Place" = 't6' AND "Country" = 'paraguay'
wikisql
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Return a bar chart on what are the allergy types and how many allergies correspond to each one?, and show in descending by the total number please.
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_17 ( sport VARCHAR, site VARCHAR, date VARCHAR )
What is the sport played in Iowa City on February 14, 2009?
SELECT sport FROM table_name_17 WHERE site = "iowa city" AND date = "february 14, 2009"
sql_create_context
CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, sequence_identity_to_human_protein text, Institution_id text ) CREATE TABLE Institution ( Institution_id text, Institution text, Location ...
Show the names and heights of buildings with at least two institutions founded after 1880. Show the proportion.
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880
nvbench
CREATE TABLE table_name_75 ( outcome VARCHAR, score VARCHAR )
What is the Outcome of the match with a Score of 6 3, 6 4?
SELECT outcome FROM table_name_75 WHERE score = "6–3, 6–4"
sql_create_context
CREATE TABLE table_256286_63 ( no_votes VARCHAR, description VARCHAR )
How many no votes were there in the partial public funding of election campaigns legislation?
SELECT no_votes FROM table_256286_63 WHERE description = "Partial public funding of election campaigns"
sql_create_context
CREATE TABLE table_name_42 ( season INTEGER, last_aired VARCHAR )
Of the series that last aired August 20, 2010, what is the lowest number of seasons?
SELECT MIN(season) FROM table_name_42 WHERE last_aired = "august 20, 2010"
sql_create_context
CREATE TABLE table_39066 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What was the highest week with 84,856 in attendance?
SELECT MAX("Week") FROM table_39066 WHERE "Attendance" = '84,856'
wikisql
CREATE TABLE table_65915 ( "Team" text, "Winners" real, "Runners-up" real, "Years won" text, "Years runners-up" text )
Which team were runners-up in 2007 and had 1 under winners?
SELECT "Team" FROM table_65915 WHERE "Winners" = '1' AND "Years runners-up" = '2007'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) ...
how many patients were diagnosed with pancreatic disease nos and did not come to the hospital in the same month until 3 years ago?
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pancreatic...
mimic_iii
CREATE TABLE table_35828 ( "Ranking" real, "Nationality" text, "Name" text, "Games" real, "Years" text )
What is the Years when games shows 550?
SELECT "Years" FROM table_35828 WHERE "Games" = '550'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
想知道患者蒋阳飙在二0一一年十月十四日到二0二0年十一月十九日期间被开出利可君片(薄膜衣)的总次数是多少
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 '2011-10-14' AND '2020-11-19' AND t_kc22.SOC_SRT_DIRE_NM = '利可君片(薄膜衣)' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fg...
css
CREATE TABLE table_name_38 ( years VARCHAR, name VARCHAR, ranking VARCHAR, goals VARCHAR )
What are the years when the ranking is less than 8 with less than 66 goals and name is Paul McGee?
SELECT years FROM table_name_38 WHERE ranking < 8 AND goals < 66 AND name = "paul mcgee"
sql_create_context
CREATE TABLE table_31901 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Who was the partner for the game on October 20, 2013?
SELECT "Partner" FROM table_31901 WHERE "Date" = 'october 20, 2013'
wikisql
CREATE TABLE table_204_143 ( id number, "national park" text, "region" text, "land area (km2)" number, "established" number, "visitation (2009)" number, "coordinates" text )
is koli larger than lemmenjoki ?
SELECT (SELECT "land area (km2)" FROM table_204_143 WHERE "national park" = 'koli') > (SELECT "land area (km2)" FROM table_204_143 WHERE "national park" = 'lemmenjoki')
squall
CREATE TABLE table_name_8 ( field_goals VARCHAR, player VARCHAR )
How many field goals did duncan thompson have?
SELECT field_goals FROM table_name_8 WHERE player = "duncan thompson"
sql_create_context
CREATE TABLE table_17111812_1 ( sixth VARCHAR, eighth VARCHAR )
When the 8th is Marcos Hernandez who was the 6th?
SELECT sixth FROM table_17111812_1 WHERE eighth = "Marcos Hernandez"
sql_create_context
CREATE TABLE table_dev_23 ( "id" int, "anemia" bool, "gender" string, "thyroid_disease" bool, "hemoglobin_a1c_hba1c" float, "tsh" int, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "hba1c" float, "insulin_requirement" float, "body_mass_index_bmi" floa...
anemia ( hemoglobin < 11 g / dl in female , < 12 g / dl in male ) or known coagulopathy
SELECT * FROM table_dev_23 WHERE anemia = 1 OR ((gender = 'male' AND hemoglobin_a1c_hba1c < 12) OR (gender = 'female' AND hemoglobin_a1c_hba1c < 11)) OR coagulopathy = 1
criteria2sql
CREATE TABLE table_18597302_1 ( position INTEGER, team VARCHAR )
What was the position of the Atl. Colegiales team?
SELECT MAX(position) FROM table_18597302_1 WHERE team = "Atl. Colegiales"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
在编号为2203428的医院里开出的检验报告单中在零二年六月十八到一一年八月三日内这段时间,按照检测指标名称和检测指标结果定量单位不同的情况计算的检测指标结果定量的平均值最小的20项是哪些?
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '2203428' AND jyjgzbb.BGRQ BETWEEN '2002-06-28' AND '2011-08...
css
CREATE TABLE table_1773908_3 ( down__up_to_kbit_s_ INTEGER, provider VARCHAR )
What is download bandwith where the provider is deutsche telekom ag?
SELECT MAX(down__up_to_kbit_s_) FROM table_1773908_3 WHERE provider = "Deutsche Telekom AG"
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...
在医疗就诊15153729405中给病患何和韵开出的各药品的名称还有每次用量和使用频次都分别是什么?
SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE 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 = '15153729405'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 text, ...
列出患者韦坚秉的检验报告单日期在零一年二月二十三日之前的所对应的门诊就诊的流水号
SELECT txmzjzjlb.JZLSH 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 NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2001-02-2...
css
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, ...
give me the number of patients whose age is less than 82 and lab test name is chloride?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "82" AND lab.label = "Chloride"
mimicsql_data
CREATE TABLE table_name_3 ( tie_no VARCHAR, away_team VARCHAR )
What's the tie number when the away team was Mansfield Town?
SELECT tie_no FROM table_name_3 WHERE away_team = "mansfield town"
sql_create_context
CREATE TABLE table_1988 ( "Match no." real, "Match Type" text, "Team Europe" text, "Score" text, "Team USA" text, "Progressive Total" text )
When osku palermaa is on the europe team how many match numbers are there?
SELECT COUNT("Match no.") FROM table_1988 WHERE "Team Europe" = 'Osku Palermaa'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
Calculate the average age of patients who are still living with primary disease aortic insufficiency/re-do sternotomy aortic valve replacement.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
mimicsql_data
CREATE TABLE table_name_74 ( athlete VARCHAR, event VARCHAR )
Which athlete has a 35 km event?
SELECT athlete FROM table_name_74 WHERE event = "35 km"
sql_create_context
CREATE TABLE table_name_79 ( interview INTEGER, evening_gown VARCHAR, average VARCHAR, swimsuit VARCHAR )
Which mean interview number had an average of more than 9.233, a swimsuit stat of more than 9.473, and an evening gown score of more than 9.671?
SELECT AVG(interview) FROM table_name_79 WHERE average > 9.233 AND swimsuit = 9.473 AND evening_gown > 9.671
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patientheal...
what was the name of procedure that patient 027-32001 were last received in this hospital encounter?
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-32001' AND patient.hospitaldischargetime IS NULL)) ORDER BY t...
eicu
CREATE TABLE table_18727 ( "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
When did the episode titled 'Winterland' air for the first time?
SELECT "Original air date" FROM table_18727 WHERE "Title" = 'Winterland'
wikisql
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) ...
How many companies without a gas station in each main industry? Draw a bar chart, and I want to order in desc by the x-axis.
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY Main_Industry DESC
nvbench
CREATE TABLE table_name_94 ( crowd INTEGER, away_team VARCHAR )
What is the crowd with Away team of hawthorn?
SELECT AVG(crowd) FROM table_name_94 WHERE away_team = "hawthorn"
sql_create_context
CREATE TABLE table_19149550_7 ( black_caribbean_population INTEGER, black_african_population INTEGER )
What is the black caribbean population when the black African population is less than 10552.0?
SELECT MIN(black_caribbean_population) FROM table_19149550_7 WHERE black_african_population < 10552.0
sql_create_context
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
Give me a scatter chart to show the least rating star of the movie and reviewer id, group the title.
SELECT rID, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title
nvbench
CREATE TABLE table_16337329_5 ( past_habitual VARCHAR, probable_future VARCHAR )
Name the past habitual for garcha 'he does
SELECT past_habitual FROM table_16337329_5 WHERE probable_future = "गर्छ garcha 'he does'"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Users with highest Rep/Posts ratio.
SELECT u.Id, u.DisplayName, u.Reputation, COUNT(*) AS "total_number_of_posts", u.Reputation / COUNT(*) AS Ratio FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId IN (1, 2) GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY Ratio DESC LIMIT 1000
sede
CREATE TABLE table_17200 ( "Round" real, "Overall" real, "Player" text, "Position" text, "Nationality" text, "Club team" text )
WHAT ROUND WAS FORWARD ANDRE PETERSSON SELECTED?
SELECT MIN("Round") FROM table_17200 WHERE "Position" = 'Forward'
wikisql
CREATE TABLE table_name_40 ( nationality VARCHAR, school_club_team VARCHAR )
Which Nationality has a School/Club Team of seattle?
SELECT nationality FROM table_name_40 WHERE school_club_team = "seattle"
sql_create_context
CREATE TABLE table_name_32 ( losing_bonus VARCHAR, points VARCHAR )
If the points were 0, what was the losing bonus?
SELECT losing_bonus FROM table_name_32 WHERE points = "0"
sql_create_context
CREATE TABLE table_204_521 ( id number, "rank" number, "name" text, "nationality" text, "time (hand)" text, "notes" text )
which athlete had the fastest time ?
SELECT "name" FROM table_204_521 ORDER BY "time (hand)" LIMIT 1
squall
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ...
How many courses for each course description? Show me a bar chart, and display by the y axis in descending.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) DESC
nvbench
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
Show the number of year of the maximum price and score of wines in a bar chart, and bin the year into the weekday interval, and could you order y axis from high to low order?
SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) DESC
nvbench
CREATE TABLE table_name_82 ( Id VARCHAR )
What is 2010, when 2009 is '1'?
SELECT 2010 FROM table_name_82 WHERE 2009 = "1"
sql_create_context
CREATE TABLE wdmzjzjlb ( 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...
检验报告单24518134676被门诊就诊中开出的对应的患者全名是啥?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '2...
css
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, ...
did patient 028-45460 receive laboratory tests in 12/2105?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-45460')) AND STRFTIME('%y-%m', lab.labresulttime) = '2105-12'
eicu
CREATE TABLE table_name_55 ( city VARCHAR, school VARCHAR, last VARCHAR, rank VARCHAR, first VARCHAR )
What city is the School, Highland, in that ranks less than 8 and had its first title before 1980 and its last title later than 1960?
SELECT city FROM table_name_55 WHERE rank < 8 AND first < 1980 AND last > 1960 AND school = "highland"
sql_create_context
CREATE TABLE table_56557 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
On the episode that had a run time of 24:57, how many million viewers were there?
SELECT "Viewers (in millions)" FROM table_56557 WHERE "Run time" = '24:57'
wikisql
CREATE TABLE table_name_15 ( score VARCHAR, place VARCHAR )
What is Score, when Place is 'T1'?
SELECT score FROM table_name_15 WHERE place = "t1"
sql_create_context
CREATE TABLE table_71357 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What is the total roll with a decile less than 7, and an authority of state, in the Macraes Flat area?
SELECT COUNT("Roll") FROM table_71357 WHERE "Decile" = '7' AND "Authority" = 'state' AND "Area" = 'macraes flat'
wikisql
CREATE TABLE table_name_91 ( player VARCHAR, country VARCHAR, score VARCHAR )
What player has The United States as the country with 70 as the score?
SELECT player FROM table_name_91 WHERE country = "united states" AND score = 70
sql_create_context
CREATE TABLE table_name_74 ( result VARCHAR, venue VARCHAR, score VARCHAR )
For the venue of suwon world cup stadium , suwon , south korea and a Score of 3 0 what is the result?
SELECT result FROM table_name_74 WHERE venue = "suwon world cup stadium , suwon , south korea" AND score = "3–0"
sql_create_context
CREATE TABLE table_26519 ( "Co-king" text, "Relationship to Monarch" text, "Crowned" text, "Co-kingship ceased" text, "Reason" text, "Monarch" text )
Name the monarch for 13 october 1131
SELECT "Monarch" FROM table_26519 WHERE "Co-kingship ceased" = '13 October 1131'
wikisql
CREATE TABLE table_38653 ( "Discipline" text, "Peter" real, "Adam" real, "Jade" real, "Plat'num" real )
Adam is less than 1 and Jade is greater than 5 in cycling, what's the plat'num?
SELECT MIN("Plat'num") FROM table_38653 WHERE "Adam" < '1' AND "Discipline" = 'cycling' AND "Jade" > '5'
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and rank in desc by the how many hire date please.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_60837 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the tie number when Bournemouth was the home team?
SELECT "Tie no" FROM table_60837 WHERE "Home team" = 'bournemouth'
wikisql
CREATE TABLE table_name_85 ( rank VARCHAR, country VARCHAR )
What is Croatia's rank?
SELECT rank FROM table_name_85 WHERE country = "croatia"
sql_create_context
CREATE TABLE table_67281 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Who was the opponent at the game when the record was 15 15?
SELECT "Opponent" FROM table_67281 WHERE "Record" = '15–15'
wikisql
CREATE TABLE table_204_320 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country has the most bronze medals ?
SELECT "nation" FROM table_204_320 ORDER BY "bronze" DESC LIMIT 1
squall
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
when did the last lab test of patient 60136 on the current hospital encounter take place?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_60804 ( "Episode" text, "1 season" text, "2 season" text, "3 season" text, "4 season" text, "5 season" text, "6 season" text )
What is 3 Season, when 4 Season is '2 628 383 (3 June 2009)'?
SELECT "3 season" FROM table_60804 WHERE "4 season" = '2 628 383 (3 june 2009)'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, ...
what was the number of patients who had been prescribed prednisolone acetate 0.12% ophth. susp. until 2104?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'prednisolone acetate 0.12% ophth. susp.' AND STRFTIME('%y', prescriptions.startdate) <= '2104')
mimic_iii
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, and I want to rank by the x-axis from low to high.
SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_name_53 ( total INTEGER, fa_cup INTEGER )
What is the highest total number of appearances when there were less than 4 at the FA cup?
SELECT MAX(total) FROM table_name_53 WHERE fa_cup < 4
sql_create_context
CREATE TABLE table_77529 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
How many reg GP for rick vaive in round 1?
SELECT SUM("Reg GP") FROM table_77529 WHERE "Player" = 'rick vaive' AND "Rd #" < '1'
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...
从2003年11月22日知道2014年7月17日这一段时间,陈恬美患者被开出的所有药品的编码是什么?名称是什么?数量是多少?单价是多少?金额是多少?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '陈恬美' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2003-11-22' AND '2014-07-17'
css
CREATE TABLE table_29688 ( "Currency" text, "Country" text, "Generic Name or Nickname" text, "Rating ( S&P / Moodys )" text, "Negotiable debt at mid-2005 ( US dollar bn equivalent)" real, "Government financial liabilities as % of GDP (end 2003 - source : OECD )" text, "Issuer" text, "Int...
Name the currency for negotiable debt being 1300
SELECT "Currency" FROM table_29688 WHERE "Negotiable debt at mid-2005 ( US dollar bn equivalent)" = '1300'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of patients whose diagnosis short title is obstructive sleep apnea and drug route is pr.
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 = "Obstructive sleep apnea" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
how many patients were prescribed with lorazepam in the same hospital visit after the diagnosis with bone fracture(s) - scapula?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bone fracture(s) - scapula') AS t1 JOIN (SELECT patient.uniquepid, medica...
eicu
CREATE TABLE table_51752 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the home team scored 25.23 (173), what date did they play/
SELECT "Date" FROM table_51752 WHERE "Home team score" = '25.23 (173)'
wikisql
CREATE TABLE table_12502 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
What was the result on September 20?
SELECT "Result" FROM table_12502 WHERE "Date" = 'september 20'
wikisql
CREATE TABLE table_31234 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
How many seed entries are there when points are 2175?
SELECT COUNT("Seed") FROM table_31234 WHERE "Points" = '2175'
wikisql
CREATE TABLE table_name_7 ( socket VARCHAR, voltage VARCHAR, frequency VARCHAR, release_date VARCHAR )
What is the socket related to the processor released on June 22, 2005, having a frequency of 1600MHz and voltage under 1.35V?
SELECT socket FROM table_name_7 WHERE frequency = "1600mhz" AND release_date = "june 22, 2005" AND voltage < 1.35
sql_create_context
CREATE TABLE table_4281 ( "Umpire" text, "Country" text, "Panel" text, "Matches" real, "WC Matches" real, "2011 WC" real )
who was the umpire when the wc match was 10
SELECT "Umpire" FROM table_4281 WHERE "WC Matches" = '10'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
did patient 006-122587 had urinary catheter output: indwelling/continuous ure output in 09/this year?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122587')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutp...
eicu
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
specify the age and marital status of patient id 66411
SELECT demographic.marital_status, demographic.age FROM demographic WHERE demographic.subject_id = "66411"
mimicsql_data
CREATE TABLE table_name_51 ( Id VARCHAR )
Which 2010 has a 2006 of w?
SELECT 2010 FROM table_name_51 WHERE 2006 = "w"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
通过对5643321号医院在00年8月28号到21年1月1号里的检验报告单的分析,在不同检测指标名称以及不同检测指标结果定量单位条件下,将检测指标结果定量的平均值降序排列后的结果如何?
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '5643321' AND BGRQ BETWEEN '2000-08-28' AND '2021-01-18' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) DESC
css
CREATE TABLE table_22481967_1 ( status VARCHAR, operator VARCHAR )
List the status for the operator Toronto transit commission.
SELECT status FROM table_22481967_1 WHERE operator = "Toronto Transit Commission"
sql_create_context
CREATE TABLE table_36400 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text )
What is the date of the Paul Revere 250 race in the Daytona International Speedway circuit?
SELECT "Date" FROM table_36400 WHERE "Circuit" = 'daytona international speedway' AND "Race" = 'paul revere 250'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER...
Show all the activity names and the number of faculty involved in each activity in a bar chart.
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid
nvbench
CREATE TABLE table_59622 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Tiger Woods' to par?
SELECT "To par" FROM table_59622 WHERE "Player" = 'tiger woods'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, ...
give me the flights from MEMPHIS TENNESSEE to CHARLOTTE NORTH CAROLINA
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, state AS STATE_0, state AS STATE_1 WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city...
atis
CREATE TABLE table_70006 ( "Nat." text, "Name" text, "Since" real, "App(GS/Sub)" text, "Goals" real, "Transfer fee" text )
Tell what has the App(GS/Sub) of 14 (8/6)
SELECT "Name" FROM table_70006 WHERE "App(GS/Sub)" = '14 (8/6)'
wikisql
CREATE TABLE table_890 ( "District" real, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Opponent" text )
what's the district with party being republican and elected being 1998
SELECT "District" FROM table_890 WHERE "Party" = 'Republican' AND "Elected" = '1998'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id n...
whats the price for a lymphocytes, percent?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lymphocytes, percent'))
mimic_iii
CREATE TABLE table_name_55 ( score VARCHAR, december VARCHAR )
Can you tell me the Score that has the December of 10?
SELECT score FROM table_name_55 WHERE december = 10
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
Most disliked users by square-sum of their downvoted posts.
SELECT OwnerUserId AS "user_link", -SQRT(1.0 * SUM(Score * Score)) AS DownSqrtSum FROM Posts WHERE Score < 0 AND OwnerUserId > 0 GROUP BY Posts.OwnerUserId ORDER BY DownSqrtSum, OwnerUserId LIMIT 100
sede
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of code , and group by attribute founder, display y-axis in ascending order please.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_28138035_15 ( womens_singles VARCHAR, mens_singles VARCHAR )
Who won Womens Singles in the year that Ma Lin won Mens Singles?
SELECT womens_singles FROM table_28138035_15 WHERE mens_singles = "Ma Lin"
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...
患者10580420所做的检验报告中有哪些报告对应的检验结果指标均正常?列出检验报告单号即可
SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '10580420' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_203_330 ( id number, "year of election" number, "candidates elected" number, "# of seats available" number, "# of votes" number, "% of popular vote" text )
what was the largest number of votes ?
SELECT MAX("# of votes") FROM table_203_330
squall
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...
根据入院诊断的疾病名称,列出不同疾病的患者的平均年龄在医院0907445中分别是多少?
SELECT t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0907445' GROUP BY t_kc21.IN_DIAG_DIS_NM
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
what is maximum age of patients whose ethnicity is black/african american and age is greater than or equal to 44?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age >= "44"
mimicsql_data
CREATE TABLE table_10989 ( "Locomotive superintendent" text, "GNoSR Class" text, "LNER class" text, "Quantity Built" real, "Passed to LNER" real, "Manufacturer" text, "Date introduced" text )
Which LNER class has been Passed to LNER larger than 3 and a introduced in 1895 98?
SELECT "LNER class" FROM table_10989 WHERE "Passed to LNER" > '3' AND "Date introduced" = '1895–98'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
how many patients whose admission location is phys referral/normal deli and drug code is dilt30?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.formulary_drug_cd = "DILT30"
mimicsql_data