instruction
stringlengths 53
549
| output
stringlengths 30
2.33k
|
---|---|
### Instruction:
What day of the week are most bounties offered?. You probably won't be surprised by the result!
### Response:
| SELECT SUM(Score) AS upvotes, COUNT(*) AS totalQuestions, (CAST(SUM((Score * 1.0) / (ViewCount * 1.0)) AS FLOAT) / CAST(COUNT(*) AS FLOAT)) AS average, CASE (TIME_TO_STR(CreationDate, '%W') + @@DATEFIRST) % 7 WHEN 1 THEN 'Sunday' WHEN 2 THEN 'Monday' WHEN 3 THEN 'Tuesday' WHEN 4 THEN 'Wednesday' WHEN 5 THEN 'Thursday' WHEN 6 THEN 'Friday' WHEN 0 THEN 'Saturday' END AS Weekday FROM Posts WHERE PostTypeId = 1 AND CreationDate > '01-01-2014' GROUP BY TIME_TO_STR(CreationDate, '%W') |
### Instruction:
Avance to Explainer / Refiner / Illuminator Badge. Avance to Explainer / Refiner / Illuminator Badge
### Response:
| SELECT a.OwnerUserId AS "user_link", COUNT(PostId) AS "answer_edits" FROM Posts AS q JOIN PostHistory AS e ON PostId = q.Id JOIN Posts AS a ON a.ParentId = q.Id AND COALESCE(q.OwnerUserId, -1) != a.OwnerUserId AND UserId = a.OwnerUserId AND ABS(CAST((JULIANDAY(CreationDate) - JULIANDAY(a.CreationDate)) * 24.0 AS INT)) < 12 WHERE PostHistoryTypeId IN (4, 5) AND q.PostTypeId = 1 AND a.PostTypeId = 2 AND a.Score >= 1 AND a.OwnerUserId = '##userid##' GROUP BY a.OwnerUserId |
### Instruction:
what was the last height of patient 14671 in 12/this year.
### Response:
| SELECT 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 = 14671)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', chartevents.charttime) = '12' ORDER BY chartevents.charttime DESC LIMIT 1 |
### Instruction:
show me flights from BALTIMORE to PHILADELPHIA arriving after 2100
### Response:
| 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.arrival_time > 2100 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
### Instruction:
what are the four most common diagnosis of patients with age 40s during a year before?
### Response:
| SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 4) |
### Instruction:
provide the daily minimum amount of enfamiladdedrice po that patient 15794 has received since 06/20/2104.
### Response:
| SELECT MIN(inputevents_cv.amount) 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 = 15794)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'enfamiladdedrice po' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) >= '2104-06-20' GROUP BY STRFTIME('%y-%m-%d', inputevents_cv.charttime) |
### Instruction:
calculate the total amount of per iv flush: antecubital l 20 gauge consumed on last month/15 for patient 002-41152.
### Response:
| SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND intakeoutput.celllabel = 'per iv flush: antecubital l 20 gauge' AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '15' |
### Instruction:
what was the difference in weight of patient 006-123134 second measured on the current hospital visit compared to the first value measured on the current hospital visit?
### Response:
| SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) - (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1) |
### Instruction:
since 1409 days ago, has patient 25814's arterial bp [systolic] been ever greater than 113.0?
### Response:
| 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 = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') AND chartevents.valuenum > 113.0 AND DATETIME(chartevents.charttime) >= DATETIME(CURRENT_TIME(), '-1409 day') |
### Instruction:
What question has the most cycles of Close/Reopen?. https://meta.stackexchange.com/questions/277175/what-question-has-the-most-cycles-of-close-reopen
### Response:
| SELECT PostId, Title, 'closed', 're-opened', 'closed' + 're-opened' AS "cycles", CASE WHEN 'closed' > 're-opened' THEN 'closed' ELSE 'open' END AS "current" FROM (SELECT PostId, p.Title, SUM(CASE WHEN PostHistoryTypeId = 10 THEN 1 ELSE 0 END) AS "closed", SUM(CASE WHEN PostHistoryTypeId = 11 THEN 1 ELSE 0 END) AS "re-opened" FROM PostHistory INNER JOIN Posts AS p ON p.Id = PostId WHERE PostHistoryTypeId IN (10, 11) GROUP BY PostId, Title) AS data ORDER BY 'closed' + 're-opened' DESC |
### Instruction:
list DAILY flights from OAKLAND to BOSTON using TW
### Response:
| 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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'TW') AND flight.flight_days = 'DAILY' |
### Instruction:
what are the evening flights from ATLANTA to BALTIMORE
### Response:
| 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 1800 AND 2200 |
### Instruction:
show me all flights from MINNEAPOLIS to SAN DIEGO that arrive before 1900
### Response:
| 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND flight.arrival_time <= 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MINNEAPOLIS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
### Instruction:
Users with the highest reputation per answers and questions count ratio. To find your own ratio, go here:
https://data.stackexchange.com/stackoverflow/query/384546/users-reputation-per-answers-and-questions-count-ratio
### Response:
| SELECT u.Id AS "user_link", u.DisplayName, u.Reputation, COUNT(p.Id) AS "posts_count", (CAST(u.Reputation AS FLOAT) / CAST(COUNT(p.Id) AS FLOAT)) AS "ratio" FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 1 OR p.PostTypeId = 2 GROUP BY u.Id, u.DisplayName, u.Reputation HAVING COUNT(p.Id) > '##MinimalPostsCount:int?500##' ORDER BY Ratio DESC LIMIT 500 |
### Instruction:
please list nonstop TW flights from LAS VEGAS to NEW YORK
### Response:
| 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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.stops = 0) AND flight.airline_code = 'TW' |
### Instruction:
what is the distance between PITTSBURGH airport and downtown PITTSBURGH
### Response:
| SELECT DISTINCT AIRPORT_SERVICE_0.miles_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE airport.airport_code = AIRPORT_SERVICE_0.airport_code AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_1.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_0.city_code AND CITY_1.city_name = 'PITTSBURGH' |
### Instruction:
find the flights that leave PHILADELPHIA and arrive in DALLAS by 1200
### Response:
| 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.arrival_time <= 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
### Instruction:
i want a evening flight from DALLAS to MILWAUKEE
### Response:
| 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 1800 AND 2200 |
### Instruction:
what flights are available between BOSTON and WASHINGTON arriving in WASHINGTON at 630
### Response:
| 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.arrival_time = 630 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
### Instruction:
until 12/30/2105, what was first arterial bp [diastolic] for patient 26175?
### Response:
| SELECT 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 = 26175)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) <= '2105-12-30' ORDER BY chartevents.charttime LIMIT 1 |
### Instruction:
can you list all nonstop flights departing from ST. PETERSBURG and arriving in CHARLOTTE
### Response:
| 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 = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.stops = 0 |
### Instruction:
i would like information on TW flights from WASHINGTON to PHILADELPHIA
### Response:
| 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'TW' |
### Instruction:
i'd like to know what flights UA has from DALLAS to SAN FRANCISCO
### Response:
| 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'UA' |
### Instruction:
the number of times that patient 594 had taken tpn d5.0 on 05/02/this year.
### Response:
| 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 = 594)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d5.0' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '05-02' |
### Instruction:
indicate the monthly maximum dose of replete w/fiber that patient 13806 has received until 07/2103.
### Response:
| SELECT MAX(inputevents_cv.amount) 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 = 13806)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'replete w/fiber' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y-%m', inputevents_cv.charttime) <= '2103-07' GROUP BY STRFTIME('%y-%m', inputevents_cv.charttime) |
### Instruction:
when did patient 006-133605 have a maximum systemicdiastolic for the last time on this month/27?
### Response:
| 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 = '006-133605')) AND NOT vitalperiodic.systemicdiastolic IS NULL AND DATETIME(vitalperiodic.observationtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', vitalperiodic.observationtime) = '27' ORDER BY vitalperiodic.systemicdiastolic DESC, vitalperiodic.observationtime DESC LIMIT 1 |
### Instruction:
i'd like an evening flight from NEWARK to LOS ANGELES
### Response:
| SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'NEWARK')) AND to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'LOS ANGELES'))) AND departure_time BETWEEN 1800 AND 2200) |
### Instruction:
indicate the yearly average arterial bp [systolic] of patient 18677 until 44 months ago.
### Response:
| SELECT AVG(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 = 18677)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) <= DATETIME(CURRENT_TIME(), '-44 month') GROUP BY STRFTIME('%y', chartevents.charttime) |
### Instruction:
looking for a flight from DC to DENVER COLORADO
### Response:
| SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.state_code = 'DC' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND state.state_code = CITY_1.state_code AND state.state_name = 'COLORADO' |
### Instruction:
please list the flights leaving from ST. LOUIS to ST. PAUL after 1000
### Response:
| 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND flight.departure_time > 1000 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. LOUIS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
### Instruction:
has tpn d17.5 been administered to patient 29666 in 04/this year?
### Response:
| SELECT COUNT(*) > 0 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 = 29666)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn d17.5' AND d_items.linksto = 'inputevents_cv') AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', inputevents_cv.charttime) = '04' |
### Instruction:
early morning flights between CINCINNATI and TAMPA
### Response:
| 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 = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TAMPA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 0 AND 800 |
### Instruction:
show me all flights on WN from SAN DIEGO to SAN FRANCISCO
### Response:
| 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'WN' |
### Instruction:
i would like some information on a flight from DENVER to SAN FRANCISCO on UA
### Response:
| 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'UA' |
### Instruction:
has sennosides-docusate sodium 8.6-50 mg po tabs, tamsulosin 0.4 mg cap, or neostigmine been prescribed to patient 030-72509 until 2104?
### Response:
| SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-72509')) AND medication.drugname IN ('sennosides-docusate sodium 8.6-50 mg po tabs', 'tamsulosin 0.4 mg cap', 'neostigmine') AND STRFTIME('%y', medication.drugstarttime) <= '2104' |
### Instruction:
when was the first time patient 3125 was having less than 92.0 heart rate today?
### Response:
| SELECT chartevents.charttime 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 = 3125)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') AND chartevents.valuenum < 92.0 AND DATETIME(chartevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') ORDER BY chartevents.charttime LIMIT 1 |
### Instruction:
Best time for an answer.
### Response:
| WITH tmp AS (SELECT TimeDiff = DATEDIFF(minute, q.CreationDate, CreationDate), Period = ROUND((CAST(DATEPART('weekday', q.CreationDate) AS DECIMAL) + CAST(DATEPART('hour', q.CreationDate) AS DECIMAL) / 24), 2) FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.AcceptedAnswerId > 0 AND q.CreationDate > DATEADD('year', -@YearsBack, CURRENT_TIMESTAMP())) SELECT Period, ROUND(AVG(CAST(TimeDiff AS FLOAT)), 2) AS "average_time-to-answer,_minutes,_utc_(gmt)" FROM tmp WHERE ABS(TimeDiff) < @MaxTimeDiff GROUP BY Period ORDER BY Period |
### Instruction:
what was the name of the procedure that was given two times to patient 51200 a month before?
### Response:
| 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 = 51200) AND DATETIME(procedures_icd.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2) |
### Instruction:
what airlines fly between BOSTON and SAN FRANCISCO
### Response:
| SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.airline_code = airline.airline_code AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code |
### Instruction:
what is the medication that patient 012-4131 had been prescribed two times in 11/this year?
### Response:
| SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', medication.drugstarttime) = '11' GROUP BY medication.drugname) AS t1 WHERE t1.c1 = 2 |
### Instruction:
okay all right do you have a flight on UA from ATLANTA to WASHINGTON
### Response:
| 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'UA' |
### Instruction:
how many days have passed since the first time that patient 12726 had a .9% normal saline intake on the current icu visit?
### Response:
| SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 12726) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.9% normal saline' AND d_items.linksto = 'inputevents_cv') ORDER BY inputevents_cv.charttime LIMIT 1 |
### Instruction:
i would like to fly from DENVER to PITTSBURGH on UA
### Response:
| 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 = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'UA' |
### Instruction:
information on AA from FORT WORTH texas to PHILADELPHIA
### Response:
| 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WORTH' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AA' |
### Instruction:
Amount of votes by top 5 voters.
### Response:
| SELECT SUM(DownVotes), SUM(UpVotes), SUM(DownVotes) / CAST(TotalDown AS FLOAT) * 100 AS "% of downvotes", SUM(DownVotes) / CAST(TotalPosts AS FLOAT) * 100 AS "% of Posts Downvoted" FROM (SELECT Users.DownVotes, Users.UpVotes FROM Users ORDER BY Users.DownVotes DESC LIMIT 5) AS T CROSS JOIN (SELECT SUM(DownVotes) AS TotalDown FROM Users WHERE Users.Id != -1) AS D CROSS JOIN (SELECT SUM(DownVotes) AS TotalUp FROM Users WHERE Users.Id != -1) AS U CROSS JOIN (SELECT SUM(DownVotes) AS TotalPosts FROM Users WHERE Users.Id != -1) AS P GROUP BY TotalDown, TotalUp, TotalPosts |
### Instruction:
indicate the monthly minimum arterial bp mean of patient 26195 since 1199 days ago.
### Response:
| SELECT MIN(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 = 26195)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) >= DATETIME(CURRENT_TIME(), '-1199 day') GROUP BY STRFTIME('%y-%m', chartevents.charttime) |
### Instruction:
how many hours has it been since the first time that patient 6170 on the current icu visit received a .9% normal saline intake?
### Response:
| SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 6170) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.9% normal saline' AND d_items.linksto = 'inputevents_cv') ORDER BY inputevents_cv.charttime LIMIT 1 |
### Instruction:
Which products have problems reported by both the staff named Lacey Bosco and the staff named Kenton Champlin?
### Response:
| SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Kenton" AND T3.staff_last_name = "Champlin" |
### Instruction:
today, what was first value of arterial bp [systolic] for patient 14671?
### Response:
| SELECT 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 = 14671)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') ORDER BY chartevents.charttime LIMIT 1 |
### Instruction:
flights from HOUSTON to LOS ANGELES departing after 2226
### Response:
| 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND flight.departure_time > 2226 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
### Instruction:
Those times you were stupid and you asked twice on the same day. ... so they don't count for the Asking Days badges curious/inquisitive/socratic.
### Response:
| SELECT questions.Id AS "post_link", DATE(questions.CreationDate) AS "date", initialQs.Id AS "post_link" FROM Posts AS questions JOIN Posts AS initialQs ON DATE(initialQs.CreationDate) = DATE(questions.CreationDate) WHERE questions.OwnerUserId = '##UserId##' AND questions.PostTypeId = 1 AND initialQs.OwnerUserId = '##UserId##' AND initialQs.PostTypeId = 1 GROUP BY questions.CreationDate, questions.Id, initialQs.Id, DATE(initialQs.CreationDate) HAVING questions.CreationDate > MIN(initialQs.CreationDate) ORDER BY questions.CreationDate DESC |
### Instruction:
list the morning flights between ATLANTA and DALLAS
### Response:
| 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND flight.departure_time BETWEEN 0 AND 1200 |
### Instruction:
tell me the top three most common diagnoses in patients in the age of 30s since 2103?
### Response:
| SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND STRFTIME('%y', diagnoses_icd.charttime) >= '2103' GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 3) |
### Instruction:
what is the cost of a round trip ticket FIRST class between OAK and ATL
### Response:
| SELECT DISTINCT fare.fare_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, fare, fare_basis, flight, flight_fare WHERE (AIRPORT_0.airport_code = 'OAK' AND AIRPORT_1.airport_code = 'ATL' AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id AND flight.from_airport = AIRPORT_0.airport_code AND flight.to_airport = AIRPORT_1.airport_code) AND NOT fare.round_trip_cost IS NULL |
### Instruction:
what are the new prescriptions today of patient 006-47576 compared to the prescriptions yesterday?
### Response:
| SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day') |
### Instruction:
of the patients with age 40s until 2103, what is the top four most frequent diagnoses?
### Response:
| SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND STRFTIME('%y', diagnoses_icd.charttime) <= '2103' GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 4) |
### Instruction:
Most Popular StackOverflow tags in 2018.
### Response:
| SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2018-07-31' AND Posts.CreationDate > '2018-01-01' GROUP BY TagName) AS rate INNER JOIN (SELECT COUNT(PostId) AS Num, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId GROUP BY TagName HAVING COUNT(PostId) > 800) AS num ON rate.TagName = num.TagName ORDER BY rate.rate DESC |
### Instruction:
what's the maximum heart rate of patient 19175 on last month/04?
### Response:
| 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 = 19175)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', chartevents.charttime) = '04' |
### Instruction:
count the number of times on this month/21 patient 71558 has produced cerebral drain r ventricular drain.
### Response:
| SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71558)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cerebral drain r ventricular drain' AND d_items.linksto = 'outputevents') AND DATETIME(outputevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', outputevents.charttime) = '21' |
### Instruction:
What are the prerequisites for GSI Randall Payne 's course ?
### Response:
| SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN course_offering ON COURSE_1.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id WHERE student.firstname LIKE 'Randall' AND student.lastname LIKE 'Payne' |
### Instruction:
when was patient 031-16123 tested for other microbiology for the last time in 09/last year?
### Response:
| SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'other' AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', microlab.culturetakentime) = '09' ORDER BY microlab.culturetakentime DESC LIMIT 1 |
### Instruction:
list all UA flights from BOSTON to SAN FRANCISCO
### Response:
| 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'UA' |
### Instruction:
how many hours have passed since the last time that patient 1902 has had an d5ns intake on the current intensive care unit visit?
### Response:
| SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 1902) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5ns' AND d_items.linksto = 'inputevents_cv') ORDER BY inputevents_cv.charttime DESC LIMIT 1 |
### Instruction:
when the first time that patient 11080 had a arterial bp [diastolic] measured until 287 days ago.
### Response:
| SELECT chartevents.charttime 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 = 11080)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) <= DATETIME(CURRENT_TIME(), '-287 day') ORDER BY chartevents.charttime LIMIT 1 |
### Instruction:
what was the name of the procedure performed to patient 14467, two or more times since 136 months ago?
### Response:
| 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 = 14467) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-136 month') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 >= 2) |
### Instruction:
when was the first time patient 14990 respiratory rate was measured less than 25.0 on the first icu visit.
### Response:
| SELECT chartevents.charttime 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 = 14990) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate' AND d_items.linksto = 'chartevents') AND chartevents.valuenum < 25.0 ORDER BY chartevents.charttime LIMIT 1 |
### Instruction:
tell me the volume of drain out #1 jackson pratt patient 73693 had on last month/10?
### Response:
| SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain out #1 jackson pratt' AND d_items.linksto = 'outputevents') AND DATETIME(outputevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', outputevents.charttime) = '10' |
### Instruction:
which airlines fly between BOSTON and BALTIMORE
### Response:
| SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.airline_code = airline.airline_code AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code |
### Instruction:
until 1 year ago, what are the five frequently ordered treatments for patients with age 40s?
### Response:
| 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, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 5) |
### Instruction:
what is the difference between the total amount of input and output for patient 18866 on the current intensive care unit visit?
### Response:
| SELECT (SELECT SUM(inputevents_cv.amount) 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 = 18866) AND icustays.outtime IS NULL)) - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866) AND icustays.outtime IS NULL)) |
### Instruction:
how many hours has elapsed since the last time that patient 12775 had an intake of tpn on the current icu visit?
### Response:
| SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 12775) AND icustays.outtime IS NULL) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn' AND d_items.linksto = 'inputevents_cv') ORDER BY inputevents_cv.charttime DESC LIMIT 1 |
### Instruction:
has patient 013-38992 received an order of 100 ml bag : sodium chloride 0.9 % 0.9 % iv solp, ondansetron 2 mg/1 ml 2ml sdv inj, or enoxaparin?
### Response:
| SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992')) AND medication.drugname IN ('100 ml bag : sodium chloride 0.9 % 0.9 % iv solp', 'ondansetron 2 mg/1 ml 2ml sdv inj', 'enoxaparin') |
### Instruction:
what is the name of a procedure that patient 73713 has been given for two times since 11/2105?
### Response:
| 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 = 73713) AND STRFTIME('%y-%m', procedures_icd.charttime) >= '2105-11' GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2) |
### Instruction:
Review results with links to the review page. Returns the full ReviewTaskResults table, with a link to the corresponding review page on the site.
Note that the site displays the user associated with each review task result, but the table does not.
### Response:
| SELECT 'site://review/close/' + CAST(ReviewTaskResults.ReviewTaskId AS TEXT) + '|' + CAST(ReviewTaskResults.ReviewTaskId AS TEXT) AS "Review Link", ReviewTasks.ReviewTaskTypeId, CASE WHEN ReviewTasks.ReviewTaskTypeId = 1 THEN 'suggested-edits' ELSE 'null' END, ReviewTaskTypes.Name, ReviewTaskResults.* FROM ReviewTaskResults JOIN ReviewTasks ON ReviewTaskResults.ReviewTaskId = ReviewTasks.Id JOIN ReviewTaskTypes ON ReviewTaskTypes.Id = ReviewTasks.ReviewTaskTypeId ORDER BY ReviewTaskResults.CreationDate DESC LIMIT 50 |
### Instruction:
What are the prerequisites for me before enrolling in ITALIAN 399 ?
### Response:
| SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT_RECORDalias0.student_id = 1) AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'ITALIAN' AND COURSE_1.number = 399 |
### Instruction:
Average Score for Questions and Answers by Month Since 2008.
### Response:
| SELECT TIME_TO_STR(Posts.CreationDate, '%Y') AS Year, TIME_TO_STR(Posts.CreationDate, '%m') AS Month, SUM(Score) AS SUM_SCORE, COUNT(*) AS COUNT_SCORE, AVG(CAST(Score AS FLOAT(12, 2))) AS AVG_SCORE, SUM(CASE WHEN PostTypeId < 3 THEN 1 ELSE 0 END) AS QnA FROM Posts WHERE PostTypeId < 3 GROUP BY TIME_TO_STR(Posts.CreationDate, '%Y'), TIME_TO_STR(Posts.CreationDate, '%m') HAVING TIME_TO_STR(Posts.CreationDate, '%Y') >= 2008 ORDER BY Year, Month |
### Instruction:
how many days since the last time patient 31088 was diagnosed with mch cmp autm mplnt dfbrl during their current hospital encounter.
### Response:
| SELECT 1 * (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 = 'mch cmp autm mplnt dfbrl') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088 AND admissions.dischtime IS NULL) ORDER BY diagnoses_icd.charttime DESC LIMIT 1 |
### Instruction:
show me the UA flights which go from BOSTON to WASHINGTON
### Response:
| 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'UA' |
### Instruction:
how many hours has elapsed since the last time patient 006-133605 had a per iv flush: forearm l intake on the current icu visit?
### Response:
| SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605') AND patient.unitdischargetime IS NULL) AND intakeoutput.celllabel = 'per iv flush: forearm l' AND intakeoutput.cellpath LIKE '%intake%' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1 |
### Instruction:
what is the yearly minimum dose of enteral osmolyte 1.2 that patient 015-75226 has taken until 34 days ago?
### Response:
| SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-75226')) AND intakeoutput.celllabel = 'enteral osmolyte 1.2' AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-34 day') GROUP BY STRFTIME('%y', intakeoutput.intakeoutputtime) |
### Instruction:
indicate the daily maximum amount of sao2 for patient 005-46456 in 11/last year.
### Response:
| SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(vitalperiodic.observationtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', vitalperiodic.observationtime) = '11' GROUP BY STRFTIME('%y-%m-%d', vitalperiodic.observationtime) |
### Instruction:
on the first hospital visit, what was the monthly minimum intake of 3/4 str ultracal of patient 14467?
### Response:
| SELECT MIN(inputevents_cv.amount) 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 = 14467 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '3/4 str ultracal' AND d_items.linksto = 'inputevents_cv') GROUP BY STRFTIME('%y-%m', inputevents_cv.charttime) |
### Instruction:
what was the first urine output time of patient 032-21820 on this month/30.
### Response:
| SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-21820')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urine' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '30' ORDER BY intakeoutput.intakeoutputtime LIMIT 1 |
### Instruction:
Anonymous feedback for a certain question and its answers.
### Response:
| SELECT COUNT(P.Id) AS VoteCount, VT.Name AS VoteType, P.Id AS "post_link", P.Id, U.DisplayName, P.Score, P.CreationDate, P.LastActivityDate FROM PostFeedback AS PF JOIN Posts AS P ON P.Id = PF.PostId JOIN Users AS U ON U.Id = P.OwnerUserId JOIN VoteTypes AS VT ON PF.VoteTypeId = VT.Id WHERE PF.IsAnonymous = 1 AND (P.Id = '##PostId##' OR P.ParentId = '##PostId##') GROUP BY P.Id, VT.Id, P.LastActivityDate, P.Score, P.CreationDate, VT.Name, U.DisplayName ORDER BY VoteCount DESC, VT.Id DESC |
### Instruction:
what is patient 4326's minimum arterial bp [diastolic] on 01/24/2105?
### Response:
| SELECT MIN(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 = 4326)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) = '2105-01-24' |
### Instruction:
Recently active users whose name contains special characters or who come from China. List of China-based users by reputation score. Query, naturally, by a Chinese user.
### Response:
| WITH CTE AS (SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, LastAccessDate, Reputation, Location, Views, DisplayName, CASE WHEN (CAST(DisplayName AS TEXT) COLLATE Chinese_PRC_BIN) = DisplayName THEN 0 ELSE 1 END AS HasChineseChar FROM Users) SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", LastAccessDate, Reputation, Location, Views FROM CTE WHERE LOWER(Location) LIKE '%china%' OR UPPER(Location) LIKE '%CHN' OR HasChineseChar = 1 ORDER BY Reputation DESC, Views DESC, DisplayName DESC, LastAccessDate DESC |
### Instruction:
does YX serve INDIANAPOLIS
### Response:
| 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 ((flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS') OR (flight.from_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIANAPOLIS')) AND flight.airline_code = 'YX' |
### Instruction:
flights on TW from COLUMBUS to ST. LOUIS
### Response:
| 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 = 'ST. LOUIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'COLUMBUS' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'TW' |
### Instruction:
what was the name of the procedure that patient 90369 received two times until 11/2105.
### Response:
| 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 = 90369) AND STRFTIME('%y-%m', procedures_icd.charttime) <= '2105-11' GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 = 2) |
### Instruction:
Most frequent tags in answers of the given user.
### Response:
| SELECT RANK() OVER (ORDER BY COUNT(a.Id) DESC) AS "rank", t.TagName, COUNT(a.Id) AS "count", SUM(a.Score) AS "score", SUM(CASE WHEN (a.CommunityOwnedDate IS NULL) THEN 1 ELSE 0 END) AS "non-cw", SUM(CASE WHEN (a.CommunityOwnedDate IS NULL) THEN a.Score ELSE 0 END) AS "non-cw_score" FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE a.OwnerUserId = '##userid?8297##' GROUP BY t.TagName ORDER BY COUNT(a.Id) DESC |
### Instruction:
Metrics - Users - Accumulated PU Ratio by Quarter.
### Response:
| SELECT r AS Registrated, COUNT(1) AS Users, SUM(s) AS Writers, ROUND(SUM(s) * 100.0 / COUNT(1), 2) AS "writers_%" FROM (SELECT u.Id, (CASE WHEN SUM(CASE WHEN p.PostTypeId = 2 AND (p.Score >= @minVote) THEN 1 ELSE 0 END) >= @minPost THEN 1 ELSE 0 END) AS s, (TIME_TO_STR(u.CreationDate, '%Y') * 100 + TIME_TO_STR(u.CreationDate, '%q')) AS r FROM Users AS u LEFT JOIN Posts AS p ON p.OwnerUserId = u.Id GROUP BY u.Id, u.CreationDate) AS X GROUP BY r ORDER BY r |
### Instruction:
what are the new drugs today of patient 016-9636 compared to those prescribed yesterday?
### Response:
| SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '016-9636') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '016-9636') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day') |
### Instruction:
since 112 months ago, what was the daily maximum weight of patient 28277?
### Response:
| 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 = 28277)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) >= DATETIME(CURRENT_TIME(), '-112 month') GROUP BY STRFTIME('%y-%m-%d', chartevents.charttime) |
### Instruction:
Count of questions with serverless tag over time.
### Response:
| SELECT DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') AS "week", COUNT(DISTINCT Posts.Id) AS Posts, SUM(Posts.AnswerCount) AS Answers, SUM(Posts.CommentCount) AS Comments FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName LIKE 'bigcommerce' AND PostTypeId = 1 AND CreationDate > '2013-01-06' GROUP BY DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') ORDER BY 'week' DESC |
### Instruction:
how many days has it been since last time patient 025-50213 was prescribed dextrose 50% 25 gram/50 ml syr during this hospital encounter?
### Response:
| SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50213') AND patient.hospitaldischargetime IS NULL) AND medication.drugname = 'dextrose 50% 25 gram/50 ml syr' ORDER BY medication.drugstarttime DESC LIMIT 1 |
### Instruction:
how many hours has it elapsed since patient 97395's last diagnosis of trnspl status-bne marrow on this hospital visit?
### Response:
| 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 = 'trnspl status-bne marrow') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97395 AND admissions.dischtime IS NULL) ORDER BY diagnoses_icd.charttime DESC LIMIT 1 |
### Instruction:
give me all the flights from MIAMI to CHICAGO on AA
### Response:
| 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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AA' |
### Instruction:
when did patient 031-15666 first have their minimum respiration on 12/22/last year?
### Response:
| 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 = '031-15666')) AND NOT vitalperiodic.respiration IS NULL AND DATETIME(vitalperiodic.observationtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m-%d', vitalperiodic.observationtime) = '12-22' ORDER BY vitalperiodic.respiration, vitalperiodic.observationtime LIMIT 1 |
### Instruction:
hello i would like to plan a flight on AA from BOSTON to DENVER
### Response:
| 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 = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_0.airport_code AND flight.from_airport = AIRPORT_SERVICE_1.airport_code) AND flight.airline_code = 'AA' |
### Instruction:
Among upper level classes , which do not require 662 ?
### Response:
| SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.course_id) AND COURSE_1.department = 'department0' AND COURSE_1.number = 662 AND PROGRAM_COURSE_0.category LIKE '%ULCS%' AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id |
Subsets and Splits