instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Name the week number for the beatles | CREATE TABLE table_19508635_1 (
week__number VARCHAR,
theme VARCHAR
) | SELECT week__number FROM table_19508635_1 WHERE theme = "The Beatles" | 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 week number for the beatles ### Input: CREATE TABLE table_19508635_1 (
week__number VARCHAR,
theme VARCHAR
... |
What is the Position of Pick #321? | CREATE TABLE table_74916 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | SELECT "Position" FROM table_74916 WHERE "Pick #" = '321' | 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 Position of Pick #321? ### Input: CREATE TABLE table_74916 (
"Pick #" real,
"Round" text,
"Player" t... |
provide the number of patients whose diagnoses short title is hy kid nos w cr kid i-iv? | 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 diagnoses.short_title = "Hy kid NOS w cr kid I-IV" | 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 diagnoses short title is hy kid nos w cr kid i-iv? ### Input: CREATE TABLE demographic ... |
Which upper level CS courses are offered next semester ? | CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | 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 upper level CS courses are offered next semester ? ### Input: CREATE TABLE requirement (
requirement_id int,
r... |
What is the name of the role that has a Title of Salud, Dinero y Amor and antagonist in the notes field? | CREATE TABLE table_name_26 (
role VARCHAR,
notes VARCHAR,
title VARCHAR
) | SELECT role FROM table_name_26 WHERE notes = "antagonist" AND title = "salud, dinero y amor" | 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 role that has a Title of Salud, Dinero y Amor and antagonist in the notes field? ### Input: CREATE T... |
The competition that took place on 4 Apr 1997 ended with what as the score? | CREATE TABLE table_15692 (
"Date" text,
"Score" text,
"Location" text,
"Competition" text,
"Serial No." text
) | SELECT "Score" FROM table_15692 WHERE "Date" = '4 apr 1997' | 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 competition that took place on 4 Apr 1997 ended with what as the score? ### Input: CREATE TABLE table_15692 (
"Date"... |
give me the top four most common procedures until 1 year ago? | 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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 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: give me the top four most common procedures until 1 year ago? ### Input: CREATE TABLE patient (
uniquepid text,
pati... |
What is the Time of the Rowers in Rank 1? | CREATE TABLE table_66667 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | SELECT "Time" FROM table_66667 WHERE "Rank" = '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 Time of the Rowers in Rank 1? ### Input: CREATE TABLE table_66667 (
"Rank" real,
"Rowers" text,
"Cou... |
Where does St Kilda play? | CREATE TABLE table_58564 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_58564 WHERE "Home team" = 'st kilda' | 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: Where does St Kilda play? ### Input: CREATE TABLE table_58564 (
"Home team" text,
"Home team score" text,
"Away ... |
The easiest class I can take to fulfill the MDE requirement is what ? | CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | 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 easiest class I can take to fulfill the MDE requirement is what ? ### Input: CREATE TABLE ta (
campus_job_id int,
... |
When did a home team score 9.6 (60)? | CREATE TABLE table_55194 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_55194 WHERE "Home team score" = '9.6 (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: When did a home team score 9.6 (60)? ### Input: CREATE TABLE table_55194 (
"Home team" text,
"Home team score" text,... |
what is patient 015-67291's length of stay in the icu for the last time? | 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 STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-67291') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC 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 is patient 015-67291's length of stay in the icu for the last time? ### Input: CREATE TABLE vitalperiodic (
vitalpe... |
count the number of patients who were diagnosed with acute copd exacerbation in the same hospital encounter after they were diagnosed with anemia - anemia of chronic disease since 2105. | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute copd exacerbation' AND STRFTIME('%y', diagnosis.diagnosistime) >= '... | 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 who were diagnosed with acute copd exacerbation in the same hospital encounter after they were ... |
how many patients admitted before year 2182 had the primary disease aortic insufficiency\re-do sternotomy; aortic valve replacement? | 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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear < "2182" | 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 admitted before year 2182 had the primary disease aortic insufficiency\re-do sternotomy; aortic valve repl... |
What is the score of game 33? | CREATE TABLE table_15780049_6 (
score VARCHAR,
game VARCHAR
) | SELECT score FROM table_15780049_6 WHERE game = 33 | 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 score of game 33? ### Input: CREATE TABLE table_15780049_6 (
score VARCHAR,
game VARCHAR
) ### Response:... |
Show the number of apartment bookings for each year and bin booking start date by year interval in a bar chart, and show by the Y in descending. | CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_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: Show the number of apartment bookings for each year and bin booking start date by year interval in a bar chart, and show by ... |
Give me the comparison about School_ID over the ACC_Road , and group by attribute All_Home. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road | 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 School_ID over the ACC_Road , and group by attribute All_Home. ### Input: CREATE TABLE universi... |
how many days have passed since the last time that patient 033-22108 was prescribed morphine sulfate during their current hospital encounter? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | 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 = '033-221... | 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 have passed since the last time that patient 033-22108 was prescribed morphine sulfate during their current ho... |
what is minimum age of patients whose marital status is divorced and admission type is elective? | 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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "ELECTIVE" | 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 marital status is divorced and admission type is elective? ### Input: CREATE TABLE pro... |
Find the name of the department that has the fewest members. | CREATE TABLE MEMBER_OF (
DNO VARCHAR
)
CREATE TABLE DEPARTMENT (
DName VARCHAR,
DNO VARCHAR
) | SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) 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: Find the name of the department that has the fewest members. ### Input: CREATE TABLE MEMBER_OF (
DNO VARCHAR
)
CREATE T... |
What is the result of the game when the attendance is 62,078? | CREATE TABLE table_name_6 (
result VARCHAR,
attendance VARCHAR
) | SELECT result FROM table_name_6 WHERE attendance = "62,078" | 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 of the game when the attendance is 62,078? ### Input: CREATE TABLE table_name_6 (
result VARCHAR,
... |
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, could you list bar in asc order? | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' 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 all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the sum ... |
Return the number of the claim start date for the claims whose claimed amount is no more than the average, and list by the y axis from low to high. | CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE... | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) | 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 the number of the claim start date for the claims whose claimed amount is no more than the average, and list by the y... |
since 1409 days ago, has patient 25814's arterial bp [systolic] been ever greater than 113.0? | 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | 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 [syst... | 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: since 1409 days ago, has patient 25814's arterial bp [systolic] been ever greater than 113.0? ### Input: CREATE TABLE prescr... |
what is the earliest flight from BOSTON to SAN FRANCISCO | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FR... | 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 earliest flight from BOSTON to SAN FRANCISCO ### Input: CREATE TABLE month (
month_number int,
month_nam... |
Do you know if SPANISH 299 is being offered next semester ? | CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program (
program_id int,
name varchar,
... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SPANISH' AND course.number = 299 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: Do you know if SPANISH 299 is being offered next semester ? ### Input: CREATE TABLE instructor (
instructor_id int,
... |
How many lanes have 1:53.70 as the time? | CREATE TABLE table_name_62 (
lane VARCHAR,
time VARCHAR
) | SELECT COUNT(lane) FROM table_name_62 WHERE time = "1:53.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: How many lanes have 1:53.70 as the time? ### Input: CREATE TABLE table_name_62 (
lane VARCHAR,
time VARCHAR
) ### Re... |
how many flights has CO into and out of ATLANTA | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
... | SELECT COUNT(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.from_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA') OR (flight.to_... | 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 flights has CO into and out of ATLANTA ### Input: CREATE TABLE month (
month_number int,
month_name text
)
... |
please give me direct morning flights from PITTSBURGH to ATLANTA | CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | 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 = '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: please give me direct morning flights from PITTSBURGH to ATLANTA ### Input: CREATE TABLE restriction (
restriction_code ... |
What is the Retail name with a Digital/analog signal with analog, and a Chipset based on with radeon 9600? | CREATE TABLE table_name_15 (
retail_name VARCHAR,
digital_analog_signal VARCHAR,
chipset_based_on VARCHAR
) | SELECT retail_name FROM table_name_15 WHERE digital_analog_signal = "analog" AND chipset_based_on = "radeon 9600" | 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 Retail name with a Digital/analog signal with analog, and a Chipset based on with radeon 9600? ### Input: CREATE... |
How many rounds were 2r? | CREATE TABLE table_11326124_3 (
result VARCHAR,
round VARCHAR
) | SELECT COUNT(result) FROM table_11326124_3 WHERE round = "2R" | 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 rounds were 2r? ### Input: CREATE TABLE table_11326124_3 (
result VARCHAR,
round VARCHAR
) ### Response: SE... |
what was the name of the last intake that patient 15821 on the last intensive care unit visit had? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 15821) AND NOT icustays.outtime IS N... | 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 15821 on the last intensive care unit visit had? ### Input: CREATE TABLE m... |
Which class size is largest out of the least difficult Core courses ? | CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
catego... | SELECT DISTINCT department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%Core%')) AND num_enrolled = (... | 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 class size is largest out of the least difficult Core courses ? ### Input: CREATE TABLE ta (
campus_job_id int,
... |
is patient 012-18025 mch last measured on the last hospital visit greater than second to last measured on the last hospital visit. | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | 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 = '012-18025' 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: is patient 012-18025 mch last measured on the last hospital visit greater than second to last measured on the last hospital ... |
how many patients whose drug type is main and lab test name is ld, body fluid? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "LD, Body Fluid" | 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 drug type is main and lab test name is ld, body fluid? ### Input: CREATE TABLE prescriptions (
s... |
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, and rank Y-axis from low to high order please. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLO... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_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 who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of... |
does patient 23475 have a male or female gender? | 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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT patients.gender FROM patients WHERE patients.subject_id = 23475 | 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: does patient 23475 have a male or female gender? ### Input: CREATE TABLE prescriptions (
row_id number,
subject_id n... |
give me the number of inpatient hospital admission patients who had lab test item id 50907. | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.itemid = "50907" | 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 number of inpatient hospital admission patients who had lab test item id 50907. ### Input: CREATE TABLE prescrip... |
Does THTREMUS 370 require THTREMUS 250 as a prerequisite ? | 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_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'THTREMUS' AND COURSE_0.number = 250 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'THTREMUS' AND COURSE_1.number... | 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: Does THTREMUS 370 require THTREMUS 250 as a prerequisite ? ### Input: CREATE TABLE requirement (
requirement_id int,
... |
Name the film title that is spanish from peru | CREATE TABLE table_name_78 (
film_title_used_in_nomination VARCHAR,
language VARCHAR,
country VARCHAR
) | SELECT film_title_used_in_nomination FROM table_name_78 WHERE language = "spanish" AND country = "peru" | 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 film title that is spanish from peru ### Input: CREATE TABLE table_name_78 (
film_title_used_in_nomination VARC... |
Who was the home team at the game where the away team scored 10.13 (73) and there was a crowd over 24,119? | CREATE TABLE table_33156 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team" FROM table_33156 WHERE "Crowd" > '24,119' AND "Away team score" = '10.13 (73)' | 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 home team at the game where the away team scored 10.13 (73) and there was a crowd over 24,119? ### Input: CREATE... |
Return the description for the courses named 'database'. | CREATE TABLE courses (
course_id number,
author_id number,
subject_id number,
course_name text,
course_description text
)
CREATE TABLE student_course_enrolment (
registration_id number,
student_id number,
course_id number,
date_of_enrolment time,
date_of_completion time
)
CREAT... | SELECT course_description FROM courses WHERE course_name = "database" | 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 the description for the courses named 'database'. ### Input: CREATE TABLE courses (
course_id number,
author_... |
Which 2013 has a 2010 of 1r? | CREATE TABLE table_33908 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | SELECT "2013" FROM table_33908 WHERE "2010" = '1r' | 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 2013 has a 2010 of 1r? ### Input: CREATE TABLE table_33908 (
"Tournament" text,
"2002" text,
"2004" text,
... |
What is the 2009 value for the 2003 grand slam tournaments? | CREATE TABLE table_50264 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | SELECT "2009" FROM table_50264 WHERE "2003" = 'grand slam tournaments' | 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 2009 value for the 2003 grand slam tournaments? ### Input: CREATE TABLE table_50264 (
"Tournament" text,
... |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, could you show by the Y in descending? | 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 T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer 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, visualize a bar chart about the distribution of name an... |
For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute name by a bar chart. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.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: For those records from the products and each product's manufacturer, give me the comparison about code over the name , and g... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the phone_number by a bar chart, and list y axis in ascending order. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY | 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 do not work in departments with managers that have ids between 100 and 200, give me the comparison a... |
What is To Par, when Country is 'United States', when Place is 'T4', and when Player is 'Arnold Palmer'? | CREATE TABLE table_76890 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | SELECT "To par" FROM table_76890 WHERE "Country" = 'united states' AND "Place" = 't4' AND "Player" = 'arnold palmer' | 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 To Par, when Country is 'United States', when Place is 'T4', and when Player is 'Arnold Palmer'? ### Input: CREATE T... |
Who are the candidates in Florida 13 district? | CREATE TABLE table_19753079_12 (
candidates VARCHAR,
district VARCHAR
) | SELECT candidates FROM table_19753079_12 WHERE district = "Florida 13" | 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 are the candidates in Florida 13 district? ### Input: CREATE TABLE table_19753079_12 (
candidates VARCHAR,
distr... |
What was the time for tracks before 19 on 8/26/69? | CREATE TABLE table_name_75 (
time VARCHAR,
release_date VARCHAR,
track VARCHAR
) | SELECT time FROM table_name_75 WHERE release_date = "8/26/69" AND track < 19 | 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 time for tracks before 19 on 8/26/69? ### Input: CREATE TABLE table_name_75 (
time VARCHAR,
release_dat... |
What venue featured fitzroy as the home squad? | CREATE TABLE table_4663 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_4663 WHERE "Home team" = 'fitzroy' | 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 venue featured fitzroy as the home squad? ### Input: CREATE TABLE table_4663 (
"Home team" text,
"Home team sco... |
What is the attendance of the game on week 4? | CREATE TABLE table_name_10 (
attendance VARCHAR,
week VARCHAR
) | SELECT attendance FROM table_name_10 WHERE week = 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 attendance of the game on week 4? ### Input: CREATE TABLE table_name_10 (
attendance VARCHAR,
week VARCH... |
what is the patient name and admission location of pateint id 2560? | 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.name, demographic.admission_location FROM demographic WHERE demographic.subject_id = "2560" | 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 patient name and admission location of pateint id 2560? ### Input: CREATE TABLE demographic (
subject_id tex... |
How many laps for a grid of over 18 and retired due to electrical failure? | CREATE TABLE table_57793 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT SUM("Laps") FROM table_57793 WHERE "Grid" > '18' AND "Time/Retired" = 'electrical' | 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 laps for a grid of over 18 and retired due to electrical failure? ### Input: CREATE TABLE table_57793 (
"Driver... |
Return a histogram on how many exhibitions has each artist had?, list from high to low by the Name please. | CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int... | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name 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: Return a histogram on how many exhibitions has each artist had?, list from high to low by the Name please. ### Input: CREATE... |
For next semester , which classes are taught by Dr. Richard Horja ? | CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Richard Horja%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off... | 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 next semester , which classes are taught by Dr. Richard Horja ? ### Input: CREATE TABLE program_course (
program_id ... |
what was the last time that patient 16572 had promote w/fiber taken until 12/31/2101? | 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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT 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 = 16572)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | 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 last time that patient 16572 had promote w/fiber taken until 12/31/2101? ### Input: CREATE TABLE prescriptions ... |
how many patients had the drug code hepa10s and ascites as the lab test fluid? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "HEPA10S" AND lab.fluid = "Ascites" | 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 had the drug code hepa10s and ascites as the lab test fluid? ### Input: CREATE TABLE prescriptions (
s... |
how many newborn patients had the item id 50814? | 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.admission_type = "NEWBORN" AND lab.itemid = "50814" | 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 newborn patients had the item id 50814? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
... |
Find All_Home and School_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and could you show x axis in descending order? | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home 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 All_Home and School_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and could you show x axis ... |
Return a bar chart about the distribution of All_Games and All_Games_Percent , and order in asc by the X-axis. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games | 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 All_Games and All_Games_Percent , and order in asc by the X-axis. ### Input: CR... |
What is the highest Game, when Record is '21-30-11'? | CREATE TABLE table_8177 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | SELECT MAX("Game") FROM table_8177 WHERE "Record" = '21-30-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: What is the highest Game, when Record is '21-30-11'? ### Input: CREATE TABLE table_8177 (
"Game" real,
"February" re... |
Of the classes being offered this Spring-Summer , which ones are upper-level POLISH classes ? | CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'POLISH' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri... | 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: Of the classes being offered this Spring-Summer , which ones are upper-level POLISH classes ? ### Input: CREATE TABLE gsi (
... |
What year was incumbent phil crane first elected? | CREATE TABLE table_18306 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | SELECT "First elected" FROM table_18306 WHERE "Incumbent" = 'Phil Crane' | 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 year was incumbent phil crane first elected? ### Input: CREATE TABLE table_18306 (
"District" text,
"Incumbent"... |
how many patients whose religion is greek orthodox? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "GREEK ORTHODOX" | 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 religion is greek orthodox? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id tex... |
Which series were played on April 18? | CREATE TABLE table_25885 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | SELECT "Series" FROM table_25885 WHERE "Date" = 'April 18' | 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 series were played on April 18? ### Input: CREATE TABLE table_25885 (
"Game" real,
"Date" text,
"Team" tex... |
What year was the cormorant built in? | CREATE TABLE table_name_46 (
year_built VARCHAR,
name VARCHAR
) | SELECT year_built FROM table_name_46 WHERE name = "cormorant" | 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 year was the cormorant built in? ### Input: CREATE TABLE table_name_46 (
year_built VARCHAR,
name VARCHAR
) ###... |
What is the record of the game with Andrew Bogut (21) as the leading scorer? | CREATE TABLE table_name_43 (
record VARCHAR,
leading_scorer VARCHAR
) | SELECT record FROM table_name_43 WHERE leading_scorer = "andrew bogut (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: What is the record of the game with Andrew Bogut (21) as the leading scorer? ### Input: CREATE TABLE table_name_43 (
rec... |
Show all investor details, and count them by a bar chart, I want to rank from high to low by the how many investor details please. | CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),... | SELECT Investor_details, COUNT(Investor_details) FROM Investors GROUP BY Investor_details ORDER BY COUNT(Investor_details) 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 all investor details, and count them by a bar chart, I want to rank from high to low by the how many investor details p... |
Which courses must be completed to be able to take EARTH 323 ? | CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | 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... | 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 courses must be completed to be able to take EARTH 323 ? ### Input: CREATE TABLE program_course (
program_id int,
... |
Show the name and age for all male people who don't have a wedding with a bar chart, and list by the x axis in descending please. | CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year ... | SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Name 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 name and age for all male people who don't have a wedding with a bar chart, and list by the x axis in descending pl... |
For those records from the products and each product's manufacturer, show me about the distribution of name and code , and group by attribute headquarter in a bar chart. | 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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.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: For those records from the products and each product's manufacturer, show me about the distribution of name and code , and g... |
Who had the most points and how many did they have in game 11? | CREATE TABLE table_29870 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "High points" FROM table_29870 WHERE "Game" = '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 had the most points and how many did they have in game 11? ### Input: CREATE TABLE table_29870 (
"Game" real,
"D... |
What was the constructor when there were 95 laps and a grid less than 15? | CREATE TABLE table_name_85 (
constructor VARCHAR,
grid VARCHAR,
laps VARCHAR
) | SELECT constructor FROM table_name_85 WHERE grid < 15 AND laps = 95 | 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 constructor when there were 95 laps and a grid less than 15? ### Input: CREATE TABLE table_name_85 (
constr... |
When was the game that was held at the Princes Park? | CREATE TABLE table_32808 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_32808 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: When was the game that was held at the Princes Park? ### Input: CREATE TABLE table_32808 (
"Home team" text,
"Home t... |
Show the id of each employee and the number of document destruction authorised by that employee. Show scatter chart. | CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_... | SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destruction_Authorised_by_Employee_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: Show the id of each employee and the number of document destruction authorised by that employee. Show scatter chart. ### Inp... |
What is the 2012 value with 1r in 2011, 2007 of A, 2010 of 1r, and 2009 of A? | CREATE TABLE table_name_16 (
Id VARCHAR
) | SELECT 2012 FROM table_name_16 WHERE 2011 = "1r" AND 2007 = "a" AND 2010 = "1r" AND 2009 = "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 is the 2012 value with 1r in 2011, 2007 of A, 2010 of 1r, and 2009 of A? ### Input: CREATE TABLE table_name_16 (
Id... |
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the change of employee_id over hire_date, and could you order x-axis in descending order? | 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 varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) 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 those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the c... |
What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time? | CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
) | SELECT T1.name, T1.age, T1.job FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(year) FROM personfriend WHERE friend = 'Alice') | 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 names, ages, and jobs of all people who are friends with Alice for the longest amount of time? ### Input: CREAT... |
What is the total number of Points 1, when Position is '7', and when Drawn is greater than 6? | CREATE TABLE table_name_62 (
points_1 VARCHAR,
position VARCHAR,
drawn VARCHAR
) | SELECT COUNT(points_1) FROM table_name_62 WHERE position = 7 AND drawn > 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: What is the total number of Points 1, when Position is '7', and when Drawn is greater than 6? ### Input: CREATE TABLE table_... |
what was the last diagnosis for patient 005-46456 in the last year. | 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 microlab (
microl... | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND DATETIME(diagnosis.diagnosistime, 'start of year... | 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 last diagnosis for patient 005-46456 in the last year. ### Input: CREATE TABLE vitalperiodic (
vitalperiodi... |
Which of the upper level classes get you 17 credits ? | CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE semester (
semester_id int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 17 AND program_course.category LIKE 'ULCS' | 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 of the upper level classes get you 17 credits ? ### Input: CREATE TABLE instructor (
instructor_id int,
name v... |
Which tournament was played on clay and there was a score of 4 6, 6 1, 6 4? | CREATE TABLE table_33655 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | SELECT "Tournament" FROM table_33655 WHERE "Surface" = 'clay' AND "Score" = '4–6, 6–1, 6–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: Which tournament was played on clay and there was a score of 4 6, 6 1, 6 4? ### Input: CREATE TABLE table_33655 (
"Date"... |
count the number of patients whose age is less than 20 and diagnoses icd9 code is 42731? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "20" AND diagnoses.icd9_code = "42731" | 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 20 and diagnoses icd9 code is 42731? ### Input: CREATE TABLE diagnoses (... |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and order by the y-axis from high to low. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) 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, visualize a bar chart about the distribution of hire_date... |
since 04/26/2105, what was first arterial bp [systolic] for patient 31854? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id... | 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 = 31854)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | 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: since 04/26/2105, what was first arterial bp [systolic] for patient 31854? ### Input: CREATE TABLE d_icd_diagnoses (
row... |
Find the name and checking balance of the account with the lowest savings balance. | CREATE TABLE accounts (
name VARCHAR,
custid VARCHAR
)
CREATE TABLE checking (
balance VARCHAR,
custid VARCHAR
)
CREATE TABLE savings (
custid VARCHAR,
balance VARCHAR
) | SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance 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: Find the name and checking balance of the account with the lowest savings balance. ### Input: CREATE TABLE accounts (
na... |
list the shortest flight from SAN JOSE to HOUSTON | CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop_n... | 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 JOSE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUS... | 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: list the shortest flight from SAN JOSE to HOUSTON ### Input: CREATE TABLE time_zone (
time_zone_code text,
time_zone... |
Which tyres has more than 5 laps with team nissan motorsports international? | CREATE TABLE table_name_89 (
tyres VARCHAR,
laps VARCHAR,
team VARCHAR
) | SELECT tyres FROM table_name_89 WHERE laps > 5 AND team = "nissan motorsports international" | 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 tyres has more than 5 laps with team nissan motorsports international? ### Input: CREATE TABLE table_name_89 (
tyr... |
Who was the opposing team at the match played at the Arden Street Oval? | CREATE TABLE table_name_64 (
away_team VARCHAR,
venue VARCHAR
) | SELECT away_team FROM table_name_64 WHERE venue = "arden street oval" | 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 opposing team at the match played at the Arden Street Oval? ### Input: CREATE TABLE table_name_64 (
away_tea... |
what is the apparent magnitude of NGC number 6027d? | CREATE TABLE table_name_14 (
apparent_magnitude VARCHAR,
ngc_number VARCHAR
) | SELECT apparent_magnitude FROM table_name_14 WHERE ngc_number = "6027d" | 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 apparent magnitude of NGC number 6027d? ### Input: CREATE TABLE table_name_14 (
apparent_magnitude VARCHAR,
... |
what is the number of patients whose year of death is less than or equal to 2131 and lab test name is neutrophils? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2131.0" 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: what is the number of patients whose year of death is less than or equal to 2131 and lab test name is neutrophils? ### Input... |
For those employees who did not have any job in the past, visualize the relationship between employee_id and department_id . | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLO... | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | 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 did not have any job in the past, visualize the relationship between employee_id and department_id .... |
For the attribute ACC_Road and the sum of Team_ID, show their proportion by a pie chart. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road | 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 the attribute ACC_Road and the sum of Team_ID, show their proportion by a pie chart. ### Input: CREATE TABLE basketball_... |
how many patients born before year 2087 had the lab test fluid pleural? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Pleural" | 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 year 2087 had the lab test fluid pleural? ### Input: CREATE TABLE diagnoses (
subject_id t... |
what is the sum of attendance of week 11 | CREATE TABLE table_4995 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT SUM("Attendance") FROM table_4995 WHERE "Week" = '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: what is the sum of attendance of week 11 ### Input: CREATE TABLE table_4995 (
"Week" real,
"Date" text,
"Opponen... |
compare to yesterday what was new in the prescription of patient 009-7776 today? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '009-7776') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicat... | 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: compare to yesterday what was new in the prescription of patient 009-7776 today? ### Input: CREATE TABLE microlab (
micr... |
what is the average days of hospital stay of patients whose admission location is emergency room admit? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" | 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 days of hospital stay of patients whose admission location is emergency room admit? ### Input: CREATE TA... |
Who is the home team when the crowd is over 32,485? | CREATE TABLE table_56065 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team" FROM table_56065 WHERE "Crowd" > '32,485' | 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 is the home team when the crowd is over 32,485? ### Input: CREATE TABLE table_56065 (
"Home team" text,
"Home te... |
was sao2 of patient 035-15069 ever less than 95.0? | 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 diagnosis (
diagn... | 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 = '035-15069')) AND vitalperiodic.sao2 < 95.0 AND NOT vitalperiodic.sao... | 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: was sao2 of patient 035-15069 ever less than 95.0? ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid number,
p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.