context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_17025328_1 ( year__ceremony_ VARCHAR, original_title VARCHAR )
Name the year for les portes tournantes
SELECT year__ceremony_ FROM table_17025328_1 WHERE original_title = "Les portes tournantes"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
Tag names / wikis / excerpts containing certain words.
SELECT t.TagName, 'Tag', '' FROM Tags AS t WHERE t.TagName LIKE '%' + '##query:string##' + '%' COLLATE sql_latin1_general_cp1_ci_ai UNION ALL SELECT t.TagName, 'Excerpt', p.Body FROM Tags AS t INNER JOIN Posts AS p ON p.Id = t.ExcerptPostId WHERE p.Body LIKE '%' + '##query:string##' + '%' COLLATE sql_latin1_general_cp1...
sede
CREATE TABLE table_name_90 ( district VARCHAR, first_elected VARCHAR, party VARCHAR, results VARCHAR )
What Republican District had Incumbent First Elected in 2000 then Re-elected?
SELECT district FROM table_name_90 WHERE party = "republican" AND results = "re-elected" AND first_elected = 2000
sql_create_context
CREATE TABLE procedures ( 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, ...
how many patients stayed in hospital for more than 7 days and were diagnosed with suicidal ideation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.long_title = "Suicidal ideation"
mimicsql_data
CREATE TABLE table_name_18 ( home VARCHAR, date VARCHAR )
WHich Home is on 14 december 2002?
SELECT home FROM table_name_18 WHERE date = "14 december 2002"
sql_create_context
CREATE TABLE table_name_9 ( rally_hq VARCHAR, round VARCHAR )
Where was the Rally HQ for Round 1?
SELECT rally_hq FROM table_name_9 WHERE round = 1
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, econ...
i need information on a flight from BOSTON 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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER'...
atis
CREATE TABLE procedures ( 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 diagnoses short title is status-post ptca and drug route is dialys?
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 = "Status-post ptca" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Descript...
Show the correlation between statement id and account detail in a scatter chart.
SELECT T1.Statement_ID, T1.Account_Details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID
nvbench
CREATE TABLE classification ( id int, msid int, gid int ) CREATE TABLE keyword ( id int, keyword text ) CREATE TABLE genre ( gid int, genre text ) CREATE TABLE tags ( id int, msid int, kid int ) CREATE TABLE actor ( aid int, gender text, name text, nationality...
What are the movies related to nuclear weapons
SELECT movie.title FROM keyword, movie, tags WHERE keyword.keyword = 'nuclear weapons' AND tags.kid = keyword.id AND tags.msid = movie.mid
imdb
CREATE TABLE table_name_71 ( visitor VARCHAR, record VARCHAR )
Which Visitor has a Record of 9 12 5?
SELECT visitor FROM table_name_71 WHERE record = "9–12–5"
sql_create_context
CREATE TABLE table_1481865_1 ( title__original_ VARCHAR, number_of_season VARCHAR )
What is the original title of season number 3?
SELECT title__original_ FROM table_1481865_1 WHERE number_of_season = 3
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
医院9033547全部医疗记录的医疗费总额与个人账户支出的平均比值为多少在07年11月19日到17年2月7日内?
SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9033547' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-11-19' AND '2017-02-07'
css
CREATE TABLE table_name_4 ( title VARCHAR, studio VARCHAR )
What is the title of Buena Vista Pictures?
SELECT title FROM table_name_4 WHERE studio = "buena vista pictures"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
Specify the maximum age of patients who were admitted to the hospital in or after the year 2187 and stayed for 34 days
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "34" AND demographic.admityear >= "2187"
mimicsql_data
CREATE TABLE table_name_99 ( to_par VARCHAR, country VARCHAR )
What is the To Par score for the player from France?
SELECT to_par FROM table_name_99 WHERE country = "france"
sql_create_context
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 death status is 0 and procedure short title is aortocor bypas-2 cor art?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Aortocor bypas-2 cor art"
mimicsql_data
CREATE TABLE table_name_4 ( winner VARCHAR, last_16 VARCHAR )
Which Winner has a Last 16 of 400?
SELECT winner FROM table_name_4 WHERE last_16 = "£400"
sql_create_context
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
For days had a minimum dew point smaller than any day in zip code 94107, show the total number of such days using a bar chart.
SELECT date, COUNT(date) FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) GROUP BY date
nvbench
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
Total question views by user reputation.
WITH ViewTotals AS (SELECT u.Reputation, SUM(CAST(p.ViewCount AS INT)) AS ViewCount FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 GROUP BY u.Reputation) SELECT v1.Reputation * 100.0 / @MaxReputation, SUM(v2.ViewCount) * 100.0 / @TotalViews FROM ViewTotals AS v1 INNER JOIN ViewTota...
sede
CREATE TABLE table_25603 ( "No." real, "Season" real, "Bowler" text, "Batsmen" text, "For" text, "Against" text, "Ground" text, "Scorecard" text )
What is the number when against is rajasthan royals?
SELECT MAX("No.") FROM table_25603 WHERE "Against" = 'Rajasthan Royals'
wikisql
CREATE TABLE table_33642 ( "Season" real, "Series Name" text, "Champion" text, "Races \u2020" text, "Pole Positions" text, "Wins" text, "Podiums" text, "Fastest Laps" text, "Points" text, "Margin (pts)" text )
What is the number of podiums for the races of 13/15?
SELECT "Podiums" FROM table_33642 WHERE "Races \u2020" = '13/15'
wikisql
CREATE TABLE table_name_43 ( pole_position VARCHAR, date VARCHAR, fastest_lap VARCHAR, winning_driver VARCHAR )
Tell me the pole position for graham hill the fastest lap and winning driver of him on 30 may
SELECT pole_position FROM table_name_43 WHERE fastest_lap = "graham hill" AND winning_driver = "graham hill" AND date = "30 may"
sql_create_context
CREATE TABLE table_71528 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What was the value in 2008 when 2012 was 1R, 2010 was A, and 2005 was A?
SELECT "2008" FROM table_71528 WHERE "2012" = '1r' AND "2010" = 'a' AND "2005" = 'a'
wikisql
CREATE TABLE table_name_5 ( matches VARCHAR, win__percentage VARCHAR, drawn VARCHAR, lost VARCHAR )
Drawn smaller than 24, and a Lost smaller than 17, and a Win % smaller than 31.25 had how many total number of matches?
SELECT COUNT(matches) FROM table_name_5 WHERE drawn < 24 AND lost < 17 AND win__percentage < 31.25
sql_create_context
CREATE TABLE table_1706942_1 ( constructor VARCHAR, q1_order VARCHAR )
What is the constructor when the Q1 order is 4?
SELECT constructor FROM table_1706942_1 WHERE q1_order = 4
sql_create_context
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...
give me a good arabic on buchanan in san francisco ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_name_68 ( laps INTEGER, rider VARCHAR, grid VARCHAR )
What is the lowest Laps, when Rider is Sylvain Guintoli, and when Grid is less than 16?
SELECT MIN(laps) FROM table_name_68 WHERE rider = "sylvain guintoli" AND grid < 16
sql_create_context
CREATE TABLE table_train_31 ( "id" int, "allergy_to_insulin" bool, "active_infection" bool, "periodic_paralysis" bool, "receiving_continuous_intravenous_inotropic_support" bool, "age" float, "NOUSE" float )
suspected ( cultures drawn and antibiotic given ) or confirmed ( via culture results ) infection
SELECT * FROM table_train_31 WHERE active_infection = 1
criteria2sql
CREATE TABLE table_13491 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
what is the date when the attendance is more than 45,218, week is higher than 9 and result is w 17-10?
SELECT "Date" FROM table_13491 WHERE "Attendance" > '45,218' AND "Week" > '9' AND "Result" = 'w 17-10'
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, ...
what is the minimum hospital cost that involves the procedure known as stress ulcer prophylaxis - ranitidine since 2 years ago?
SELECT MIN(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 = 'stress ulcer prophylaxis - ranitidine')) AND...
eicu
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 demographic (...
provide the number of patients whose admission type is newborn and admission location is trsf within this facility?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_55761 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest Total that has a Gold larger than 0, Silver smaller than 4, Sport of football, and a Bronze larger than 1?
SELECT MIN("Total") FROM table_55761 WHERE "Gold" > '0' AND "Silver" < '4' AND "Sport" = 'football' AND "Bronze" > '1'
wikisql
CREATE TABLE table_name_53 ( moving_from VARCHAR, name VARCHAR, type VARCHAR, nat VARCHAR )
What's the moving of the Esp with a transfer and named De La Red?
SELECT moving_from FROM table_name_53 WHERE type = "transfer" AND nat = "esp" AND name = "de la red"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what were the four most frequent drugs that were prescribed in the same month to the valve replacement >= 7 days female patient with age 60 or above after having been diagnosed with valve replacement >= 7 days, until 2104?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valve replacement >= 7 days' AND STRFTIME('%y', di...
eicu
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 transfers ( row_id...
give me the length of stay of patient 28484 during his last stay in the icu.
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_60342 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
For what country does the golfer play who has a score of 72-65=137?
SELECT "Country" FROM table_60342 WHERE "Score" = '72-65=137'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在01年11月20日到2018年6月28日内,病患戚文栋自费金额高于7007.75元的药品量一共有多少?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚文栋' AND t_kc22.STA_DATE BETWEEN '2001-11-20' AND '2018-06-28' AND t_kc22.SELF_PAY_AMO > 7007.75
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and manager_id , and order by the FIRST_NAME in descending.
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC
nvbench
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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
列出患者吴兰若的检验报告单日期在2008年7月26日之后所对应的门诊就诊的流水号
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '吴兰若' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2008-07-2...
css
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...
对于医疗费总额不少于9872.67元的患者朱同和的医疗记录,列出出院诊断疾病编码是什么?名称是什么?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '朱同和' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9872.67)
css
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
门诊诊断患者为过敏性皮炎,他们的籍贯代码是什么?名称是什么?相应人数是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE table_33120 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What week has an attended smaller than 62,723 on October 22, 1961?
SELECT AVG("Week") FROM table_33120 WHERE "Attendance" < '62,723' AND "Date" = 'october 22, 1961'
wikisql
CREATE TABLE table_name_31 ( hometown VARCHAR, height VARCHAR )
What is the hometown of the player which has a height of 6-0?
SELECT hometown FROM table_name_31 WHERE height = "6-0"
sql_create_context
CREATE TABLE table_name_39 ( score VARCHAR, result VARCHAR )
What is the score of the match with a 4-0 result?
SELECT score FROM table_name_39 WHERE result = "4-0"
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 hz_info ( KH text, KLX number...
从二0一六年十二月八日到二0二0年十二月二十九日,患者79918177的所有检验结果指标记录中的检测方法共有多少种,给全部列出来
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '79918177' AND jyjgzbb.JYRQ BETWEEN '2016-12-08' ...
css
CREATE TABLE table_name_36 ( losses VARCHAR, byes INTEGER )
What is the total number of losses where the byes were greater than 0?
SELECT COUNT(losses) FROM table_name_36 WHERE byes > 0
sql_create_context
CREATE TABLE table_34367 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
What was the Result on Week 3?
SELECT "Result" FROM table_34367 WHERE "Week" = '3'
wikisql
CREATE TABLE table_name_93 ( venue VARCHAR, winners VARCHAR, year VARCHAR, score VARCHAR )
WHICH Venue IS after 1992 with a Score of 1 0 and a Winners of us chaouia?
SELECT venue FROM table_name_93 WHERE year > 1992 AND score = "1 – 0" AND winners = "us chaouia"
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 patients are below 41 years of age and tested with joint fluid in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_73745 ( "Position" real, "Driver" text, "Points" real, "Winnings" text, "Series" text )
In what position was the driver who won $60,000?
SELECT MIN("Position") FROM table_73745 WHERE "Winnings" = '$60,000'
wikisql
CREATE TABLE table_37844 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text )
What try bonus has 18 as the played of and 204 as the points?
SELECT "Try bonus" FROM table_37844 WHERE "Played" = '18' AND "Points for" = '204'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
when was the first time since 2102 that patient 52598 was discharged from the hospital?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 52598 AND STRFTIME('%y', admissions.dischtime) >= '2102' ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_2679061_4 ( player VARCHAR, nhl_team VARCHAR )
Which player was drafted by the Minnesota North Stars?
SELECT player FROM table_2679061_4 WHERE nhl_team = "Minnesota North Stars"
sql_create_context
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device...
What are the different software platforms for devices, and how many devices have each, sort in desc by the total number.
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_85 ( ratt VARCHAR, year VARCHAR )
In 1983, what was the RAtt?
SELECT ratt FROM table_name_85 WHERE year = "1983"
sql_create_context
CREATE TABLE table_name_66 ( e_score INTEGER, t_score VARCHAR, total VARCHAR )
What E score has the T score of 8 and a number smaller than 22.95?
SELECT MIN(e_score) FROM table_name_66 WHERE t_score = 8 AND total < 22.95
sql_create_context
CREATE TABLE table_name_14 ( record VARCHAR, date VARCHAR )
What is the Record for April 13?
SELECT record FROM table_name_14 WHERE date = "april 13"
sql_create_context
CREATE TABLE table_65052 ( "Driver" text, "Navigator" text, "Vehicle" text, "Class" text, "Capacity" real, "Total Time" text, "Margin" text )
Who was the driver of the vehicle having class of CM22 and navigator of Macneall?
SELECT "Driver" FROM table_65052 WHERE "Class" = 'cm22' AND "Navigator" = 'macneall'
wikisql
CREATE TABLE table_24204 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cowboys points" real, "Opponents" real, "Record" text )
How many opponents were there when the record was 6-0?
SELECT "Date" FROM table_24204 WHERE "Record" = '6-0'
wikisql
CREATE TABLE table_15410 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
Who is the Winner, when the City is Berlin?
SELECT "Winner" FROM table_15410 WHERE "City" = 'berlin'
wikisql
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NU...
Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, could you sort X in ascending order please?
SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" ORDER BY EMP_DOB
nvbench
CREATE TABLE table_name_56 ( comments VARCHAR, length_over_all VARCHAR )
Which Comments has a Length Over All of 4.5m?
SELECT comments FROM table_name_56 WHERE length_over_all = "4.5m"
sql_create_context
CREATE TABLE table_19651669_1 ( finalist VARCHAR, mvp VARCHAR )
Who was the finalist when the MVP was Romain Sato?
SELECT finalist FROM table_19651669_1 WHERE mvp = "Romain Sato"
sql_create_context
CREATE TABLE table_74286 ( "#" text, "Player" text, "Country" text, "Score" text, "To par" text, "Winnings ($)" real, "After" real, "Before" real )
What is the # listed when the score is 70-69-69-70=278?
SELECT "#" FROM table_74286 WHERE "Score" = '70-69-69-70=278'
wikisql
CREATE TABLE table_203_303 ( id number, "tribunal" text, "number of autos da fe" number, "executions in persona" number, "executions in effigie" number, "penanced" number, "total" number )
how many tribunals penanced at least 100 people ?
SELECT COUNT("tribunal") FROM table_203_303 WHERE "penanced" >= 100
squall
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment ...
i would like to leave thursday morning from INDIANAPOLIS to TORONTO
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 24 AND DATE_DAYalias0.month_number = 5 AND DATE_DAYalias0.year = 1991)) AND to...
atis
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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
有几个科室在2005年4月9日到2021年12月15日内医院6945213在门诊就诊中开出不少于3张检验报告单?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '6945213' AND jybgb.BGRQ BETWEEN '2005-04-09' AND '2021-12-15' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 3 UNION SELECT jybgb.KSBM FROM bdmzjzjlb J...
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName te...
Top 100 italian users on StackOverflow.
SELECT Id AS "user_link", DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Ital%' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE table_35653 ( "Year" real, "League" text, "Class" text, "Record" text, "Finish" text, "Manager" text, "Playoffs" text )
Manager of art griggs had what lowest year?
SELECT MIN("Year") FROM table_35653 WHERE "Manager" = 'art griggs'
wikisql
CREATE TABLE table_57106 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
What is the average PI GP of the player from round 5 with a pick # larger than 151?
SELECT AVG("Pl GP") FROM table_57106 WHERE "Rd #" = '5' AND "Pick #" > '151'
wikisql
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, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
名叫李向彤的病人所有检验结果指标记录中的检测方法在11年12月4日到21年12月17日内都有哪些?
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb....
css
CREATE TABLE table_name_32 ( results VARCHAR, category VARCHAR )
Which Results have a Category of the best new actor in lead role(female)?
SELECT results FROM table_name_32 WHERE category = "best new actor in lead role(female)"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is admission location and diagnoses icd9 code of subject id 2560?
SELECT demographic.admission_location, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_17 ( category VARCHAR )
Which car won the 1.4litre to 1.8litre award in 2001?
SELECT 2001 FROM table_name_17 WHERE category = "1.4litre to 1.8litre"
sql_create_context
CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year number, grade text ) CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year numbe...
Count the number of courses without prerequisites.
SELECT COUNT(*) FROM course WHERE NOT course_id IN (SELECT course_id FROM prereq)
spider
CREATE TABLE table_15167 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text )
What is the Termination of Mission with a Title of Ambassador Extraordinary and Plenipotentiary with a Representative of Reynold E. Carlson?
SELECT "Termination of Mission" FROM table_15167 WHERE "Title" = 'ambassador extraordinary and plenipotentiary' AND "Representative" = 'reynold e. carlson'
wikisql
CREATE TABLE table_49859 ( "Player" text, "Team" text, "Matches" real, "Innings" real, "Runs" real, "Average" real, "Highest Score" text, "100s" real )
What was the highest amount of runs for more than 5 matches?
SELECT MAX("Runs") FROM table_49859 WHERE "Matches" > '5'
wikisql
CREATE TABLE table_name_17 ( date VARCHAR, visitor VARCHAR )
What was the date of the game when St. Louis was the visiting team?
SELECT date FROM table_name_17 WHERE visitor = "st. louis"
sql_create_context
CREATE TABLE table_68670 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Name the engine when points are 0 and chassis is kuzma indy roadster for 1954
SELECT "Engine" FROM table_68670 WHERE "Points" = '0' AND "Chassis" = 'kuzma indy roadster' AND "Year" = '1954'
wikisql
CREATE TABLE table_19890 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What was segment C when segment D was fluorescent tubes?
SELECT "Segment C" FROM table_19890 WHERE "Segment D" = 'Fluorescent Tubes'
wikisql
CREATE TABLE table_6189 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text )
When has a Result of 0 2 and a Opponent of aberdeen?
SELECT "Date" FROM table_6189 WHERE "Result" = '0–2' AND "Opponent" = 'aberdeen'
wikisql
CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE director ( did int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE tv_series ( sid int, title text...
In what year was ' Kevin Spacey ' born ?
SELECT birth_year FROM writer WHERE name = 'Kevin Spacey'
imdb
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 ) ...
how many patients whose admission type is emergency and diagnoses long title is unspecified pleural effusion?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Unspecified pleural effusion"
mimicsql_data
CREATE TABLE table_27671 ( "Season" real, "Series" text, "Team Name" text, "Races" real, "Wins" real, "Points" text, "Final Placing" text )
How many races were there when Sigachev had 38 points?
SELECT MIN("Races") FROM table_27671 WHERE "Points" = '38'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
count the number of times patient 017-73567 had received an mechanical ventilation until 2104.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-73567')) AND treatment.treatmentname = 'mechanical ventilation' AND STRFTIME...
eicu
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId...
Find Stack Overflow Users in Vologda (with user links).
None
sede
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 ...
how many patients born before the year 1846 followed the catholic religion?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CATHOLIC" AND demographic.dob_year < "1846"
mimicsql_data
CREATE TABLE festival_detail ( Chair_Name VARCHAR, YEAR VARCHAR )
What are the names of the chairs of festivals, sorted in ascending order of the year held?
SELECT Chair_Name FROM festival_detail ORDER BY YEAR
sql_create_context
CREATE TABLE table_76803 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the attendance for week 2?
SELECT "Attendance" FROM table_76803 WHERE "Week" = '2'
wikisql
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, show me about the distribution of name and manufacturer , and group by attribute founder in a bar chart.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, find name and the sum of manufacturer , and group by attribute name, and visualize them by a bar chart, sort y-axis from high to low order.
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_28193 ( "Metropolitan ring" text, "Localities" real, "Total" real, "Jews and others 1" real, "Thereof: Jews" real, "Arabs" real, "Population density (per km\u00b2)" text, "Annual Population growth rate" text )
What is the arabs when the annual population growth rate is 1.7%?
SELECT "Arabs" FROM table_28193 WHERE "Annual Population growth rate" = '1.7%'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what is the maximum total cost for the hospital involving a procedure called nasogastric tube - with suction this year?
SELECT MAX(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 = 'nasogastric tube - with suction')) AND DATET...
eicu
CREATE TABLE table_name_95 ( tied VARCHAR, team VARCHAR, matches VARCHAR, lost VARCHAR )
Which Tied has Matches of 1, and a Lost of 0, and a Team of durham?
SELECT tied FROM table_name_95 WHERE matches = "1" AND lost = "0" AND team = "durham"
sql_create_context
CREATE TABLE table_name_8 ( squad_no INTEGER, name VARCHAR, league_goals VARCHAR )
WHAT IS THE AVERAGE SQUAD NUMBER WITH MARTIN SMITH, AND LEAGUE GOALS LESS THAN 17?
SELECT AVG(squad_no) FROM table_name_8 WHERE name = "martin smith" AND league_goals < 17
sql_create_context
CREATE TABLE table_28825 ( "Name" text, "Jewel" text, "Species" text, "Gender" text, "Jewel Power" text, "Attribute" text, "Birthday" text, "Media Debut" text, "Voice actor" text )
who was the voice actor when the species is hedgehog?
SELECT "Voice actor" FROM table_28825 WHERE "Species" = 'Hedgehog'
wikisql
CREATE TABLE table_8534 ( "Discipline" text, "Championship" text, "Circuit" text, "Event" text, "Session" text, "Cause" text )
What type of motorsport has a session of pre-race test?
SELECT "Discipline" FROM table_8534 WHERE "Session" = 'pre-race test'
wikisql
CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_state text, birth_city text, death_year text, death_month text, death_day text, death_country text, death_state text, death_city text, name_first tex...
What is the average age of players from USA?
SELECT AVG(death_year - birth_year) FROM player WHERE birth_country = "USA"
thehistoryofbaseball
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE prereq ( course_id va...
Find the maximum capacity among rooms in each building with a bar chart.
SELECT building, MAX(capacity) FROM classroom GROUP BY building
nvbench