instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Find the number of rooms with more than 50 capacity for each building Show bar chart, and could you sort by the the total number in desc? | CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min... | SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY COUNT(*) 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 the number of rooms with more than 50 capacity for each building Show bar chart, and could you sort by the the total nu... |
in 11/last year, had patient 007-10135 had any allergies? | 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 COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURRE... | 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 11/last year, had patient 007-10135 had any allergies? ### Input: CREATE TABLE microlab (
microlabid number,
pati... |
Which side has Orcagna as the inscription? | CREATE TABLE table_name_89 (
side VARCHAR,
inscription VARCHAR
) | SELECT side FROM table_name_89 WHERE inscription = "orcagna" | 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 side has Orcagna as the inscription? ### Input: CREATE TABLE table_name_89 (
side VARCHAR,
inscription VARCHAR... |
until 2 years ago, how many patients have received the rad pancreaticoduodenect within 2 months after being diagnosed with cardiac arrest? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate ti... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cardiac arrest') 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: until 2 years ago, how many patients have received the rad pancreaticoduodenect within 2 months after being diagnosed with c... |
for the first time, what procedure did since 2 years ago patient 23858 receive? | 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 d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23858) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TI... | 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 first time, what procedure did since 2 years ago patient 23858 receive? ### Input: CREATE TABLE prescriptions (
... |
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday. | 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | SELECT HIRE_DATE, AVG(SALARY) 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 a bar chart about the distribution of hire_date and the ... |
when patient 004-13672 was receiving a lab test for the last time? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | SELECT 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 = '004-13672')) ORDER BY lab.labresulttime 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: when patient 004-13672 was receiving a lab test for the last time? ### Input: CREATE TABLE diagnosis (
diagnosisid numbe... |
how many patients are discharged to disc-tran cancer/chldrn h and lab tested for basophils? | 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.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND lab.label = "Basophils" | 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 are discharged to disc-tran cancer/chldrn h and lab tested for basophils? ### Input: CREATE TABLE diagnose... |
How many patients with primary disease of brain mass intracranial hemorrhage died in or before 2131? | 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 WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.dod_year <= "2131.0" | 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 with primary disease of brain mass intracranial hemorrhage died in or before 2131? ### Input: CREATE TABLE... |
A scatter chart shows the correlation between School_ID and All_Games_Percent . | 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 School_ID, All_Games_Percent FROM basketball_match | 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: A scatter chart shows the correlation between School_ID and All_Games_Percent . ### Input: CREATE TABLE university (
Sch... |
what was the daily maximum amount of foley given to patient 72198 on the first intensive care unit visit? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 (
row_id numb... | SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72198) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid... | 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 daily maximum amount of foley given to patient 72198 on the first intensive care unit visit? ### Input: CREATE ... |
What was the highest year that Europe/Africa Zone Group I Group B lost? | CREATE TABLE table_10889 (
"Year" real,
"Competition" text,
"Date" text,
"Surface" text,
"Location" text,
"Score" text,
"Result" text
) | SELECT MAX("Year") FROM table_10889 WHERE "Competition" = 'europe/africa zone group i group b' AND "Result" = 'lost' | 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 highest year that Europe/Africa Zone Group I Group B lost? ### Input: CREATE TABLE table_10889 (
"Year" rea... |
how many patients have been discharged from hospital since 2103. | 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(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) >= '2103' | 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 have been discharged from hospital since 2103. ### Input: CREATE TABLE prescriptions (
row_id number,
... |
Find the the date of enrollment of the 'Spanish' course, and count them by a bar chart, and sort by the Y from low to high. | CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
fam... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" ORDER BY COUNT(date_of_enrolment) | 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 the date of enrollment of the 'Spanish' course, and count them by a bar chart, and sort by the Y from low to high. ... |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of phone_number and employee_id in a bar chart, and order by the Y in ascending please. | 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 PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER 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: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distri... |
The course listings have included POLISH 621 for how long ? | CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'POLISH' AND course.number = 621 AND semester.semester_id = course_offering.semester ORDER BY semester.year 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: The course listings have included POLISH 621 for how long ? ### Input: CREATE TABLE program_course (
program_id int,
... |
when was patient 005-62766 discharged for the last time from the hospital in 2104? | 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 patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '005-62766' AND STRFTIME('%y', patient.hospitaldischargetime) = '2104' ORDER BY patient.hospitaldischargetime 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: when was patient 005-62766 discharged for the last time from the hospital in 2104? ### Input: CREATE TABLE medication (
... |
Draw a pie chart about the proportion of Team_Name and ACC_Percent. | 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 Team_Name, ACC_Percent FROM basketball_match | 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: Draw a pie chart about the proportion of Team_Name and ACC_Percent. ### Input: CREATE TABLE university (
School_ID int,
... |
who directed the episode that 6.3 million u.s. viewers saw? | CREATE TABLE table_74202 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" text,
"U.S. viewers (millions)" text
) | SELECT "Directed by" FROM table_74202 WHERE "U.S. viewers (millions)" = '6.3' | 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 directed the episode that 6.3 million u.s. viewers saw? ### Input: CREATE TABLE table_74202 (
"No. in series" text,
... |
give the number of patients whose insurance is private and procedure icd9 code is 4105. | 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.insurance = "Private" AND procedures.icd9_code = "4105" | 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 the number of patients whose insurance is private and procedure icd9 code is 4105. ### Input: CREATE TABLE prescription... |
Bar chart x axis other account details y axis how many other account details | CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
pro... | SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details | 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: Bar chart x axis other account details y axis how many other account details ### Input: CREATE TABLE Orders (
order_id I... |
How many weeks have an Attendance of 62,289? | CREATE TABLE table_65734 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT SUM("Week") FROM table_65734 WHERE "Attendance" = '62,289' | 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 weeks have an Attendance of 62,289? ### Input: CREATE TABLE table_65734 (
"Week" real,
"Date" text,
"Op... |
what is the number of patients whose age is less than 81 and diagnoses icd9 code is 28522? | 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.age < "81" AND diagnoses.icd9_code = "28522" | 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 age is less than 81 and diagnoses icd9 code is 28522? ### Input: CREATE TABLE demograph... |
has d5/.45ns been given on this month/28 to patient 5828? | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_ty... | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5/.45ns'... | 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: has d5/.45ns been given on this month/28 to patient 5828? ### Input: CREATE TABLE chartevents (
row_id number,
subje... |
list the flights arriving in ATLANTA from BOSTON between 1600 and 2000 | CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
C... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.arrival_time <= 2000 AND flight.arrival_time >= 1600) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND 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: list the flights arriving in ATLANTA from BOSTON between 1600 and 2000 ### Input: CREATE TABLE time_zone (
time_zone_cod... |
Bar chart x axis country y axis the total number, list total number from high to low order. | CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
)
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
) | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) 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: Bar chart x axis country y axis the total number, list total number from high to low order. ### Input: CREATE TABLE people (... |
give me the number of patients whose admission type is urgent and admission year is less than 2190? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2190" | 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 patients whose admission type is urgent and admission year is less than 2190? ### Input: CREATE TABLE ... |
What is Margin, when Match Date is Oct 17, 2007? | CREATE TABLE table_name_86 (
margin VARCHAR,
match_date VARCHAR
) | SELECT margin FROM table_name_86 WHERE match_date = "oct 17, 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: What is Margin, when Match Date is Oct 17, 2007? ### Input: CREATE TABLE table_name_86 (
margin VARCHAR,
match_date ... |
What is the official name of the land with an area of 276.84 km2? | CREATE TABLE table_21282 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | SELECT "Official Name" FROM table_21282 WHERE "Area km 2" = '276.84' | 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 official name of the land with an area of 276.84 km2? ### Input: CREATE TABLE table_21282 (
"Official Name" ... |
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 average of salary , and group by attribute job_id, sort Y-axis from low to high 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, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
What year was incumbent phil crane first elected? | CREATE TABLE table_1341640_14 (
first_elected VARCHAR,
incumbent VARCHAR
) | SELECT first_elected FROM table_1341640_14 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_1341640_14 (
first_elected VARCHAR,
... |
what was the name of the outputs that patient 51177 last had since 08/01/2101? | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177)) AND STRFTIME('%y-%m-%d', outputeve... | 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 outputs that patient 51177 last had since 08/01/2101? ### Input: CREATE TABLE inputevents_cv (
... |
On which week was the attendance 74303? | CREATE TABLE table_19718 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | SELECT MAX("Week") FROM table_19718 WHERE "Attendance" = '74303' | 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: On which week was the attendance 74303? ### Input: CREATE TABLE table_19718 (
"Week" real,
"Date" text,
"Opponen... |
Show all allergy types and the number of allergies in each type in a bar chart, display names in ascending order. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType | 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 allergy types and the number of allergies in each type in a bar chart, display names in ascending order. ### Input:... |
tell me the number of inpatient hospital admission patients who have hyperglycemia; hyponatremia primary disease. | 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 WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" | 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: tell me the number of inpatient hospital admission patients who have hyperglycemia; hyponatremia primary disease. ### Input:... |
how many teams won by a margin of two or more points ? | CREATE TABLE table_204_487 (
id number,
"home team" text,
"score" text,
"visiting team" text,
"location" text,
"venue" text,
"door" text,
"surface" text
) | SELECT COUNT(*) FROM table_204_487 WHERE ABS("score" - "score") >= 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: how many teams won by a margin of two or more points ? ### Input: CREATE TABLE table_204_487 (
id number,
"home team... |
what is the number of patients whose diagnoses long title is acute glomerulonephritis with other specified pathological lesion in kidney and drug route is iv drip? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Acute glomerulonephritis with other specified pathological lesion in kidney" AND prescripti... | 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 diagnoses long title is acute glomerulonephritis with other specified pathological lesi... |
how many patients whose days of hospital stay is greater than 3 and lab test fluid is pleural? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" 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 whose days of hospital stay is greater than 3 and lab test fluid is pleural? ### Input: CREATE TABLE presc... |
on the first intensive care unit visit the sao2 of patient 022-151182 was ever greater than 97.0? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | 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 = '022-151182') AND NOT patient.unitdischargetime IS NULL ORDER BY pati... | 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: on the first intensive care unit visit the sao2 of patient 022-151182 was ever greater than 97.0? ### Input: CREATE TABLE di... |
Which home team scored 9.15 (69)? | CREATE TABLE table_56235 (
"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_56235 WHERE "Home team score" = '9.15 (69)' | 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 home team scored 9.15 (69)? ### Input: CREATE TABLE table_56235 (
"Home team" text,
"Home team score" text,
... |
laboratory findings of fasting triglycerides greater than or equal to 200 mg / dl | CREATE TABLE table_train_79 (
"id" int,
"fasting_triglycerides" int,
"fasting_total_cholesterol" int,
"fasting_glucose" int,
"age" float,
"NOUSE" float
) | SELECT * FROM table_train_79 WHERE fasting_triglycerides >= 200 | 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: laboratory findings of fasting triglycerides greater than or equal to 200 mg / dl ### Input: CREATE TABLE table_train_79 (
... |
How many documents for each document type description? Visualize by a pie chart. | CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHA... | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description | 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 documents for each document type description? Visualize by a pie chart. ### Input: CREATE TABLE Statements (
St... |
have patient 5520 been to the emergency room in the last year? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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,
... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 5520 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 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: have patient 5520 been to the emergency room in the last year? ### Input: CREATE TABLE patients (
row_id number,
sub... |
What is the CFL Team with #48 as the pick number? | CREATE TABLE table_39809 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | SELECT "CFL Team" FROM table_39809 WHERE "Pick #" = '48' | 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 CFL Team with #48 as the pick number? ### Input: CREATE TABLE table_39809 (
"Pick #" real,
"CFL Team" te... |
which medication is patient paul edwards taking? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Paul Edwards" | 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 medication is patient paul edwards taking? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
... |
what are the top three most frequently prescribed drugs for patients aged 30s this year? | 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_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start 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: what are the top three most frequently prescribed drugs for patients aged 30s this year? ### Input: CREATE TABLE icustays (
... |
what ground transportation can i take into BOSTON | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number ... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BOSTON' AND ground_service.city_code = city.city_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 ground transportation can i take into BOSTON ### Input: CREATE TABLE flight_fare (
flight_id int,
fare_id int
)... |
A line chart shows how many churches open each year?, and list x axis from high to low order. | CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
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 ... | SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date ORDER BY Open_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: A line chart shows how many churches open each year?, and list x axis from high to low order. ### Input: CREATE TABLE weddin... |
how many patients whose year of birth is less than 2058? | 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 WHERE demographic.dob_year < "2058" | 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 year of birth is less than 2058? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_i... |
let me know the short title of procedure and diagnoses icd9 code of patient with patient id 31066. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT diagnoses.icd9_code, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "31066" | 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 short title of procedure and diagnoses icd9 code of patient with patient id 31066. ### Input: CREATE TABLE d... |
Return a bar chart on how many engineers did each staff contact? List both the contact staff name and number of engineers contacted, and could you order by the Y in asc please? | CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_descriptio... | SELECT staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY COUNT(*) | 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 on how many engineers did each staff contact? List both the contact staff name and number of engineers co... |
how many archive were when run time is 24:34 | CREATE TABLE table_2112766_1 (
archive VARCHAR,
run_time VARCHAR
) | SELECT archive FROM table_2112766_1 WHERE run_time = "24:34" | 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 archive were when run time is 24:34 ### Input: CREATE TABLE table_2112766_1 (
archive VARCHAR,
run_time VAR... |
Show all the planned delivery dates and bin by weekday in a bar chart. | CREATE TABLE Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Clients (
Client_ID INTEGER,
Address_ID INTEGER,
Customer_Email_Address VARCHAR(255),
Cu... | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings | 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 planned delivery dates and bin by weekday in a bar chart. ### Input: CREATE TABLE Ref_Payment_Methods (
pay... |
what is the number of elective hospital admission patients who had small-to-small intestinal anastomosis? | 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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Small-to-small intestinal anastomosis" | 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 elective hospital admission patients who had small-to-small intestinal anastomosis? ### Input: CREATE ... |
What is the average Week, when Opponent is Minnesota Vikings? | CREATE TABLE table_name_16 (
week INTEGER,
opponent VARCHAR
) | SELECT AVG(week) FROM table_name_16 WHERE opponent = "minnesota vikings" | 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 Week, when Opponent is Minnesota Vikings? ### Input: CREATE TABLE table_name_16 (
week INTEGER,
... |
get me the top four diagnoses that have the highest five year mortality rate? | 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_icd_procedures (
row_id number,
icd9_code text,
s... | 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: get me the top four diagnoses that have the highest five year mortality rate? ### Input: CREATE TABLE icustays (
row_id ... |
what is the club that as 100 tries? | CREATE TABLE table_15309 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | SELECT "Club" FROM table_15309 WHERE "Tries for" = '100' | 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 club that as 100 tries? ### Input: CREATE TABLE table_15309 (
"Club" text,
"Played" text,
"Drawn" te... |
How many entries are there for weight when the winner is 1st - defier and venue is randwick? | CREATE TABLE table_18864 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Time" text,
"Jockey" text,
"Winner/2nd" text
) | SELECT COUNT("Weight (kg)") FROM table_18864 WHERE "Winner/2nd" = '1st - Defier' AND "Venue" = 'Randwick' | 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 entries are there for weight when the winner is 1st - defier and venue is randwick? ### Input: CREATE TABLE table_1... |
show me all flights from SAN FRANCISCO to PITTSBURGH | CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varcha... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | 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 all flights from SAN FRANCISCO to PITTSBURGH ### Input: CREATE TABLE days (
days_code varchar,
day_name varc... |
how many male patients had emergency room admission? | 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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND 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: how many male patients had emergency room admission? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id t... |
On May 26, what was the team's record? | CREATE TABLE table_name_92 (
record VARCHAR,
date VARCHAR
) | SELECT record FROM table_name_92 WHERE date = "may 26" | 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: On May 26, what was the team's record? ### Input: CREATE TABLE table_name_92 (
record VARCHAR,
date VARCHAR
) ### Re... |
count the number of patients whose death status is 1 and diagnoses long title is subarachnoid hemorrhage? | 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.expire_flag = "1" AND diagnoses.long_title = "Subarachnoid hemorrhage" | 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 death status is 1 and diagnoses long title is subarachnoid hemorrhage? ### Input: CREATE ... |
Which driver was in 8 rounds with a chassis of dallara f306? | CREATE TABLE table_name_57 (
driver VARCHAR,
chassis VARCHAR,
rounds VARCHAR
) | SELECT driver FROM table_name_57 WHERE chassis = "dallara f306" AND rounds = "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: Which driver was in 8 rounds with a chassis of dallara f306? ### Input: CREATE TABLE table_name_57 (
driver VARCHAR,
... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of salary over the hire_date bin hire_date by time by a bar chart, and list by the mean salary from high to low please. | 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, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) 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 those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a... |
Which Region has an Area of 9,451km ? | CREATE TABLE table_55115 (
"Region" text,
"Capital" text,
"Area (km\u00b2)" text,
"Area (sq. mi.)" text,
"Population" text,
"GDP ( bn )" text
) | SELECT "Region" FROM table_55115 WHERE "Area (km\u00b2)" = '9,451' | 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 Region has an Area of 9,451km ? ### Input: CREATE TABLE table_55115 (
"Region" text,
"Capital" text,
"Area... |
how many patients whose death status is 1 and drug code is clin300l? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "CLIN300L" | 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 death status is 1 and drug code is clin300l? ### Input: CREATE TABLE prescriptions (
subject_id ... |
Show me about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200 in a bar chart, could you list y-axis from high to low order? | CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year 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,
... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(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: Show me about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200 in a bar chart, coul... |
Which Player has a To par of 2, and a Country of wales? | CREATE TABLE table_name_7 (
player VARCHAR,
to_par VARCHAR,
country VARCHAR
) | SELECT player FROM table_name_7 WHERE to_par = "–2" AND country = "wales" | 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 Player has a To par of 2, and a Country of wales? ### Input: CREATE TABLE table_name_7 (
player VARCHAR,
to_pa... |
What is the total number of losses Jackson, T., who had more than 27 gain, an avg/g smaller than 55.9, and a long less than 34, had? | CREATE TABLE table_name_41 (
loss VARCHAR,
long VARCHAR,
name VARCHAR,
gain VARCHAR,
avg_g VARCHAR
) | SELECT COUNT(loss) FROM table_name_41 WHERE gain > 27 AND avg_g < 55.9 AND name = "jackson, t." AND long < 34 | 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 losses Jackson, T., who had more than 27 gain, an avg/g smaller than 55.9, and a long less than ... |
what are all the result for New York 6 district | CREATE TABLE table_1341395_33 (
result VARCHAR,
district VARCHAR
) | SELECT result FROM table_1341395_33 WHERE district = "New York 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 are all the result for New York 6 district ### Input: CREATE TABLE table_1341395_33 (
result VARCHAR,
district ... |
What is the team 2 for team 1 of Valletta? | CREATE TABLE table_55526 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | SELECT "Team 2" FROM table_55526 WHERE "Team 1" = 'valletta' | 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 team 2 for team 1 of Valletta? ### Input: CREATE TABLE table_55526 (
"Team 1" text,
"Agg." text,
"Te... |
what are the five most common events since 2103? | 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.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) >= '2103' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5 | 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 five most common events since 2103? ### Input: CREATE TABLE patient (
uniquepid text,
patienthealthsyst... |
The trend about the the number of season of different Home_team over the season, and rank from high to low by the Season. | CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | SELECT Season, COUNT(Season) FROM game GROUP BY Home_team ORDER BY Season 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: The trend about the the number of season of different Home_team over the season, and rank from high to low by the Season. ##... |
Find the number of patients diagnosed with congestive heart failure, unspecified and the drug route of iv drip. | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Congestive heart failure, unspecified" AND prescriptions.route = "IV DRIP" | 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 number of patients diagnosed with congestive heart failure, unspecified and the drug route of iv drip. ### Input: C... |
What are all the upper-level electives being offered in the Spring and Summer ? | CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_l... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '... | 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 all the upper-level electives being offered in the Spring and Summer ? ### Input: CREATE TABLE instructor (
ins... |
Which general election had a vote swing of 1.69? | CREATE TABLE table_19700 (
"Year" text,
"General Election" text,
"Seats Won" real,
"Change in Seat" real,
"% of votes" text,
"votes swing" text
) | SELECT "General Election" FROM table_19700 WHERE "votes swing" = '1.69' | 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 general election had a vote swing of 1.69? ### Input: CREATE TABLE table_19700 (
"Year" text,
"General Electio... |
flights from OAK to SFO on 1 21 1992 | CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE date_day (
... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((AIRPORT_1.airport_code = 'SFO' AND date_day.day_number = 21 AND date_day.month_number = 1 AND 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: flights from OAK to SFO on 1 21 1992 ### Input: CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_... |
provide the number of patients whose drug name is methadone? | 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 WHERE prescriptions.drug = "Methadone" | 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 drug name is methadone? ### Input: CREATE TABLE prescriptions (
subject_id text,
... |
what is the cheapest flight from LONG BEACH to MEMPHIS | CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT... | 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 cheapest flight from LONG BEACH to MEMPHIS ### Input: CREATE TABLE airline (
airline_code varchar,
airli... |
has patient 027-95744 been diagnosed with anything since 2105. | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-95744')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' | 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: has patient 027-95744 been diagnosed with anything since 2105. ### Input: CREATE TABLE diagnosis (
diagnosisid number,
... |
Draw a bar chart for what are the hometowns of gymnasts and the corresponding number of gymnasts?, and rank by the Y from low to high. | CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height real,
Hometown text
)
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real... | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) | 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: Draw a bar chart for what are the hometowns of gymnasts and the corresponding number of gymnasts?, and rank by the Y from lo... |
For those female students with age is older than 18 who are not majoring in 600, tell me how many students of different first names using a bar chart. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Visits_Restaurant (
StuID INTEGER,
ResID INTEGER,
Time TIMESTAMP,
Spent FLOAT
)
CREATE TABLE Rest... | SELECT Fname, COUNT(Fname) FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F' GROUP BY Fname | 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 female students with age is older than 18 who are not majoring in 600, tell me how many students of different firs... |
In what venue was the hosted away team Essendon? | CREATE TABLE table_78510 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_78510 WHERE "Away team" = 'essendon' | 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 what venue was the hosted away team Essendon? ### Input: CREATE TABLE table_78510 (
"Home team" text,
"Home team ... |
What is the value for 2011 when `a` is the value for 2009, and 4r is the value for 2013? | CREATE TABLE table_14618 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | SELECT "2011" FROM table_14618 WHERE "2009" = 'a' AND "2013" = '4r' | 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 value for 2011 when `a` is the value for 2009, and 4r is the value for 2013? ### Input: CREATE TABLE table_14618... |
What is the total number of Round, when College/Junior/Club Team (League) is 'Kelowna Rockets ( WHL )'? | CREATE TABLE table_name_83 (
round VARCHAR,
college_junior_club_team__league_ VARCHAR
) | SELECT COUNT(round) FROM table_name_83 WHERE college_junior_club_team__league_ = "kelowna rockets ( whl )" | 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 Round, when College/Junior/Club Team (League) is 'Kelowna Rockets ( WHL )'? ### Input: CREATE TA... |
what was the name of the last specimen test which patient 17398 has received during the last hospital visit? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CR... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime 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 was the name of the last specimen test which patient 17398 has received during the last hospital visit? ### Input: CREA... |
Visualize a bar chart about the distribution of name and ID , I want to order by the Y-axis in asc. | 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 name, ID FROM swimmer ORDER BY 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: Visualize a bar chart about the distribution of name and ID , I want to order by the Y-axis in asc. ### Input: CREATE TABLE ... |
How many different instruments are used in the song 'Le Pop'? | CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE instru... | SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop" | 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 different instruments are used in the song 'Le Pop'? ### Input: CREATE TABLE tracklists (
albumid number,
p... |
What are the names of all directors who have made one movie except for the director named NULL? | CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
) | SELECT director FROM movie WHERE director <> "null" GROUP BY director HAVING COUNT(*) = 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 are the names of all directors who have made one movie except for the director named NULL? ### Input: CREATE TABLE movi... |
Show a bar chart to show different names and credit scores of customers who have taken a loan, and I want to list X in ascending order. | CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_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: Show a bar chart to show different names and credit scores of customers who have taken a loan, and I want to list X in ascen... |
Which season was 2nd position? | CREATE TABLE table_name_84 (
season VARCHAR,
position VARCHAR
) | SELECT season FROM table_name_84 WHERE position = "2nd" | 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 season was 2nd position? ### Input: CREATE TABLE table_name_84 (
season VARCHAR,
position VARCHAR
) ### Respon... |
what was first place 's difference to par ? | CREATE TABLE table_204_126 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | SELECT "to par" FROM table_204_126 WHERE "place" = 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 first place 's difference to par ? ### Input: CREATE TABLE table_204_126 (
id number,
"place" text,
"pl... |
Who is the teacher that gave a student a C while minoring in RELIGION ? | CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec... | 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 teacher that gave a student a C while minoring in RELIGION ? ### Input: CREATE TABLE course_tags_count (
cour... |
Which Competition has the Date July 1, 2000? | CREATE TABLE table_name_17 (
competition VARCHAR,
date VARCHAR
) | SELECT competition FROM table_name_17 WHERE date = "july 1, 2000" | 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 Competition has the Date July 1, 2000? ### Input: CREATE TABLE table_name_17 (
competition VARCHAR,
date VARCH... |
What is the home of aggregate's 3-4? | CREATE TABLE table_name_87 (
home__2nd_leg_ VARCHAR,
aggregate VARCHAR
) | SELECT home__2nd_leg_ FROM table_name_87 WHERE aggregate = "3-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 home of aggregate's 3-4? ### Input: CREATE TABLE table_name_87 (
home__2nd_leg_ VARCHAR,
aggregate VARCH... |
Bar chart x axis acc road y axis the average of school id | 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, AVG(School_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: Bar chart x axis acc road y axis the average of school id ### Input: CREATE TABLE basketball_match (
Team_ID int,
Sc... |
where was the last competition held ? | CREATE TABLE table_203_504 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | SELECT "venue" FROM table_203_504 ORDER BY "date" 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: where was the last competition held ? ### Input: CREATE TABLE table_203_504 (
id number,
"#" number,
"date" text... |
find the duration of hospital stay and discharge time of subject id 16438. | 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 demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.subject_id = "16438" | 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 duration of hospital stay and discharge time of subject id 16438. ### Input: CREATE TABLE prescriptions (
subje... |
What is the result when the attendance is 54,814? | CREATE TABLE table_name_7 (
result VARCHAR,
attendance VARCHAR
) | SELECT result FROM table_name_7 WHERE attendance = "54,814" | 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 when the attendance is 54,814? ### Input: CREATE TABLE table_name_7 (
result VARCHAR,
attendance ... |
what was the name of the prescription drug that patient 021-25705 was prescribed the first time using the ng route in the previous month? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND medication.routeadmin = 'ng' AND DATETIME(medicati... | 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 prescription drug that patient 021-25705 was prescribed the first time using the ng route in the pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.