context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
What is the number of divorced patients who had a free calcium lab test done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Free Calcium"
mimicsql_data
CREATE TABLE table_name_72 ( population INTEGER, area__km²_ VARCHAR )
What is the smallest population with an Area (km ) of 1115.4?
SELECT MIN(population) FROM table_name_72 WHERE area__km²_ = 1115.4
sql_create_context
CREATE TABLE table_name_43 ( institution VARCHAR, mascot VARCHAR )
Which Institution has a Mascot of broncbusters?
SELECT institution FROM table_name_43 WHERE mascot = "broncbusters"
sql_create_context
CREATE TABLE table_43149 ( "Date" text, "Tournament" text, "Location" text, "Home team" text, "Score" text, "Away team" text )
What is the location of 11 April 2013 and Mexico Home team?
SELECT "Location" FROM table_43149 WHERE "Home team" = 'mexico' AND "Date" = '11 april 2013'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is average age of patients whose primary disease is sepsis and age is greater than or equal to 72?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.age >= "72"
mimicsql_data
CREATE TABLE table_15353123_1 ( player VARCHAR, college VARCHAR )
Which player went to Pittsburg State
SELECT player FROM table_15353123_1 WHERE college = "Pittsburg State"
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...
count the number of patients whose death status is 1 and age is less than 70?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.age < "70"
mimicsql_data
CREATE TABLE table_4126 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which nationality has left wing as the position and college/junior/team is portland winterhawks (whl)?
SELECT "Nationality" FROM table_4126 WHERE "Position" = 'Left Wing' AND "College/junior/club team" = 'Portland Winterhawks (WHL)'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE code_description ( code varchar, description text ) C...
may i have a listing of flights from MINNEAPOLIS to LONG BEACH CALIFORNIA on tuesday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LONG BEACH' AND date_day.day_number = 22 AND date_day.month_number...
atis
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...
在患者卫光临的诊疗记录里,从04年6月8日到21年1月17日这期间,为其检测指标224990的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH =...
css
CREATE TABLE table_name_90 ( year INTEGER, game VARCHAR )
What is the earliest year that had the Legend of Zelda: Twilight Princess game?
SELECT MIN(year) FROM table_name_90 WHERE game = "the legend of zelda: twilight princess"
sql_create_context
CREATE TABLE gyb ( 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...
病人在医疗机构6778599就诊,异地来的有多少
SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6778599' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6778599' AND gyb.REMOTE_SETTLE_FLG = '异地1' OR gyb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(zyb.PERSON_ID...
css
CREATE TABLE genre ( gid int, genre text ) CREATE TABLE copyright ( id int, msid int, cid int ) CREATE TABLE directed_by ( id int, msid int, did int ) CREATE TABLE cast ( id int, msid int, aid int, role text ) CREATE TABLE movie ( mid int, title text, rele...
How many movies did ' Ronald Reagan ' act in ?
SELECT COUNT(DISTINCT (movie.title)) FROM actor, cast, movie WHERE actor.name = 'Ronald Reagan' AND cast.aid = actor.aid AND movie.mid = cast.msid
imdb
CREATE TABLE table_11252 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Home team Footscray's score?
SELECT "Home team score" FROM table_11252 WHERE "Home team" = 'footscray'
wikisql
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
count the numbers of patients who died after having been diagnosed with prim pulm hypertension during the same hospital visit since 2103.
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO...
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate...
how many patients passed away within 2 months after they were diagnosed with sec mal neo brain/spine this year?
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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_di...
mimic_iii
CREATE TABLE table_name_52 ( opponent VARCHAR, time VARCHAR )
Who was the opponent with the time 3:59?
SELECT opponent FROM table_name_52 WHERE time = "3:59"
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...
患者97780121被开出过金额在196.98元以下的医疗记录有哪几次?把医疗就诊编号列出来即可
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '97780121' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 196.98)
css
CREATE TABLE table_48901 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which Result has an Attendance of bye?
SELECT "Result" FROM table_48901 WHERE "Attendance" = 'bye'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_interval ( period text, begin_time int, end_ti...
okay for now i would like information on a flight on 4 27 from PITTSBURGH to ATLANTA leaving early in the morning about 800 o'clock
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((flight.departure_time <= 830 AND flight.departure_time >= 730) AND (flight.departure_time BETWEEN 0 AND 800)) AND date_day.day_number = 27 AN...
atis
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
show me the flights from DENVER 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE table_11110 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the lowest number of laps obtained by driver Nick Heidfeld?
SELECT MIN("Laps") FROM table_11110 WHERE "Driver" = 'nick heidfeld'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
what is average age of patients whose ethnicity is black/african american and age is greater than or equal to 41?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age >= "41"
mimicsql_data
CREATE TABLE table_15187735_4 ( netflix VARCHAR, series_ep VARCHAR )
What is the netflix code where the series and episode are 4-11?
SELECT netflix FROM table_15187735_4 WHERE series_ep = "4-11"
sql_create_context
CREATE TABLE table_65375 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Which Qual 1 has a Qual 2 of 59.822?
SELECT "Qual 1" FROM table_65375 WHERE "Qual 2" = '59.822'
wikisql
CREATE TABLE table_63690 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "React" real, "Time" real )
What is the total react number with a time less than 20.05 and a lane less than 6?
SELECT COUNT("React") FROM table_63690 WHERE "Time" < '20.05' AND "Lane" < '6'
wikisql
CREATE TABLE table_6102 ( "Celebrity" text, "Known for" text, "Entered" text, "Exited" text, "Finished" text )
What was Freddie Starr, who entered on Day 1, known for?
SELECT "Known for" FROM table_6102 WHERE "Entered" = 'day 1' AND "Celebrity" = 'freddie starr'
wikisql
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 ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
patient 51858 has made an admission since 2104?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 51858 AND STRFTIME('%y', admissions.admittime) >= '2104'
mimic_iii
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text...
Stack bar chart of the number of local authority vs services based on local authority, and order Y-axis from low to high order.
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY COUNT(local_authority)
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, ...
从00年11月21日到17年6月25日,在门诊找医生75246625看病的人数有多少
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.ZZYSGH = '75246625' AND wdmzjzjlb.JZKSRQ BETWEEN '2000-11-21' AND '2017-06-25' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info...
css
CREATE TABLE table_34169 ( "Team" text, "City, Region" text, "Arena" text, "Colours" text, "Head coach" text )
What is the arena in Borgarnes?
SELECT "Arena" FROM table_34169 WHERE "City, Region" = 'borgarnes'
wikisql
CREATE TABLE table_73281 ( "Season" real, "Episode" real, "Episode Summary" text, "Premier date" text, "External Link" text, "Coach" text )
How many episodes have a premier date of july 24, 2006
SELECT COUNT("External Link") FROM table_73281 WHERE "Premier date" = 'July 24, 2006'
wikisql
CREATE TABLE table_1305623_18 ( silver_medals INTEGER )
What is the most silver medals?
SELECT MAX(silver_medals) FROM table_1305623_18
sql_create_context
CREATE TABLE table_34277 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who won the Women's doubles the year that there was no competition in the Men's doubles and Arthur Chatschatourow won the Men's singles?
SELECT "Women's doubles" FROM table_34277 WHERE "Men's doubles" = 'no competition' AND "Men's singles" = 'arthur chatschatourow'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 c...
count the number of times patient 18677 received sodium bicarb on the first intensive care unit visit.
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18677) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_cv.itemid IN (SELE...
mimic_iii
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Q0.3.1 - Questions per year - all-time.
SELECT YEAR(CreationDate) AS "year", COUNT(1) AS questions, SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS questions_with_answer, SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS questions_with_accepted_answer FROM Posts WHERE PostTypeId = 1 AND NOT OwnerUserId IS NULL AND YEAR(CreationDate) BETWEE...
sede
CREATE TABLE table_70125 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
How many points did the Weslake v12 get in 1966?
SELECT MAX("Points") FROM table_70125 WHERE "Engine" = 'weslake v12' AND "Year" < '1966'
wikisql
CREATE TABLE table_name_34 ( result VARCHAR, round VARCHAR )
What is the result of round R3?
SELECT result FROM table_name_34 WHERE round = "r3"
sql_create_context
CREATE TABLE table_24117 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Black Knights points" real, "Opponents" real, "Record" text )
How many records have black knights points as 17?
SELECT COUNT("Record") FROM table_24117 WHERE "Black Knights points" = '17'
wikisql
CREATE TABLE table_76032 ( "Tournament" text, "Wins" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the lowest Top-25 that has 3 Events and Wins greater than 0?
SELECT MIN("Top-25") FROM table_76032 WHERE "Events" = '3' AND "Wins" > '0'
wikisql
CREATE TABLE table_1855841_1 ( votes_given VARCHAR, running_with__in_team_ VARCHAR )
Name the votes given for michael russo, genevy dimitrion , manny ortega
SELECT votes_given FROM table_1855841_1 WHERE running_with__in_team_ = "Michael Russo, Genevy Dimitrion , Manny Ortega"
sql_create_context
CREATE TABLE table_20002 ( "Year" text, "Dates" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winners share ($)" real )
What are all of the dates in the country of Canada?
SELECT "Dates" FROM table_20002 WHERE "Country" = 'Canada'
wikisql
CREATE TABLE table_24696 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
who are the writers of the episode that had 3.07 millions of North American spectators?
SELECT "Written by" FROM table_24696 WHERE "U.S. viewers (million)" = '3.07'
wikisql
CREATE TABLE table_63026 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest total that has a rank less than 8, a silver greater than 6, and 20 as the bronze?
SELECT MIN("Total") FROM table_63026 WHERE "Rank" < '8' AND "Silver" > '6' AND "Bronze" = '20'
wikisql
CREATE TABLE table_28629 ( "Region" text, "Population" real, "% of countrys population" text, "Change in population since 1993" real, "Change in % of countrys population since 1993" text )
What is the change in % of the country's population since 1993 in the Lambayeque region?
SELECT "Change in % of countrys population since 1993" FROM table_28629 WHERE "Region" = 'Lambayeque'
wikisql
CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, ...
Give me a line chart about the number of competitions held in each year, could you rank by the X in ascending?
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
how many patients received non-invasive testing for dvt after vasopressors - norepinephrine <= 0.1 micrograms/kg/min in 2102 in the same hospital visit?
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 = 'vasopressors - norepinephrine <= 0.1 micrograms/kg/min' AND STRFTIME('%y'...
eicu
CREATE TABLE table_3222 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What draft pick number did Kentucky get?
SELECT MIN("Pick #") FROM table_3222 WHERE "College" = 'Kentucky'
wikisql
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( ...
calculate the four year survival probability of the patients who were prescribed clopidogrel bisulfate after having been diagnosed with kidney laceration-open.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_name_64 ( team_2 VARCHAR, team_1 VARCHAR )
Which team has far rabat as the team 1?
SELECT team_2 FROM table_name_64 WHERE team_1 = "far rabat"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostLinks ( Id number, Crea...
Posts that could be marked as 'not an answer' to help get the Marshal badge. targeting answers from users with not a lot of rep. I hate the use of `body like`, so please feel free to edit this. It was just quick n dirty! The Marshal badge is: 'Achieved a flag weight of 749 by reviewing and flagging appropriately :
SELECT p.Id AS "post_link", p.Body, p.CreationDate FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE PostTypeId = 2 AND (Body LIKE '%how can%' OR Body LIKE '%same problem%' OR Body LIKE '%thank%' OR Body LIKE '%please%' OR Body LIKE '%plz%' OR Body LIKE '%pls%') AND u.Reputation < 100 AND p.Score < 1 ...
sede
CREATE TABLE table_9576 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Time" text )
What is the away team score for the match at 6:00 PM and an away team of Hawthorn?
SELECT "Away team score" FROM table_9576 WHERE "Time" = '6:00 pm' AND "Away team" = 'hawthorn'
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 were the four most commonly ordered procedures for patients who had already been diagnosed with s/p aneurysm resection/repair during the same month since 2103?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 's/p aneurysm resection/repair' AND STRFT...
eicu
CREATE TABLE table_26560 ( "Model number" text, "Frequency" text, "L1 Cache" text, "FSB" text, "Mult." text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "sSpec number" text )
What's the l1 cache of the model with sspec number sl2z3, sl28q (mya0)?
SELECT "L1 Cache" FROM table_26560 WHERE "sSpec number" = 'SL2Z3, SL28Q (myA0)'
wikisql
CREATE TABLE table_name_49 ( high_points VARCHAR, score VARCHAR )
Which High points have a Score of w 110-81?
SELECT high_points FROM table_name_49 WHERE score = "w 110-81"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
what is last height of patient 005-4471 on the current hospital encounter?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Number of image posts without default alt text per owner.
SELECT OwnerUserId AS "user_link", COUNT(*) AS NumPosts FROM Posts WHERE Body LIKE '%<img%' AND NOT Body LIKE '%alt text%' AND NOT Body LIKE '%enter image description here%' GROUP BY OwnerUserId ORDER BY COUNT(*) DESC
sede
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, show Y-axis in ascending order.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
Are there any super easy classes I can take so I fulfill my ULCS requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
advising
CREATE TABLE table_204_704 ( id number, "province" text, "map #" number, "iso 3166-2:af" text, "centers" text, "population" number, "area (km2)" number, "language" text, "notes" text, "u.n. region" text )
herat has a population of 1,182,000 , can you list their languages
SELECT "language" FROM table_204_704 WHERE "province" = 'herat'
squall
CREATE TABLE table_name_8 ( gpu_model VARCHAR, frequency VARCHAR, sspec_number VARCHAR )
what is the gpu model when the frequency is 3.4 ghz and the sspec number is sr00b(d2)?
SELECT gpu_model FROM table_name_8 WHERE frequency = "3.4 ghz" AND sspec_number = "sr00b(d2)"
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, ...
有多少科室在医院3523362的最短医疗住院时间超过了8天?
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3523362' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 8) AS T
css
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( ...
Running total of initial votes vs time in an election.
SELECT b.Date, SUM(COUNT(b.Date)) OVER (ORDER BY b.Date) AS running FROM Badges AS b WHERE b.Name = 'Constituent' AND b.Date BETWEEN '##ElectionYear##-01-01' AND '##ElectionYear##-12-31' GROUP BY b.Date ORDER BY b.Date
sede
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...
what is minimum days of hospital stay of patients whose admission type is urgent?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.admission_type = "URGENT"
mimicsql_data
CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determi...
What is the most effective extraction method in terms of pesticide residues detection?
SELECT extract FROM resultsdata15 GROUP BY extract ORDER BY COUNT(*) DESC LIMIT 1
pesticide
CREATE TABLE table_203_569 ( id number, "designation" text, "classification" text, "constellation" text, "apparent magnitude" number )
what is the number of galaxies in the pisces constellation ?
SELECT COUNT("designation") FROM table_203_569 WHERE "constellation" = 'pisces'
squall
CREATE TABLE table_name_63 ( season INTEGER, number_of_clubs VARCHAR, runners_up VARCHAR )
What is the sum of the season with 8 clubs and shanghai as the runners-up?
SELECT SUM(season) FROM table_name_63 WHERE number_of_clubs = 8 AND runners_up = "shanghai"
sql_create_context
CREATE TABLE table_name_28 ( gold INTEGER, nation VARCHAR, silver VARCHAR )
What is the average Gold, when Nation is Yugoslavia, and when Silver is greater than 0?
SELECT AVG(gold) FROM table_name_28 WHERE nation = "yugoslavia" AND silver > 0
sql_create_context
CREATE TABLE table_33088 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" real, "Round of 32" real, "Sweet Sixteen" real, "Elite Eight" real, "Final Four" real, "Championship Game" real )
What is the lowest number of bids in the Missouri Valley conference?
SELECT MIN("# of Bids") FROM table_33088 WHERE "Conference" = 'missouri valley'
wikisql
CREATE TABLE table_39846 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many totals had more than 4 bronze?
SELECT SUM("Total") FROM table_39846 WHERE "Bronze" > '4'
wikisql
CREATE TABLE table_2538117_12 ( letters VARCHAR, founding_date VARCHAR )
How many letters were given to the organization with a founding date of 1997-12-12?
SELECT COUNT(letters) FROM table_2538117_12 WHERE founding_date = "1997-12-12"
sql_create_context
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...
Which award has the highest player's salary?
SELECT award_id FROM player_award AS T1 JOIN salary AS T2 ON T1.player_id = T2.player_id GROUP BY T1.award_id ORDER BY AVG(T2.salary) DESC LIMIT 1
thehistoryofbaseball
CREATE TABLE table_38681 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" text, "Class" text, "Hometown" text, "Games\u2191" real )
What is the earliest game with a position of Re and a smaller number than 95?
SELECT MIN("Games\u2191") FROM table_38681 WHERE "Position" = 're' AND "Number" < '95'
wikisql
CREATE TABLE table_44688 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
On what surface did they play the match in the week of October 21?
SELECT "Surface" FROM table_44688 WHERE "Week" = 'october 21'
wikisql
CREATE TABLE table_name_12 ( phonetic_realisation VARCHAR, phonemic_value VARCHAR, without_niqqud VARCHAR )
What is the phonetic realisation if the phonemic value is /v/ and the without niqqud is as initial letter: ?
SELECT phonetic_realisation FROM table_name_12 WHERE phonemic_value = "/v/" AND without_niqqud = "as initial letter: ו"
sql_create_context
CREATE TABLE table_52732 ( "Year" real, "Team name" text, "Drivers" text, "Races" real, "Wins" real, "Poles" real, "FLaps" real, "Points" real, "D.C." text, "T.C." text )
How many Points have Drivers of adri n vall s, and a Year larger than 2006?
SELECT AVG("Points") FROM table_52732 WHERE "Drivers" = 'adrián vallés' AND "Year" > '2006'
wikisql
CREATE TABLE table_11622255_1 ( purse__ INTEGER, tournament VARCHAR )
what is the minimum purse( $ ) where tournament is ko olina senior invitational
SELECT MIN(purse__) AS $__ FROM table_11622255_1 WHERE tournament = "Ko Olina Senior Invitational"
sql_create_context
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 ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, fi...
what are the four most frequently prescribed drugs for patients that have been prescribed clopidogrel bisulfate at the same time, since 2105?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'clopidogrel bisulfate' AND STRFTIME('%y', prescriptions.startdate...
mimic_iii
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 jyjgzbb ( BGDH text, BGRQ tim...
从2014-03-30到2020-03-19,哪个工号什么名字的医务人员在患者奚信瑞就诊时为其检测罗马指数(绝经前)的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 jy...
css
CREATE TABLE table_14656 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
Where was the starting position when there were 182 laps?
SELECT "Start" FROM table_14656 WHERE "Laps" = '182'
wikisql
CREATE TABLE table_16388047_1 ( ground VARCHAR, home_team VARCHAR )
Name the ground for essendon
SELECT ground FROM table_16388047_1 WHERE home_team = "Essendon"
sql_create_context
CREATE TABLE table_name_25 ( year VARCHAR, artist VARCHAR )
Which year did the Royal Canadian Mint Staff create a silver dollar?
SELECT year FROM table_name_25 WHERE artist = "royal canadian mint staff"
sql_create_context
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
I would like a list of the best courses to enroll in prior to enrolling in PHYSED 141 .
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'PHYSED' AND number = 141
advising
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate...
Closures early in SO's history.
SELECT Id AS "post_link", ClosedDate FROM Posts WHERE ClosedDate < '2009-01-17' ORDER BY ClosedDate DESC
sede
CREATE TABLE table_name_28 ( diameter VARCHAR, year_of_issue VARCHAR )
Which Diameter has a Year of Issue of 1977?
SELECT diameter FROM table_name_28 WHERE year_of_issue = 1977
sql_create_context
CREATE TABLE table_24108789_4 ( before VARCHAR, player VARCHAR )
List all before numbers when Geoff Ogilvy was playing.
SELECT before FROM table_24108789_4 WHERE player = "Geoff Ogilvy"
sql_create_context
CREATE TABLE gwyjzb ( 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, ...
那些年纪大于21岁的病患的医疗记录中其医务费总金额平均一下是多些?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE > 21 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE > 21)
css
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 of the Spanish speaking patients belonged to greek orthodox belief?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "GREEK ORTHODOX"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose diagnoses long title is acute upper respiratory infections of unspecified site and lab test fluid is pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Acute upper respiratory infections of unspecified site" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_29 ( venue VARCHAR, away_team VARCHAR )
What venue did Richmond play as the away team?
SELECT venue FROM table_name_29 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE table_name_5 ( poll_source VARCHAR, pat_toomey VARCHAR )
Which Poll source has Pat Toomey of 23%?
SELECT poll_source FROM table_name_5 WHERE pat_toomey = "23%"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_i...
when was patient 12885 given a procedure for the first time in the last hospital encounter?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12885 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE table_10413597_5 ( original_air_date VARCHAR, setting VARCHAR )
What was the original air date of an episode set in 1544?
SELECT original_air_date FROM table_10413597_5 WHERE setting = "1544"
sql_create_context
CREATE TABLE table_2668393_18 ( candidates VARCHAR, incumbent VARCHAR )
How many times was the incumbent john dawson redistricted from the 15th district?
SELECT COUNT(candidates) FROM table_2668393_18 WHERE incumbent = "John Dawson Redistricted from the 15th district"
sql_create_context
CREATE TABLE table_2857352_3 ( network VARCHAR, virtual_channel VARCHAR )
What network airs on virtual channel 23.1?
SELECT network FROM table_2857352_3 WHERE virtual_channel = "23.1"
sql_create_context
CREATE TABLE table_23547 ( "#" text, "Original title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code" text )
What was the original title of 3.19?
SELECT "Original title" FROM table_23547 WHERE "Production code" = '3.19'
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, ...
哪些医务人员为患者何莹琇在12年2月15日到17年2月23日期间进行过检测指标048093的检查姓名和工号都是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 jy...
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( c...
Is a 18 -credit upper level class offered in Spring 2004 ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 18 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring' AND s...
advising
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
Are there any upper-level electives next semester that do n't meet on Monday or Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course...
advising
CREATE TABLE table_name_18 ( singular_word VARCHAR, singular_abbreviation VARCHAR )
A singular abbreviation of p. is used for what singular word?
SELECT singular_word FROM table_name_18 WHERE singular_abbreviation = "p."
sql_create_context