instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Name the type that joined 2007 | CREATE TABLE table_28516 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Nickname" text,
"Primary Conference when joining the MSFA" text,
"Current Primary Conference" text
) | SELECT "Type" FROM table_28516 WHERE "Joined" = '2007' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the type that joined 2007 ### Input: CREATE TABLE table_28516 (
"Institution" text,
"Location" text,
"Found... |
what was the top three diagnosis with the highest four year mortality rate? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the top three diagnosis with the highest four year mortality rate? ### Input: CREATE TABLE labevents (
row_id n... |
What are the official name(s) of places with an area of 304.06 km2? | CREATE TABLE table_176521_2 (
official_name VARCHAR,
area_km_2 VARCHAR
) | SELECT official_name FROM table_176521_2 WHERE area_km_2 = "304.06" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the official name(s) of places with an area of 304.06 km2? ### Input: CREATE TABLE table_176521_2 (
official_na... |
when has patient 029-8147 visited the hospital for the first time until 4 years ago? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-8147' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when has patient 029-8147 visited the hospital for the first time until 4 years ago? ### Input: CREATE TABLE lab (
labid... |
when did patient 1205 receive a first diagnosis of twin-mate lb-in hos w cs since 4 years ago? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
h... | SELECT 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 = 'twin-mate lb-in hos w cs') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1205) AND DATETIM... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 1205 receive a first diagnosis of twin-mate lb-in hos w cs since 4 years ago? ### Input: CREATE TABLE patie... |
count the number of patients whose year of birth is less than 2090 and drug route is ih? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2090" AND prescriptions.route = "IH" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose year of birth is less than 2090 and drug route is ih? ### Input: CREATE TABLE lab (
s... |
how many patients whose gender is m and lab test name is heparin, lmw? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Heparin, LMW" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose gender is m and lab test name is heparin, lmw? ### Input: CREATE TABLE procedures (
subject_id t... |
how many patients born before the year 1837 had the drug named piperacillin-tazobactum na? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1837" AND prescriptions.drug = "Piperacillin-Tazobactam Na" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients born before the year 1837 had the drug named piperacillin-tazobactum na? ### Input: CREATE TABLE procedure... |
Show me the average of baseprice by bedtype in a histogram | CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me the average of baseprice by bedtype in a histogram ### Input: CREATE TABLE Rooms (
RoomId TEXT,
roomName TEX... |
What was the score of the January 8 game? | CREATE TABLE table_3849 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "Score" FROM table_3849 WHERE "Date" = 'January 8' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the January 8 game? ### Input: CREATE TABLE table_3849 (
"Game" real,
"Date" text,
"Team" ... |
For all employees who have the letters D or S in their first name, a line chart shows the change of manager_id over hire_date, and sort HIRE_DATE in descending order. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, a line chart shows the change of manager_id over hire_dat... |
Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart, list from high to low by the Attendance. | CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int... | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 ORDER BY Attendance DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart, list from ... |
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the headquarter , and group by attribute headquarter by a bar chart, display by the total number in desc. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Price) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the ... |
What was the score on October 30? | CREATE TABLE table_name_64 (
score VARCHAR,
date VARCHAR
) | SELECT score FROM table_name_64 WHERE date = "october 30" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score on October 30? ### Input: CREATE TABLE table_name_64 (
score VARCHAR,
date VARCHAR
) ### Response... |
what is drug code of drug name simethicone? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Simethicone" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is drug code of drug name simethicone? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid ... |
how many patients below 31 years of age have had enteral infusion of concentrated nutritional substances? | 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.long_title = "Enteral infusion of concentrated nutritional substances" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients below 31 years of age have had enteral infusion of concentrated nutritional substances? ### Input: CREATE ... |
how many asian patients have the diagnoses titled major depressive affective disorder, single episode, unspecified? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Major depressive affective disorder, single episode, unspecified" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many asian patients have the diagnoses titled major depressive affective disorder, single episode, unspecified? ### Inpu... |
what flights from PHILADELPHIA to ATLANTA | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_des... | 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 = 'A... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights from PHILADELPHIA to ATLANTA ### Input: CREATE TABLE city (
city_code varchar,
city_name varchar,
s... |
what was the name of the last intake that patient 016-3041 had on 03/18/last year. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | 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 = '016-3041')) AND intakeoutput.cellpath LIKE '%intake%' AND DA... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the last intake that patient 016-3041 had on 03/18/last year. ### Input: CREATE TABLE cost (
costid... |
did patient 011-14590's systemicmean ever be less than 91.0 since 03/2105? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-14590')) AND vitalperiodic.systemicmean < 91.0 AND NOT vitalperi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 011-14590's systemicmean ever be less than 91.0 since 03/2105? ### Input: CREATE TABLE lab (
labid number,
... |
What is the average time with a rank lower than 2 for Andy Turner? | CREATE TABLE table_name_24 (
time INTEGER,
rank VARCHAR,
name VARCHAR
) | SELECT AVG(time) FROM table_name_24 WHERE rank > 2 AND name = "andy turner" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average time with a rank lower than 2 for Andy Turner? ### Input: CREATE TABLE table_name_24 (
time INTEGER,... |
what were the four most common drugs that were prescribed to patients during the same month after they were prescribed with heparin (preservative free) during this year? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin (preservative free)' AND DATETIME(prescriptions.startdate... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the four most common drugs that were prescribed to patients during the same month after they were prescribed with ... |
What are the total number of students who are living in a male dorm? | CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE has_amenity (
dormid number,
amen... | SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the total number of students who are living in a male dorm? ### Input: CREATE TABLE dorm_amenity (
amenid numbe... |
what was the first date of the first international competition ? | CREATE TABLE table_203_6 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | SELECT "date" FROM table_203_6 ORDER BY id LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first date of the first international competition ? ### Input: CREATE TABLE table_203_6 (
id number,
"#... |
what were the top four most frequent diagnoses of the patients of age 50s in the last year? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title 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 TABL... | 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... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top four most frequent diagnoses of the patients of age 50s in the last year? ### Input: CREATE TABLE d_icd_pr... |
Who went to ohio state? | CREATE TABLE table_10730 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | SELECT "Player" FROM table_10730 WHERE "College" = 'ohio state' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who went to ohio state? ### Input: CREATE TABLE table_10730 (
"Player" text,
"Position" text,
"School" text,
... |
Pie. what are the different card types, and how many cards are there of each? | CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phon... | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Pie. what are the different card types, and how many cards are there of each? ### Input: CREATE TABLE Accounts (
account... |
Show different types of ships and the average tonnage of ships of each type in a bar chart, and rank Type in descending order. | CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY Type DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show different types of ships and the average tonnage of ships of each type in a bar chart, and rank Type in descending orde... |
Return a bar chart about the distribution of meter_700 and ID . | CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
... | SELECT meter_700, ID FROM swimmer | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of meter_700 and ID . ### Input: CREATE TABLE record (
ID int,
Result text... |
how many days has passed since patient 031-13920 had a mch laboratory test for the last time on the current hospital encounter? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13920' AND patient.hospi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days has passed since patient 031-13920 had a mch laboratory test for the last time on the current hospital encount... |
Name the professor or teacher teaching CICS 301 ? | CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CICS' AND course.number = 301 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the professor or teacher teaching CICS 301 ? ### Input: CREATE TABLE course (
course_id int,
name varchar,
... |
What are the total number of credits offered by each department Show bar chart, could you show in ascending by the bar? | CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
... | SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY DEPT_CODE | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the total number of credits offered by each department Show bar chart, could you show in ascending by the bar? ### ... |
What was Mu's title? | CREATE TABLE table_name_6 (
title VARCHAR,
name VARCHAR
) | SELECT title FROM table_name_6 WHERE name = "mu" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was Mu's title? ### Input: CREATE TABLE table_name_6 (
title VARCHAR,
name VARCHAR
) ### Response: SELECT title... |
diastolic blood pressure > 90 mm hg at rest | CREATE TABLE table_train_152 (
"id" int,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"total_cholesterol" int,
"urine_protein" int,
"proteinuria" int,
"NOUSE" float
) | SELECT * FROM table_train_152 WHERE diastolic_blood_pressure_dbp > 90 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: diastolic blood pressure > 90 mm hg at rest ### Input: CREATE TABLE table_train_152 (
"id" int,
"systolic_blood_pres... |
What's the score at Olympic Stadium Tokyo, Japan? | CREATE TABLE table_name_49 (
score VARCHAR,
venue VARCHAR
) | SELECT score FROM table_name_49 WHERE venue = "olympic stadium tokyo, japan" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the score at Olympic Stadium Tokyo, Japan? ### Input: CREATE TABLE table_name_49 (
score VARCHAR,
venue VARCH... |
what is the minimum total cost of the hospital involving a laboratory acetaminophen test this year? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'acetaminophen')) AND DATETIME(cost.chargetime, 'start of year') = DA... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the minimum total cost of the hospital involving a laboratory acetaminophen test this year? ### Input: CREATE TABLE ... |
let me know the number of patients with medicare insurance who have rash as the primary disease. | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.diagnosis = "RASH" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: let me know the number of patients with medicare insurance who have rash as the primary disease. ### Input: CREATE TABLE lab... |
What is the result for 2004 when A is the result for 2005, and the result of q1 when 2009? | CREATE TABLE table_name_32 (
Id VARCHAR
) | SELECT 2004 FROM table_name_32 WHERE 2005 = "a" AND 2009 = "q1" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result for 2004 when A is the result for 2005, and the result of q1 when 2009? ### Input: CREATE TABLE table_nam... |
Number of posts by user age and location. | CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | SELECT a2."age" AS "UsersCopyAge", a2.Location AS "UsersCopyLocation", COUNT(*) AS "count_posts" FROM "Posts " AS a1 LEFT OUTER JOIN Users AS a2 ON (a2.Id = a1."LastEditorUserId ") WHERE (a2.Location IN ('France', 'India')) GROUP BY a2."age", a2.Location ORDER BY 'UsersCopyAge' DESC, 'UsersCopyLocation' DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number of posts by user age and location. ### Input: CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
N... |
what is the primary disease of the patient id 3343? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.diagnosis FROM demographic WHERE demographic.subject_id = "3343" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the primary disease of the patient id 3343? ### Input: CREATE TABLE demographic (
subject_id text,
hadm_id t... |
What was the away score at VFL Park? | CREATE TABLE table_57674 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team score" FROM table_57674 WHERE "Venue" = 'vfl park' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away score at VFL Park? ### Input: CREATE TABLE table_57674 (
"Home team" text,
"Home team score" text,... |
how many unmarried patients have diagnoses icd9 code 70724? | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.icd9_code = "70724" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many unmarried patients have diagnoses icd9 code 70724? ### Input: CREATE TABLE prescriptions (
subject_id text,
... |
what is the mchc difference/difference of patient 032-17571 second measured on the last hospital visit compared to the first value measured on the last hospital visit? | 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,
... | SELECT (SELECT 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 = '032-17571' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the mchc difference/difference of patient 032-17571 second measured on the last hospital visit compared to the first... |
what is minimum age of patients whose gender is f and primary disease is congestive heart failure? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose gender is f and primary disease is congestive heart failure? ### Input: CREATE TABLE d... |
Among patients who had a lab test for cerebrospinal fluid (CSF), how many of them had st elevated myocardial infarction or cardiac cath as their primary disease? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Among patients who had a lab test for cerebrospinal fluid (CSF), how many of them had st elevated myocardial infarction or c... |
What is the rank for the team with a Time of 1:12.40.28? | CREATE TABLE table_name_94 (
rank INTEGER,
time VARCHAR
) | SELECT SUM(rank) FROM table_name_94 WHERE time = "1:12.40.28" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rank for the team with a Time of 1:12.40.28? ### Input: CREATE TABLE table_name_94 (
rank INTEGER,
time ... |
Will HUMGEN 821 have more than one lecture section next semester , and if so , how many ? | CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varc... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HUMGEN' AND course.number = 821 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Will HUMGEN 821 have more than one lecture section next semester , and if so , how many ? ### Input: CREATE TABLE area (
... |
how many patients diagnosed with malig nneo brain nec are tested for urine in lab? | 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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Malig neo brain NEC" AND lab.fluid = "Urine" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients diagnosed with malig nneo brain nec are tested for urine in lab? ### Input: CREATE TABLE prescriptions (
... |
Sum the amount for all the payments processed with Visa by each year using a bar chart. | CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,... | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Sum the amount for all the payments processed with Visa by each year using a bar chart. ### Input: CREATE TABLE Claims (
... |
how many patients whose admission location is emergency room admit and days of hospital stay is greater than 6? | 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay > "6" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission location is emergency room admit and days of hospital stay is greater than 6? ### Input: C... |
What is the total number of bronze when gold is less than 1 and silver is more than 1? | CREATE TABLE table_40681 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT SUM("Bronze") FROM table_40681 WHERE "Gold" < '1' AND "Silver" > '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of bronze when gold is less than 1 and silver is more than 1? ### Input: CREATE TABLE table_40681 (... |
How many patients underwent the procedure with the short title of procedure-two vessels that were discharged to skilled nursing facility? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Procedure-two vessels" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients underwent the procedure with the short title of procedure-two vessels that were discharged to skilled nurs... |
how man c windmills have there been ? | CREATE TABLE table_204_929 (
id number,
"location" text,
"name of mill and\ngrid reference" text,
"type" text,
"maps" text,
"first mention\nor built" text,
"last mention\nor demise" number
) | SELECT COUNT(*) FROM table_204_929 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how man c windmills have there been ? ### Input: CREATE TABLE table_204_929 (
id number,
"location" text,
"name ... |
Who has the world record of 153kg in the clean & jerk? | CREATE TABLE table_name_27 (
world_record VARCHAR
) | SELECT 153 AS kg FROM table_name_27 WHERE world_record = "clean & jerk" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who has the world record of 153kg in the clean & jerk? ### Input: CREATE TABLE table_name_27 (
world_record VARCHAR
) ##... |
what is maximum age of patients whose gender is m and ethnicity is black/haitian? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/HAITIAN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum age of patients whose gender is m and ethnicity is black/haitian? ### Input: CREATE TABLE procedures (
s... |
specify the number of unmarried patients who had lab test for clinical chemistry | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab."CATEGORY" = "Chemistry" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the number of unmarried patients who had lab test for clinical chemistry ### Input: CREATE TABLE diagnoses (
sub... |
What did the home team score at Princes Park? | CREATE TABLE table_53393 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team score" FROM table_53393 WHERE "Venue" = 'princes park' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What did the home team score at Princes Park? ### Input: CREATE TABLE table_53393 (
"Home team" text,
"Home team sco... |
Show me a bar chart for what is the average song rating for each language?, list by the names from low to high please. | CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
la... | SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart for what is the average song rating for each language?, list by the names from low to high please. ### I... |
what is the average rating of songs for each language? | CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating nu... | SELECT languages, AVG(rating) FROM song GROUP BY languages | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the average rating of songs for each language? ### Input: CREATE TABLE files (
f_id number(10),
artist_name ... |
provide the number of patients whose admission type is urgent and lab test name is neutrophils? | 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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Neutrophils" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission type is urgent and lab test name is neutrophils? ### Input: CREATE TABLE pres... |
Find meter_200 and the average of meter_100 , and group by attribute meter_200, and visualize them by a bar chart, and list mean meter 100 from high to low order. | CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY AVG(meter_100) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find meter_200 and the average of meter_100 , and group by attribute meter_200, and visualize them by a bar chart, and list ... |
If the average start is 11.8, what was the team name? | CREATE TABLE table_2511 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | SELECT "Team(s)" FROM table_2511 WHERE "Avg. Start" = '11.8' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the average start is 11.8, what was the team name? ### Input: CREATE TABLE table_2511 (
"Year" real,
"Starts" rea... |
what is the name of the drug that patient 808 was prescribed within 2 days, after being diagnosed this month with unsp hemiplga unspf side? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_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,
charttime time,
itemid number... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 808 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'unsp hem... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of the drug that patient 808 was prescribed within 2 days, after being diagnosed this month with unsp hemip... |
Name the Finish which has a Total of 287? | CREATE TABLE table_12206 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | SELECT "Finish" FROM table_12206 WHERE "Total" = '287' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the Finish which has a Total of 287? ### Input: CREATE TABLE table_12206 (
"Player" text,
"Country" text,
"... |
What is the average to par for a score of 78-67-73=218? | CREATE TABLE table_13140 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | SELECT AVG("To par") FROM table_13140 WHERE "Score" = '78-67-73=218' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average to par for a score of 78-67-73=218? ### Input: CREATE TABLE table_13140 (
"Place" text,
"Player"... |
Give me the comparison about the sum of ID over the Nationality , and group by attribute Nationality by a bar chart, order by the bar from low to high. | CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about the sum of ID over the Nationality , and group by attribute Nationality by a bar chart, order b... |
what were the five most frequently given procedures for patients who had already had sedative agent - lorazepam within 2 months during the previous year? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'sedative agent - lorazepam' AND DATETIME... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five most frequently given procedures for patients who had already had sedative agent - lorazepam within 2 mon... |
significant renal impairment ( glomerular filtration rate < 60 ml / min [to be calculated by the central laboratory] ) ; | CREATE TABLE table_train_231 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"stroke" bool,
"renal_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"allergy_to_milk" bool,
"NOUSE" float
) | SELECT * FROM table_train_231 WHERE renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 60 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: significant renal impairment ( glomerular filtration rate < 60 ml / min [to be calculated by the central laboratory] ) ; ###... |
Show all the actual delivery dates and bin by weekday in a bar chart, could you display how many actual delivery date in ascending order? | CREATE TABLE Performers (
Performer_ID INTEGER,
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(... | SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY COUNT(Actual_Delivery_Date) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all the actual delivery dates and bin by weekday in a bar chart, could you display how many actual delivery date in asc... |
What is the lowest amount of medals Russia has if they have more than 2 silver medals and less than 4 gold medals? | CREATE TABLE table_31759 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Total") FROM table_31759 WHERE "Silver" > '2' AND "Nation" = 'russia' AND "Gold" < '4' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest amount of medals Russia has if they have more than 2 silver medals and less than 4 gold medals? ### Input... |
For those employees who was hired before 2002-06-21, what is the relationship between commission_pct and manager_id ? | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, what is the relationship between commission_pct and manager_id ? ### In... |
Who was the director of episode 11 based on season? | CREATE TABLE table_25277296_2 (
directed_by VARCHAR,
no_in_season VARCHAR
) | SELECT directed_by FROM table_25277296_2 WHERE no_in_season = 11 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the director of episode 11 based on season? ### Input: CREATE TABLE table_25277296_2 (
directed_by VARCHAR,
... |
I want to know the proportion of the average student GPA for each dept code. | CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
... | SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to know the proportion of the average student GPA for each dept code. ### Input: CREATE TABLE DEPARTMENT (
DEPT_C... |
what were the three most frequent drugs that were prescribed to male patients 30s during the same hospital visit after having been diagnosed with nonrupt cerebral aneurym since 2104? | 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... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the three most frequent drugs that were prescribed to male patients 30s during the same hospital visit after havin... |
when does patient 025-28600 have received a abscess microbiology test for the last time in 09/this year? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | 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 = '025-28600')) AND microlab.culturesite = 'abscess' AND DATETIME(mi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when does patient 025-28600 have received a abscess microbiology test for the last time in 09/this year? ### Input: CREATE T... |
What are the name of rooms booked by customers whose first name has 'ROY' in part, and count them by a bar chart, and rank x-axis in asc order please. | CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the name of rooms booked by customers whose first name has 'ROY' in part, and count them by a bar chart, and rank x... |
whats the cost for creatinine? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'creatinine') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: whats the cost for creatinine? ### Input: CREATE TABLE medication (
medicationid number,
patientunitstayid number,
... |
Give me the comparison about author_tutor_ATB over the middle_name by a bar chart. | CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Course_Authors_and_... | SELECT middle_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about author_tutor_ATB over the middle_name by a bar chart. ### Input: CREATE TABLE Student_Tests_Tak... |
when was patient 73423 for the first time prescribed a drug via po/ng route until 63 months ago? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73423) AND prescriptions.route = 'po/ng' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-63 month') ORDER BY prescriptions.startdate LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 73423 for the first time prescribed a drug via po/ng route until 63 months ago? ### Input: CREATE TABLE dia... |
count the number of patients whose age is less than 30 and lab test abnormal status is delta? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "30" AND lab.flag = "delta" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose age is less than 30 and lab test abnormal status is delta? ### Input: CREATE TABLE demogr... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and sort by the bar from low to high please. | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
What is the Region, when the Catalog is SM 2965-05? | CREATE TABLE table_48238 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | SELECT "Region" FROM table_48238 WHERE "Catalog" = 'sm 2965-05' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Region, when the Catalog is SM 2965-05? ### Input: CREATE TABLE table_48238 (
"Region" text,
"Date" text... |
How many tries against for the team with 67 tries for? | CREATE TABLE table_59235 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | SELECT "Tries against" FROM table_59235 WHERE "Tries for" = '67' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many tries against for the team with 67 tries for? ### Input: CREATE TABLE table_59235 (
"Club" text,
"Played" t... |
What clu was in toronto 1995-96 | CREATE TABLE table_1 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | SELECT "School/Club Team" FROM table_1 WHERE "Years in Toronto" = '1995-96' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What clu was in toronto 1995-96 ### Input: CREATE TABLE table_1 (
"Player" text,
"No." text,
"Nationality" text,... |
How many mills of 'Grondzeiler' type are built in each year? Give me the trend. | CREATE TABLE bridge (
architect_id int,
id int,
name text,
location text,
length_meters real,
length_feet real
)
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
... | SELECT built_year, COUNT(built_year) FROM mill WHERE type = 'Grondzeiler' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many mills of 'Grondzeiler' type are built in each year? Give me the trend. ### Input: CREATE TABLE bridge (
archite... |
Which To par is scored at 70? | CREATE TABLE table_43771 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | SELECT "To par" FROM table_43771 WHERE "Score" = '70' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which To par is scored at 70? ### Input: CREATE TABLE table_43771 (
"Place" text,
"Player" text,
"Country" text,... |
when was patient 18677 prescribed the drug pantoprazole and omeprazole at the same time for the last time since 10/2103? | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id ... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'pantoprazole' AND admissions.subject_id = 18677 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-10') AS t1 JOIN (SELECT adm... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 18677 prescribed the drug pantoprazole and omeprazole at the same time for the last time since 10/2103? ###... |
Show the working years of managers in descending order of their level. | CREATE TABLE manager (
Working_year_starts VARCHAR,
LEVEL VARCHAR
) | SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the working years of managers in descending order of their level. ### Input: CREATE TABLE manager (
Working_year_st... |
Show the average of cloud cover from each date, and I want to rank by the y-axis in asc. | CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
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_... | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the average of cloud cover from each date, and I want to rank by the y-axis in asc. ### Input: CREATE TABLE status (
... |
For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the name , and group by attribute name, and list by the Y-axis in ascending. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over th... |
what are the percentile of 83.0 in a glucose lab test given the same age of patient 42473 during their current hospital visit? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age =... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the percentile of 83.0 in a glucose lab test given the same age of patient 42473 during their current hospital visi... |
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? | 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 patient (
uniquep... | 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 ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### 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 vi... |
for how many days did darlene martin stay in the hospital and what was her drug route? | 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... | SELECT demographic.days_stay, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Darlene Martin" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: for how many days did darlene martin stay in the hospital and what was her drug route? ### Input: CREATE TABLE prescriptions... |
what is the new prescription of patient 8116 today vs. the one yesterday? | 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 inputevents_cv (
row_id number,
subject_id number,
... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the new prescription of patient 8116 today vs. the one yesterday? ### Input: CREATE TABLE icustays (
row_id numb... |
The time of 8:34.27 was set by what athlete? | CREATE TABLE table_13943 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | SELECT "Athlete" FROM table_13943 WHERE "Time" = '8:34.27' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The time of 8:34.27 was set by what athlete? ### Input: CREATE TABLE table_13943 (
"Rank" real,
"Athlete" text,
... |
what is the average total cost of a hospital that includes mpv laboratory tests since 2 years ago? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'mpv')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-2... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the average total cost of a hospital that includes mpv laboratory tests since 2 years ago? ### Input: CREATE TABLE i... |
In which district is the incumbent a republican first elected in 1998? | CREATE TABLE table_62132 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | SELECT "District" FROM table_62132 WHERE "Party" = 'republican' AND "First elected" = '1998' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In which district is the incumbent a republican first elected in 1998? ### Input: CREATE TABLE table_62132 (
"District" ... |
What horizontal bar score also has a pommel horse score of 15.250? | CREATE TABLE table_name_60 (
horizontal_bar VARCHAR,
pommel_horse VARCHAR
) | SELECT horizontal_bar FROM table_name_60 WHERE pommel_horse = "15.250" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What horizontal bar score also has a pommel horse score of 15.250? ### Input: CREATE TABLE table_name_60 (
horizontal_ba... |
What is every total for the University of the Cordilleras UC Dance Squad? | CREATE TABLE table_2523 (
"Rank" real,
"School" text,
"Basic Elements" real,
"Tumbling" real,
"Stunts" text,
"Pyramids" text,
"Tosses" text,
"Deductions" text,
"Total" text
) | SELECT "Total" FROM table_2523 WHERE "School" = 'University of the Cordilleras UC Dance Squad' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every total for the University of the Cordilleras UC Dance Squad? ### Input: CREATE TABLE table_2523 (
"Rank" re... |
what was patient 13054's daily average value of body weight this month? | 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
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE tra... | 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 = 13054)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 13054's daily average value of body weight this month? ### Input: CREATE TABLE prescriptions (
row_id n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.