context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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, ...
count the number of patients that were diagnosed until 3 years ago with acute respiratory distress - etiology unknown.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory distress - etiology unknown' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year'))
eicu
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
self-accepted answer with negative score to a well received question.
SELECT p.Id AS "post_link", p.Score AS QuestionScore, a.Score AS AnswerScore FROM Posts AS p, Posts AS a WHERE p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL AND a.Id = p.AcceptedAnswerId AND a.Score < 0 AND p.Score > 0 AND p.OwnerUserId = a.OwnerUserId ORDER BY p.Score - a.Score DESC
sede
CREATE TABLE table_name_26 ( total INTEGER, bronze VARCHAR, gold VARCHAR )
What is the total number of medals won by nations that had 7 bronze medals and more than 18 gold medals?
SELECT SUM(total) FROM table_name_26 WHERE bronze = 7 AND gold > 18
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( me...
since 6 years ago, what was the yearly maximum value of the paco2 of patient 022-127032?
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127032')) AND lab.labname = 'paco2' AND DATETIME(lab.labresulttime) >= DATETIM...
eicu
CREATE TABLE table_23172 ( "Player" text, "Minutes" real, "Field Goals" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real )
what is the lowest points scored by a player who blocked 21 times
SELECT MIN("Points") FROM table_23172 WHERE "Blocks" = '21'
wikisql
CREATE TABLE table_203_229 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text )
the green bay packers after miami dolphins chose which player ?
SELECT "player" FROM table_203_229 WHERE "nfl team" = 'green bay packers' AND "pick #" = (SELECT "pick #" FROM table_203_229 WHERE "nfl team" = 'miami dolphins') + 1
squall
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
calculate the number of times patient 006-17553 has been tested in the hgb laboratory in 2105.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-17553')) AND lab.labname = 'hgb' AND STRFTIME('%y', lab.labresulttime) = '2105'
eicu
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
What are the number of the dates that have an average sea level pressure between 303 and 31?, list X-axis in desc order.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date DESC
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean...
Top Scored Questions that are CLOSED!.
SELECT Score, ViewCount, CreationDate, LastActivityDate, Id, Title, Tags, AnswerCount, CommentCount, FavoriteCount FROM Posts WHERE PostTypeId = 1 AND (NOT ClosedDate IS NULL OR NOT DeletionDate IS NULL) AND Id = 10040954 ORDER BY Score DESC
sede
CREATE TABLE table_64574 ( "County" text, "Location" text, "Distance" real, "Total" real, "Notes" text )
How much Distance has a County of faulkner, and a Total smaller than 1.5?
SELECT SUM("Distance") FROM table_64574 WHERE "County" = 'faulkner' AND "Total" < '1.5'
wikisql
CREATE TABLE table_21848 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What is the try bonus when the tries against are 17?
SELECT "Try bonus" FROM table_21848 WHERE "Tries against" = '17'
wikisql
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 lab ( labid numbe...
what is the output that patient 017-20711 first had on last month/14?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-20711')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
what were the four most frequent drugs prescribed to patients within 2 months after being diagnosed with hyperglycemia - stress related during the last year?
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 = 'hyperglycemia - stress related' AND DATETIME(diagn...
eicu
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, ...
两千年十二月二十一日到一六年十二月二日,患者尤清润的二氧化碳情况是怎样的
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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.YLJG...
css
CREATE TABLE table_56741 ( "Player" text, "Overs" text, "Runs" text, "Wkts" text, "Mdns" text, "Econ" text )
Tell me the overs for mdns of 4
SELECT "Overs" FROM table_56741 WHERE "Mdns" = '4'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about Team_ID over the Team_Name by a bar chart, could you rank by the Y in descending?
SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_ID DESC
nvbench
CREATE TABLE table_name_53 ( time_retired VARCHAR, grid VARCHAR, driver VARCHAR )
How much time does it take for jean alesi and grids lesser than 5?
SELECT time_retired FROM table_name_53 WHERE grid < 5 AND driver = "jean alesi"
sql_create_context
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 was hired before 2002-06-21, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time by a bar chart, I want to show from low to high by the y axis.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE table_name_48 ( swing_to_gain INTEGER, constituency VARCHAR )
Can you tell me the sum of Swing to gain that has Constituency of caithness, sutherland and easter ross?
SELECT SUM(swing_to_gain) FROM table_name_48 WHERE constituency = "caithness, sutherland and easter ross"
sql_create_context
CREATE TABLE table_name_52 ( weight INTEGER, player VARCHAR )
What does DeShawn Stevenson weigh?
SELECT SUM(weight) FROM table_name_52 WHERE player = "deshawn stevenson"
sql_create_context
CREATE TABLE table_79748 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Who was the entrant in 1971?
SELECT "Entrant" FROM table_79748 WHERE "Year" = '1971'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
what is the name of procedure patient 25523 has been given two times in 06/last year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 255...
mimic_iii
CREATE TABLE table_name_15 ( time VARCHAR, rank VARCHAR, react VARCHAR, athlete VARCHAR )
How much Time has a Reaction of 0.155, and an Athlete of kristof beyens, and a Rank smaller than 3?
SELECT COUNT(time) FROM table_name_15 WHERE react = 0.155 AND athlete = "kristof beyens" AND rank < 3
sql_create_context
CREATE TABLE TOURIST_ATTRACTIONS ( Opening_Hours VARCHAR, Tourist_Attraction_ID VARCHAR ) CREATE TABLE MUSEUMS ( Museum_Details VARCHAR, Museum_ID VARCHAR )
What are the details and opening hours of the museums?
SELECT T1.Museum_Details, T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what was the name of the medication patient 030-53416 was prescribed in the same hospital encounter after having been diagnosed with vaginal delivery?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_76500 ( "Minister" text, "Party" text, "Start date" text, "End date" text, "Prime Minister" text )
Who was the minister for the CSV party with a present day end date?
SELECT "Minister" FROM table_76500 WHERE "Party" = 'csv' AND "End date" = 'present day'
wikisql
CREATE TABLE table_76952 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text )
What is the lowest December, when Score is '4 - 4'?
SELECT MIN("December") FROM table_76952 WHERE "Score" = '4 - 4'
wikisql
CREATE TABLE table_25232 ( "Rnd" real, "Date" text, "Race Name" text, "Length" text, "Track" text, "Location" text, "Pole Position" text, "Winning Driver" text )
How many races are in College Station, Texas and won by Johnny Rutherford?
SELECT COUNT("Race Name") FROM table_25232 WHERE "Location" = 'College Station, Texas' AND "Winning Driver" = 'Johnny Rutherford'
wikisql
CREATE TABLE table_20850527_1 ( result VARCHAR, record VARCHAR )
How many wins or losses were there when the record was 3-0?
SELECT COUNT(result) FROM table_20850527_1 WHERE record = "3-0"
sql_create_context
CREATE TABLE table_11753 ( "Block A" text, "Gran Hamada" text, "Koji Kanemoto" text, "Jushin Liger" text, "Masaaki Mochizuki" text, "Super Shocker" text, "Tatsuhito Takaiwa" text )
Which Masaaki Mochizuki has a Gran Hamada of hamada (10:47)?
SELECT "Masaaki Mochizuki" FROM table_11753 WHERE "Gran Hamada" = 'hamada (10:47)'
wikisql
CREATE TABLE table_67158 ( "Date" text, "Visiting team" text, "Final score" text, "Host team" text, "Stadium" text )
What was the final score at Heinz Field?
SELECT "Final score" FROM table_67158 WHERE "Stadium" = 'heinz field'
wikisql
CREATE TABLE table_53506 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real )
Which country has a rank of 2?
SELECT "Country" FROM table_53506 WHERE "Rank" = '2'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_...
what flights are available from PHILADELPHIA to DENVER on SUNDAY
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AND fl...
atis
CREATE TABLE table_28048 ( "Series no." real, "No. in season" real, "Title" text, "Written by" text, "Directed by" text, "Original air date" text )
How many titles does the episode written by Joe Toplyn have?
SELECT COUNT("Title") FROM table_28048 WHERE "Written by" = 'Joe Toplyn'
wikisql
CREATE TABLE table_536 ( "Year" real, "Population (Region total)" real, "Population (Maryborough)" real, "Population (Hervey Bay)" real, "Population (Woocoo)" real, "Population (Tiaro)" real )
Name the population of maryborough when population of woocoo is 2700
SELECT "Population (Maryborough)" FROM table_536 WHERE "Population (Woocoo)" = '2700'
wikisql
CREATE TABLE table_name_63 ( record VARCHAR, home VARCHAR )
What was the record when chicago was the home team?
SELECT record FROM table_name_63 WHERE home = "chicago"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id numbe...
calculate the survival rate for three year among the patients who were prescribed nifedipine cr after being diagnosed with renal & ureteral dis nos.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 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_37435 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team" text )
What position does Mikhail Kravets play?
SELECT "Position" FROM table_37435 WHERE "Player" = 'mikhail kravets'
wikisql
CREATE TABLE table_44306 ( "Rank" real, "Country" text, "Miss United Continent" real, "Virreina" real, "1st RU" real, "2nd RU" real, "3rd RU" real, "4th RU" real, "Semifinalists" real, "Total" real )
What rank was Peru with a total greater than 3?
SELECT MAX("Rank") FROM table_44306 WHERE "Country" = 'peru' AND "Total" > '3'
wikisql
CREATE TABLE table_31701 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Tell me the total number of attendance for week of 16
SELECT COUNT("Attendance") FROM table_31701 WHERE "Week" = '16'
wikisql
CREATE TABLE table_53439 ( "Year" real, "Nominated For" text, "Award" text, "Category" text, "Result" text )
Name the year that Birds of a feather category for most popular actress was nominated
SELECT AVG("Year") FROM table_53439 WHERE "Category" = 'most popular actress' AND "Nominated For" = 'birds of a feather'
wikisql
CREATE TABLE table_name_55 ( home_team VARCHAR )
In the match where footscray was the home team, how much did they score?
SELECT home_team AS score FROM table_name_55 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_64902 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
What is the highest league goals that have barry endean as the name, wirh FA cup apps greater than 0?
SELECT MAX("League Goals") FROM table_64902 WHERE "Name" = 'barry endean' AND "FA Cup Apps" > '0'
wikisql
CREATE TABLE CUSTOMER ( State VARCHAR )
Find all the customer information in state NY.
SELECT * FROM CUSTOMER WHERE State = "NY"
sql_create_context
CREATE TABLE table_65982 ( "Rank" real, "Artist" text, "Album" text, "Peak position" real, "Sales" real, "Certification" text )
How many sales had a peak position of 1 and a certification of 6x platinum?
SELECT COUNT("Sales") FROM table_65982 WHERE "Peak position" = '1' AND "Certification" = '6x platinum'
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, ...
列出患者30218340入院科室名称中不包含医学科在医院0208580中的住院就诊记录分别是哪几条?
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '30218340' AND hz_info.YLJGDM = '0208580' AND NOT wdmzjzjlb.JZKSMC LIKE '%医学科%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND...
css
CREATE TABLE table_name_96 ( season VARCHAR, third VARCHAR )
what is the season when the third is shawn rojeski?
SELECT season FROM table_name_96 WHERE third = "shawn rojeski"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
provide the number of patients whose primary disease is acidosis and year of death is less than or equal to 2154?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACIDOSIS" AND demographic.dod_year <= "2154.0"
mimicsql_data
CREATE TABLE table_28164 ( "Village" text, "Area km\u00b2" text, "Population (2000 census )" real, "Region" text, "Pop. Density" real )
What village has an area of 27.19 km2?
SELECT "Village" FROM table_28164 WHERE "Area km\u00b2" = '27.19'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
How Rich Are The 1%?. Occupy Stack overflow!
WITH percentile AS (SELECT NTILE(100) OVER (ORDER BY Reputation DESC) AS p, Reputation, DisplayName FROM Users) SELECT 'The ' + CASE p WHEN 1 THEN '1' ELSE '99' END + '%' AS Who, SUM(Reputation) AS Rep FROM percentile GROUP BY CASE p WHEN 1 THEN '1' ELSE '99' END
sede
CREATE TABLE table_45995 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text )
What was the jersey number(s) when the position was SG from North Carolina?
SELECT "Jersey Number(s)" FROM table_45995 WHERE "Position" = 'sg' AND "From" = 'north carolina'
wikisql
CREATE TABLE table_52798 ( "Superlative" text, "Actress" text, "Record Set" text, "Year" real, "Notes" text )
Which award was won by Gloria Stuart after 1984?
SELECT "Superlative" FROM table_52798 WHERE "Year" > '1984' AND "Actress" = 'gloria stuart'
wikisql
CREATE TABLE table_name_11 ( match VARCHAR, points VARCHAR )
What is the Match with Points that are 24?
SELECT match FROM table_name_11 WHERE points = 24
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
show me all round trips from NEW YORK to MIAMI leaving 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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((DAYS_0.day_name = 'TUESDAY' AND DAYS_1.day_name = 'TUESDAY' AND fare_basis.basis_days = DAYS_1.d...
atis
CREATE TABLE table_64184 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
When rank is 5, what is the rowers?
SELECT "Rowers" FROM table_64184 WHERE "Rank" = '5'
wikisql
CREATE TABLE table_10015132_9 ( no VARCHAR, years_in_toronto VARCHAR )
What are the total amount of numbers on the Toronto team in 2005-06?
SELECT COUNT(no) FROM table_10015132_9 WHERE years_in_toronto = "2005-06"
sql_create_context
CREATE TABLE table_2140071_12 ( episode VARCHAR, coach VARCHAR )
Name the episode summary for torae carr
SELECT episode AS Summary FROM table_2140071_12 WHERE coach = "Torae Carr"
sql_create_context
CREATE TABLE Employees ( employee_ID VARCHAR, employee_name VARCHAR )
What is the id for the employee called Ebba?
SELECT employee_ID FROM Employees WHERE employee_name = "Ebba"
sql_create_context
CREATE TABLE table_25521 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
when was the premiere of the episode called 'force recon'?
SELECT "Original air date" FROM table_25521 WHERE "Title" = 'Force Recon'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
what is the name of a procedure that patient 73713 has been given for two times since 11/2105?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 737...
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime t...
what is the cost for glucose, pleural lab testing?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose, pleural'))
mimic_iii
CREATE TABLE table_47751 ( "Elector" text, "Nationality" text, "Order and title" text, "Elevated" text, "Elevator" text )
When Anchero Pantaleone was the elector what is under nationality?
SELECT "Nationality" FROM table_47751 WHERE "Elector" = 'anchero pantaleone'
wikisql
CREATE TABLE table_name_78 ( winner VARCHAR, trofeo_fast_team VARCHAR, general_classification VARCHAR )
Which Winner has a Trofeo Fast Team of metauro mobili-pinarello, and a General classification of giuseppe saronni?
SELECT winner FROM table_name_78 WHERE trofeo_fast_team = "metauro mobili-pinarello" AND general_classification = "giuseppe saronni"
sql_create_context
CREATE TABLE election ( Id VARCHAR )
How many elections are there?
SELECT COUNT(*) FROM election
sql_create_context
CREATE TABLE table_28059992_6 ( college VARCHAR, player VARCHAR )
What college did Francis Bellefroid go to?
SELECT college FROM table_28059992_6 WHERE player = "Francis Bellefroid"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Posts honored by VoteType 4.
SELECT Id, CreationDate, PostId AS "post_link", 'site://q/' + CAST(PostId AS TEXT) + '|Link' AS "working_link" FROM Votes WHERE VoteTypeId = 4 ORDER BY Id
sede
CREATE TABLE hz_info ( KH text, KLX number, 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, JCZBJGDX text...
患者冯勇军在二零一九年十一月十八日往前有哪些住院就诊的检验报告单?列出住院就诊流水号
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_66287 ( "Proto-Germanic" text, "West Germanic" text, "Old English" text, "German" text, "Dutch" text )
What's the Proto-Germanic when the Old English is /d/?
SELECT "Proto-Germanic" FROM table_66287 WHERE "Old English" = '/d/'
wikisql
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), ...
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students Plot them as bar chart, I want to rank by the bar in desc.
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY STU_FNAME DESC
nvbench
CREATE TABLE table_55277 ( "Province" text, "Comune" text, "Population (inh.)" real, "Area (km\u00b2)" real, "Total (km\u00b2)" real )
What is the km2 area with more than 8,328 people with a total of 121.14 km2?
SELECT AVG("Area (km\u00b2)") FROM table_55277 WHERE "Population (inh.)" > '8,328' AND "Total (km\u00b2)" > '121.14'
wikisql
CREATE TABLE table_41509 ( "Player" text, "Country" text, "Year won" real, "Total" real, "To par" real )
What is the Total for the Player who won after 1983 with less than 4 To par?
SELECT AVG("Total") FROM table_41509 WHERE "To par" < '4' AND "Year won" > '1983'
wikisql
CREATE TABLE table_name_47 ( country VARCHAR, ship VARCHAR )
What Country is the John S. McCain Ship from?
SELECT country FROM table_name_47 WHERE ship = "john s. mccain"
sql_create_context
CREATE TABLE table_51236 ( "Driver" text, "Car #" real, "Make" text, "Points" real, "Laps" real, "Winnings" text )
Who drove the dodge with a car # less than 5?
SELECT "Driver" FROM table_51236 WHERE "Car #" < '5' AND "Make" = 'dodge'
wikisql
CREATE TABLE table_33955 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which college has a defensive end with a round less than 6?
SELECT "College" FROM table_33955 WHERE "Round" > '6' AND "Position" = 'defensive end'
wikisql
CREATE TABLE table_57482 ( "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Goals" text, "Attendance" real, "Competition" text )
On 15/04/07 in the competition Super League XII, what was the score?
SELECT "Score" FROM table_57482 WHERE "Competition" = 'super league xii' AND "Date" = '15/04/07'
wikisql
CREATE TABLE table_2019 ( "Fiscal year" real, "2-car sets" real, "4-car sets" real, "6-car sets" real, "8-car sets" real, "Total vehicles" real )
What is the smallest 8-car sets if 4-car sets is 47?
SELECT MIN("8-car sets") FROM table_2019 WHERE "4-car sets" = '47'
wikisql
CREATE TABLE table_name_60 ( decile INTEGER, area VARCHAR )
What is the smallest decile with an Area of otumoetai?
SELECT MIN(decile) FROM table_name_60 WHERE area = "otumoetai"
sql_create_context
CREATE TABLE table_80263 ( "Tower" text, "Year" text, "Country" text, "Town" text, "Pinnacle height" text )
Which country had a tower destroyed in 1899?
SELECT "Country" FROM table_80263 WHERE "Year" = '1899'
wikisql
CREATE TABLE table_1875157_1 ( top_10 INTEGER )
What is the lowest number of top 10 finishes
SELECT MIN(top_10) FROM table_1875157_1
sql_create_context
CREATE TABLE table_name_20 ( episodes VARCHAR, title VARCHAR )
what episode is called jewboy
SELECT episodes FROM table_name_20 WHERE title = "jewboy"
sql_create_context
CREATE TABLE table_name_54 ( date VARCHAR, record VARCHAR )
What was the date of the game when the record was 66-38?
SELECT date FROM table_name_54 WHERE record = "66-38"
sql_create_context
CREATE TABLE table_3651 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What is the nationality of the player kevin stevens?
SELECT "Nationality" FROM table_3651 WHERE "Player" = 'Kevin Stevens'
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
have the arterial bp [diastolic] of patient 739 remained normal on the current intensive care unit visit?
SELECT COUNT(*) > 0 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 = 739) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items...
mimic_iii
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...
give me the number of patients whose ethnicity is hispanic or latino and lab test name is calculated total co2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.label = "Calculated Total CO2"
mimicsql_data
CREATE TABLE table_11677691_10 ( position VARCHAR, hometown VARCHAR )
What position belonged to the player from Paramus, New Jersey?
SELECT position FROM table_11677691_10 WHERE hometown = "Paramus, New Jersey"
sql_create_context
CREATE TABLE table_name_51 ( competition VARCHAR, location VARCHAR, year VARCHAR, score VARCHAR )
Which competition occurred after 1980 with a score of 0:5 in Jerusalem?
SELECT competition FROM table_name_51 WHERE year > 1980 AND score = "0:5" AND location = "jerusalem"
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...
从16年5月5日到21年10月18日之中患者华萍雅自己的医保的账户支出总共多少钱?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '华萍雅' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-05-05' AND '2021-10-18'
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
when patient 028-43966 heartrate first measured until 02/05/2105?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-43966')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
what were the top five most frequent diagnoses for the patients with age 40s since 2100.
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2100' GROUP BY diagnosis....
eicu
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propul...
are there any flights before 1200 on 6 15 from LONG BEACH to COLUMBUS
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 ((date_day.day_number = 15 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE table_14418812_1 ( opponent VARCHAR, week VARCHAR )
Name the opponent for week 12
SELECT opponent FROM table_14418812_1 WHERE week = 12
sql_create_context
CREATE TABLE table_12021 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team has an Away team score of 19.12 (126)?
SELECT "Home team" FROM table_12021 WHERE "Away team score" = '19.12 (126)'
wikisql
CREATE TABLE table_20914 ( "Central Forest Reserve" text, "Size in km\u00b2" real, "Total plant species" real, "Tree species" real, "Endemic" real, "Threatened (CR,VU,EN)" real )
How many tree species are there when the total plant species is 113?
SELECT COUNT("Tree species") FROM table_20914 WHERE "Total plant species" = '113'
wikisql
CREATE TABLE table_name_48 ( tournament VARCHAR )
WHAT IS THE 2011 PERFORMANCE FOR TOURNAMENTS PLAYED?
SELECT 2011 FROM table_name_48 WHERE tournament = "tournaments played"
sql_create_context
CREATE TABLE table_48224 ( "Rank" real, "Player" text, "Years" text, "Games" real, "Reb. Avg." real, "Total Rebounds" real )
How many games have rebounds larger than 1048?
SELECT COUNT("Games") FROM table_48224 WHERE "Total Rebounds" > '1048'
wikisql
CREATE TABLE temperature ( city_id number, jan number, feb number, mar number, apr number, jun number, jul number, aug number, sep number, oct number, nov number, dec number ) CREATE TABLE city ( city_id number, city text, hanzi text, hanyu_pinyin text, ...
What is the host year of city 'Taizhou ( Zhejiang )'?
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
spider
CREATE TABLE train ( Railway_ID VARCHAR ) CREATE TABLE railway ( Location VARCHAR, Railway_ID VARCHAR )
Show id and location of railways that are associated with more than one train.
SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
please list the flights taking off and landing on MKE airport
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
atis
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
tell me the number of widow patients who have lab test item id 50973.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "50973"
mimicsql_data
CREATE TABLE table_3364 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Safeties" real, "Points" real )
How many extra points catagories are there for the na player?
SELECT COUNT("Extra points") FROM table_3364 WHERE "Player" = 'na'
wikisql