context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_28408 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Football?" text, "Joined" real )
What is every type for the location of Roanoke, Virginia?
SELECT "Type" FROM table_28408 WHERE "Location" = 'Roanoke, Virginia'
wikisql
CREATE TABLE table_29970488_2 ( year VARCHAR, _number VARCHAR )
What year was player number 10?
SELECT year FROM table_29970488_2 WHERE _number = 10
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
until 4 years ago, what was the minimum monthly number of patients diagnosed with fx metatarsal-closed?
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fx metatarsal-closed') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-4 year') GR...
mimic_iii
CREATE TABLE table_name_89 ( attendance VARCHAR, home VARCHAR )
How many people were in attendance when the home shows as Bulls?
SELECT COUNT(attendance) FROM table_name_89 WHERE home = "bulls"
sql_create_context
CREATE TABLE table_15306124_1 ( league_of_communists INTEGER, municipality VARCHAR )
What is the least amount of league of communists where municipality is mojkovac
SELECT MIN(league_of_communists) FROM table_15306124_1 WHERE municipality = "Mojkovac"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code tex...
i'd like to see the flights from PITTSBURGH to PHILADELPHIA
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHI...
atis
CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_year int ) CREATE TABLE browser ( id int, name text, market_share real ) CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connectio...
Visualize a bar chart for what are the ids and names of the web accelerators that are compatible with two or more browsers?
SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id
nvbench
CREATE TABLE table_58883 ( "Perpetrator" text, "Date" text, "Year" real, "Location" text, "Country" text, "Killed" real, "Injured" text, "Additional Notes" text )
On what Date did the massacre result with 21 Injured?
SELECT "Date" FROM table_58883 WHERE "Injured" = '21'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
Is there a section of ECON 299 that is after 09:45 P.M. ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '09:45' AND course.course_id = course_offering.course_id AND course.department = 'ECON' AND course.number = 299 AND semester.semester = 'WN' AND ...
advising
CREATE TABLE table_name_4 ( category VARCHAR, finish VARCHAR )
Which category had an orange finish?
SELECT category FROM table_name_4 WHERE finish = "orange"
sql_create_context
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 zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zy...
css
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...
把患者08802995在零四年五月二十日到一六年七月八日内被开出药品486015771的总次数统计一下
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '08802995' AND t_kc22.STA_DATE BETWEEN '2004-05-20' AND '2016-07-08' AND t_kc22.SOC_SRT_DIRE_CD = '486015771' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHE...
css
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 ...
病患何嘉悦在02年4月18日到2020年5月25日内所有的检验结果指标记录中检测人是冯婉娜时检验指标流水号是多少?
(SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM =...
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
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, for department_id, hire_date, visualize the trend, I want to sort by the X-axis from low to high.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
what was the name of the specimen test patient 031-1337 received in 05/this year for the first time?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND DATETIME(microlab.culturetakentime, 'start of year') =...
eicu
CREATE TABLE table_name_31 ( position VARCHAR, cfl_team VARCHAR )
Can you tell me the Position that has the CFL Team of toronto?
SELECT position FROM table_name_31 WHERE cfl_team = "toronto"
sql_create_context
CREATE TABLE table_name_67 ( club VARCHAR, date_of_appointment VARCHAR )
Name the club with date of appointment of 1 november 2007
SELECT club FROM table_name_67 WHERE date_of_appointment = "1 november 2007"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
药品830847828-7医疗就诊43844138333中的使用频次和每次用量均为?
SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE 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 = '43844138333' AND t_kc22.SOC_SRT_DIRE_CD = '830847828-7'
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, h...
how many times was fus/refus 2-3 vertebrae performed until 2103?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'fus/refus 2-3 vertebrae') AND STRFTIME('%y', procedures_icd.charttime) <= '2103'
mimic_iii
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
count the number of patients who were prescribed with cefepime in the same hospital encounter after receiving a beta blocker - metoprolol procedure during a year before.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'beta blocker - metoprolol' AND DATETIME(treatment.treatmenttime, 'start o...
eicu
CREATE TABLE table_name_27 ( round VARCHAR, college VARCHAR )
What round did the College of Minnesota pick?
SELECT round FROM table_name_27 WHERE college = "minnesota"
sql_create_context
CREATE TABLE table_name_14 ( pick VARCHAR, round VARCHAR, team VARCHAR )
What was the pick for round 2 with the team Indianapolis Olympians?
SELECT pick FROM table_name_14 WHERE round = "2" AND team = "indianapolis olympians"
sql_create_context
CREATE TABLE table_6157 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team" text )
Who is the player from Round 3 from Russia?
SELECT "Player" FROM table_6157 WHERE "Round" = '3' AND "Nationality" = 'russia'
wikisql
CREATE TABLE table_72343 ( "Submitting country" text, "Film title used in nomination" text, "Original title" text, "Language(s)" text, "Director(s)" text, "Result" text )
What country submitted miehen ty ?
SELECT "Submitting country" FROM table_72343 WHERE "Original title" = 'Miehen työ'
wikisql
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 is the daily maximum of arterial bp [systolic] for patient 1205 since 1347 days ago?
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1205)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter...
mimic_iii
CREATE TABLE table_11190568_7 ( team VARCHAR, outgoing_manager VARCHAR )
Which team has the outgoing manager John Meyler?
SELECT team FROM table_11190568_7 WHERE outgoing_manager = "John Meyler"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
从01年3月9号到14年4月7号,患者姜和玉,836622这个指标怎么样
(SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_2367847_2 ( district_wide INTEGER, other_programs_ VARCHAR, _adjustments VARCHAR )
Name the most district wide for 1639 other programs
SELECT MAX(district_wide) FROM table_2367847_2 WHERE other_programs_ & _adjustments = 1639
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
calculate the number of medications that patient 002-75209 has been prescribed in 10/last 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 = '002-75209')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIM...
eicu
CREATE TABLE Customers ( Address_ID VARCHAR ) CREATE TABLE Addresses ( City_Town VARCHAR, Address_ID VARCHAR ) CREATE TABLE Performers ( Address_ID VARCHAR )
Show all cities where at least one customer lives in but no performer lives in.
SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID
sql_create_context
CREATE TABLE table_name_59 ( site VARCHAR, result VARCHAR )
At what Site was the Result W13-7?
SELECT site FROM table_name_59 WHERE result = "w13-7"
sql_create_context
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, ...
what is minimum age of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and year of death is less than 2138?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.dod_year < "2138.0"
mimicsql_data
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
Next semester will Prof. John Vandermeer teach 569 ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 569 AND instructor.name LIKE '%John Vandermeer%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering...
advising
CREATE TABLE table_203_282 ( id number, "date" text, "racecourse" text, "distance" text, "race status" text, "race" text, "position" text, "winning distance (lengths)" number, "jockey" text, "rating" number, "going" text, "odds" text, "prize money" text )
previous to july 6 , 2004 what is the highest prize money ?
SELECT MAX("prize money") FROM table_203_282 WHERE id < (SELECT id FROM table_203_282 WHERE "date" = 'july 6, 2004')
squall
CREATE TABLE table_204_170 ( id number, "player" text, "position" text, "games\nstarted" text, "hometown" text, "height" text, "weight" number, "age" number )
what is the number of games that lawrence roehm started in ?
SELECT "games\nstarted" FROM table_204_170 WHERE "player" = 'lawrence roehm'
squall
CREATE TABLE table_204_650 ( id number, "season" number, "level" number, "name" text, "position" text, "nationality" text, "international\ncaps" number )
who was the only player from new zealand to be player of the year ?
SELECT "name" FROM table_204_650 WHERE "nationality" = 'new zealand'
squall
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayNa...
High-Rep Users with only one post.
SELECT 'site://users/' + CAST(u.Id AS TEXT) + '|' + CAST(u.DisplayName AS TEXT) AS "user", u.Reputation, COUNT(p.Id) FROM Users AS u, Posts AS p WHERE u.Reputation > 10000 AND u.Id = p.OwnerUserId AND (p.PostTypeId = 1 OR p.PostTypeId = 2) GROUP BY u.Id, u.DisplayName, u.Reputation HAVING COUNT(p.Id) = 1 ORDER BY u.Rep...
sede
CREATE TABLE table_203_555 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
who won the most money ?
SELECT "player" FROM table_203_555 ORDER BY "money ($)" DESC LIMIT 1
squall
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status VARCHAR(15), order_date DATETIME, order_details VARCHAR(255) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_address_from DATETIME, address_type VARCHAR(15), date...
A bar chart for finding the number of the 'date became customers' of the customers whose ID is between 10 and 20.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20
nvbench
CREATE TABLE table_name_32 ( lost VARCHAR, played VARCHAR, points VARCHAR )
What is the lost number when the team played 26 games and there were 83 points?
SELECT lost FROM table_name_32 WHERE played = "26" AND points = "83"
sql_create_context
CREATE TABLE table_8552 ( "Name" text, "Height m / ft" text, "Floors" real, "Year" real, "Notes" text )
How many years have a Name of tour quartier des spectacles, and Floors smaller than 31?
SELECT COUNT("Year") FROM table_8552 WHERE "Name" = 'tour quartier des spectacles' AND "Floors" < '31'
wikisql
CREATE TABLE table_4079 ( "Player" text, "Games" real, "Field goals" real, "Free throws" real, "Points" real, "Points per game" text )
How many points per game did Jack Williams score?
SELECT COUNT("Points per game") FROM table_4079 WHERE "Player" = 'Jack Williams'
wikisql
CREATE TABLE table_29900 ( "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 score when the team is milwaukee?
SELECT "Score" FROM table_29900 WHERE "Team" = 'Milwaukee'
wikisql
CREATE TABLE table_228149_1 ( bruce_coulter_award VARCHAR, game VARCHAR )
Nam the total number for bruce coulter award for 9th game
SELECT COUNT(bruce_coulter_award) FROM table_228149_1 WHERE game = "9th"
sql_create_context
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credi...
What is the quantity of upper-level classes that are 9 credits ?
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 9 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_name_40 ( average_population__x_1000_ INTEGER, deaths VARCHAR, crude_death_rate__per_1000_ VARCHAR )
What is the average population when deaths are 3 557 and crude death date is less than 11.9?
SELECT AVG(average_population__x_1000_) FROM table_name_40 WHERE deaths = "3 557" AND crude_death_rate__per_1000_ < 11.9
sql_create_context
CREATE TABLE table_204_435 ( id number, "sport" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the number of gold medals won in the rowing category ?
SELECT "gold" FROM table_204_435 WHERE "sport" = 'rowing'
squall
CREATE TABLE table_name_9 ( games_played INTEGER, fumbles VARCHAR, receptions VARCHAR, games_started VARCHAR )
What are the highest number of games played that had game starts of 10, receptions of 6 and fumbles smaller than 3?
SELECT MAX(games_played) FROM table_name_9 WHERE receptions = 6 AND games_started = 10 AND fumbles < 3
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId...
Find questions migrated from a particular site. Only selects questions that have never been closed.
SELECT PostId AS "post_link", Score, AnswerCount, CASE WHEN NOT AcceptedAnswerId IS NULL THEN ' ' ELSE '' END AS HasAccepted FROM PostHistory LEFT JOIN Posts ON PostHistory.PostId = Posts.Id WHERE Posts.PostTypeId = 1 AND Posts.ClosedDate IS NULL AND PostHistoryTypeId = 36 AND Comment LIKE 'from %' + '##site:string##' ...
sede
CREATE TABLE table_22883210_9 ( location_attendance VARCHAR, team VARCHAR )
What was the location and how many attended when Golden State played?
SELECT location_attendance FROM table_22883210_9 WHERE team = "Golden State"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
Will Kaia Olson teach 817 again ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 817 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Kaia Olson%' AND offering_instructor.instruct...
advising
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
Tell me about ANATOMY 541 .
SELECT DISTINCT description, name FROM course WHERE department = 'ANATOMY' AND number = 541
advising
CREATE TABLE table_42198 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What was the Difference of the Team that had a Position less than 2?
SELECT "Difference" FROM table_42198 WHERE "Position" < '2'
wikisql
CREATE TABLE table_50400 ( "Pick" real, "Player" text, "Nationality" text, "New WNBA Team" text, "Former WNBA Team" text, "College/Country/Team" text )
Which player was picked after 23?
SELECT "Player" FROM table_50400 WHERE "Pick" > '23'
wikisql
CREATE TABLE table_12838 ( "Name" text, "No. Specimens" real, "Abbr." text, "Country" text, "City" text )
In which city is the Universidad de Santiago de Compostela located?
SELECT "City" FROM table_12838 WHERE "Name" = 'universidad de santiago de compostela'
wikisql
CREATE TABLE table_name_86 ( result VARCHAR, game VARCHAR )
Which Result has a Game of game 1?
SELECT result FROM table_name_86 WHERE game = "game 1"
sql_create_context
CREATE TABLE table_name_10 ( intellitrace VARCHAR, extensions VARCHAR, windows_phone_development VARCHAR )
Which Intelli Trace has a No Extension and Windows Phone development of no?
SELECT intellitrace FROM table_name_10 WHERE extensions = "no" AND windows_phone_development = "no"
sql_create_context
CREATE TABLE table_name_54 ( score VARCHAR, player VARCHAR )
What did Steve Stricker score?
SELECT score FROM table_name_54 WHERE player = "steve stricker"
sql_create_context
CREATE TABLE table_41339 ( "Week" real, "Date" text, "Time" text, "Opponent" text, "Result" text, "Game site" text, "NFL Recap" text, "Record" text )
What is the Record for week 12?
SELECT "Record" FROM table_41339 WHERE "Week" = '12'
wikisql
CREATE TABLE table_25355501_2 ( november_3 VARCHAR, january_15_16 VARCHAR )
How many entries are shown for november 3 when january 15-16 is 141?
SELECT COUNT(november_3) FROM table_25355501_2 WHERE january_15_16 = "141"
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...
病人21348966药品均价低于4552.52元在哪几次医疗记录中被开出的?列出医疗就诊编号都是多少?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '21348966' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4552.52)
css
CREATE TABLE table_78559 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What was the To par of the golfer that placed t5?
SELECT "To par" FROM table_78559 WHERE "Place" = 't5'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
list the three most frequent diagnoses with which patients were diagnosed within 2 months after receiving endovasc embol hd/nk ves since 2105.
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
get the number of newborn type admission patients who were admitted before 2157.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2157"
mimicsql_data
CREATE TABLE table_69357 ( "Engine" text, "Displacement" text, "Power" text, "Torque" text, "Redline" real, "Year" real )
Power of 220kw (299hp) @ 4000 has what torque?
SELECT "Torque" FROM table_69357 WHERE "Power" = '220kw (299hp) @ 4000'
wikisql
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
42924157患者从2004年8月9日至2009年2月15日之内最常去哪家医院?
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '42924157' AND qtb.IN_HOSP_DATE BETWEEN '2004-08-09' AND '2009-02-15' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '42924157' AND gyb.IN_HOSP_DATE BETWEEN '2004-08-09' AND '2009-02-15' G...
css
CREATE TABLE table_30297 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
What is the production code for 'chuck versus the balcony'?
SELECT "Production code" FROM table_30297 WHERE "Title" = 'Chuck Versus the Balcony'
wikisql
CREATE TABLE table_26321719_1 ( area__km²_ VARCHAR, population_density VARCHAR )
What is every value for area for population density of 100.8?
SELECT area__km²_ FROM table_26321719_1 WHERE population_density = "100.8"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
负责医疗就诊43416366229里面的费用明细项目09851232608的医疗机构科室编码是什么?名称是什么?
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '09851232608'
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
tell me the name of the drug that patient 016-9636 was first prescribed through the intradermal route in their current hospital visit?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636' AND patient.hospitaldischargetime IS NULL)) AND medicatio...
eicu
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
282 can be taken when ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 282 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste...
advising
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...
list the number of patients who stayed in the hospital for more than 2 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "2"
mimicsql_data
CREATE TABLE table_name_93 ( attendance INTEGER, round VARCHAR )
What is the highest attendance among Group E games?
SELECT MAX(attendance) FROM table_name_93 WHERE round = "group e"
sql_create_context
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, ...
自01年4月8日起,截止到11年9月20日,查一下患者李晴画在医疗机构4822306的门诊看过多少次病
SELECT COUNT(*) 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 txmzjzjlb.JZKSRQ BETWEEN '2001-04-08' AND '2011-09-20' AND txmzjzjlb.YLJGDM = '4822306' UNI...
css
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Comments ( Id number, PostId number, ...
Top questions with zero answers since Jan 2016.
SELECT p.Id AS "post_link", Title, p.Tags AS Tags, p.ViewCount AS "Views", p.Score AS "Score", p.AnswerCount AS "Answers", DATEDIFF(day, p.CreationDate, GETDATE()) AS "Age (days)", p.AcceptedAnswerId AS "Answer Accepted?" FROM Posts AS p WHERE p.AcceptedAnswerId IS NULL AND p.CreationDate >= '20160101' AND p.AnswerCoun...
sede
CREATE TABLE table_name_37 ( date_of_vacancy VARCHAR, team VARCHAR )
What is Aberdeen team's date of vacancy?
SELECT date_of_vacancy FROM table_name_37 WHERE team = "aberdeen"
sql_create_context
CREATE TABLE table_12883 ( "Season" text, "Level" text, "Goals" text, "Points" real, "Domestic Cup" text )
What is the level when points are larger than 25, and goals are 64 31?
SELECT "Level" FROM table_12883 WHERE "Points" > '25' AND "Goals" = '64–31'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
在患者陶歌韵的诊疗记录里,从02年8月1日到10年6月21日这期间,为其检测游离甲状腺素(三代)的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_train_70 ( "id" int, "pregnancy_or_lactation" bool, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "mean_arterial_pressure_map" int, "temperature" float, "oliguria" bool, "surgery" bool, "heart_rate" int, "systemic_inflammatory_response" b...
patients with suspected or proven infection and 2 of the following 6 criteria: body temperature < 36 or > 38.3 celsius ; heart rate > 90 beats / min ; tachypnea > 20 / min or a arterial paco2 below 4.25 kpa ; white blood cell count higher than 12000 or below 4000 or more than 10 % immature forms ; systolic blood pressu...
SELECT * FROM table_train_70 WHERE (CASE WHEN temperature < 36 OR temperature > 38.3 THEN 1 ELSE 0 END + CASE WHEN heart_rate > 90 THEN 1 ELSE 0 END + CASE WHEN respiratory_rate > 20 OR paco2 < 4.25 THEN 1 ELSE 0 END + CASE WHEN white_blood_cell_count_wbc > 12000 OR white_blood_cell_count_wbc < 4000 OR immature_form > ...
criteria2sql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
how many current patients are of age 40s?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 40 AND 49
eicu
CREATE TABLE table_42393 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real )
How many draws correspond to more than 11 losses in a match less than 14?
SELECT COUNT("Draw") FROM table_42393 WHERE "Lost" > '11' AND "Match" < '14'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate ...
How many stackexchange non-meta sites are there?.
SELECT * FROM sys.databases WHERE (NOT name LIKE '%.Meta' OR name = 'StackExchange.Meta') AND database_id > 5
sede
CREATE TABLE table_17330069_1 ( fin_pos INTEGER, grid VARCHAR )
If grid is 2, what is the minimum fin. pos number?
SELECT MIN(fin_pos) FROM table_17330069_1 WHERE grid = 2
sql_create_context
CREATE TABLE table_21856 ( "Episode" real, "Original title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Duration" text, "Viewership" text )
What is the total length when the title is ' one man's junk
SELECT COUNT("Duration") FROM table_21856 WHERE "Original title" = ' One Man''s Junk '
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
how many hours has it been since patient 92788's first late effect cv dis nec diagnosis in the current hospital encounter.
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late effect cv dis nec') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admi...
mimic_iii
CREATE TABLE table_24749 ( "Country" text, "Area (000s)" text, "1950 (mil)" text, "1970 (mil)" text, "1980 (mil)" text, "1985 (mil)" text, "Annual Growth (1950\u20131985)" text, "Density (1980)" text )
Name the country for 37.23 1985
SELECT "Country" FROM table_24749 WHERE "1985 (mil)" = '37.23'
wikisql
CREATE TABLE table_35468 ( "Stage" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text )
What is the general classification with riccardo ricc as the young rider classification?
SELECT "General classification" FROM table_35468 WHERE "Young rider classification" = 'riccardo riccò'
wikisql
CREATE TABLE table_name_80 ( lane INTEGER, heat VARCHAR, name VARCHAR )
What is the average lane racheal nachula has when the heat is less than 2?
SELECT AVG(lane) FROM table_name_80 WHERE heat < 2 AND name = "racheal nachula"
sql_create_context
CREATE TABLE table_28416 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Rank (week)" text, "Original air date" text, "Production code" text )
What numbered episode had 11.96 million US viewers?
SELECT MAX("No.") FROM table_28416 WHERE "U.S. viewers (million)" = '11.96'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid n...
what's the total number of patients in ward 39 since 2101?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 39 AND STRFTIME('%y', transfers.intime) >= '2101')
mimic_iii
CREATE TABLE table_name_28 ( home_team VARCHAR, venue VARCHAR )
What's the home team for the junction oval venue?
SELECT home_team AS score FROM table_name_28 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_name_19 ( team VARCHAR, pick VARCHAR )
what is the team that is pick 31?
SELECT team FROM table_name_19 WHERE pick = 31
sql_create_context
CREATE TABLE table_57114 ( "College Name" text, "Location" text, "District" text, "Affiliation" text, "Estd" text )
What is the location of the tiruchirappalli district?
SELECT "Location" FROM table_57114 WHERE "District" = 'tiruchirappalli district'
wikisql
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 whose admission year is less than 2105 and diagnoses long title is stevens-johnson syndrome-toxic epidermal necrolysis overlap syndrome?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2105" AND diagnoses.long_title = "Stevens-Johnson syndrome-toxic epidermal necrolysis overlap syndrome"
mimicsql_data
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous...
All tags of a given site.
SELECT t.TagName, t.Count, p1.Body, p2.Body FROM "superuser".dbo.Tags AS t LEFT JOIN "superuser".dbo.Posts AS p1 ON p1.Id = t.ExcerptPostId LEFT JOIN "superuser".dbo.Posts AS p2 ON p2.Id = t.WikiPostId ORDER BY t.Count DESC
sede
CREATE TABLE table_34354 ( "Season" text, "Player" text, "Position" text, "Nationality" text, "Team" text )
What team has Steinar Kaldal, a guard / forward?
SELECT "Team" FROM table_34354 WHERE "Position" = 'guard / forward' AND "Player" = 'steinar kaldal'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
how many hours has been passed since the first time patient 8888 stayed in careunit tsicu in their current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_43358 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What is the Opponent when Todd Woodbridge was the runner-up, and a Date of 26 august 1996?
SELECT "Opponent" FROM table_43358 WHERE "Outcome" = 'runner-up' AND "Date" = '26 august 1996'
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, return a bar chart about the distribution of name and the average of price , and group by attribute name, and rank Name from low to high order.
SELECT T2.Name, T1.Price 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_77880 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
Tell me the manner of departure for 3 january date of appointment
SELECT "Manner of departure" FROM table_77880 WHERE "Date of appointment" = '3 january'
wikisql