instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
What is Ivan Ciernik's average points with less than 11 goals? | CREATE TABLE table_48216 (
"Player" text,
"Club" text,
"Games" real,
"Goals" real,
"Assists" real,
"Points" real
) | SELECT AVG("Points") FROM table_48216 WHERE "Player" = 'ivan ciernik' AND "Goals" < '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 Ivan Ciernik's average points with less than 11 goals? ### Input: CREATE TABLE table_48216 (
"Player" text,
... |
What are the names and account balances of customers with the letter a in their names, and I want to display in descending by the acc_bal. | 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 varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal 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: What are the names and account balances of customers with the letter a in their names, and I want to display in descending b... |
What entrant had a Maserati 250F chassis and fewer than 6 points before 1957? | CREATE TABLE table_67242 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | SELECT "Entrant" FROM table_67242 WHERE "Chassis" = 'maserati 250f' AND "Year" < '1957' AND "Points" < '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 entrant had a Maserati 250F chassis and fewer than 6 points before 1957? ### Input: CREATE TABLE table_67242 (
"Yea... |
Is next Winter 's 527 class taught by Prof. James Desimpelare ? | CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 527 AND instructor.name LIKE '%James Desimpelare%' AND offering_instructor.instructor_id = instructor.instructor_id AND offeri... | Below are sql tables 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 next Winter 's 527 class taught by Prof. James Desimpelare ? ### Input: CREATE TABLE area (
course_id int,
area v... |
For HISTART 481 , what prerequisites have I fulfilled ? | CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname var... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'HISTART' 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: For HISTART 481 , what prerequisites have I fulfilled ? ### Input: CREATE TABLE ta (
campus_job_id int,
student_id i... |
Which is the easiest class to get my Core requirement fulfilled ? | CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | Below are sql tables 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 is the easiest class to get my Core requirement fulfilled ? ### Input: CREATE TABLE program_requirement (
program_... |
list nonstop flights from SFO to OAK that depart in the afternoon | CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
... | 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, flight WHERE ((((AIRPORT_0.airport_code = 'SFO' AND AIRPORT_1.airport_code = 'OAK' AND flight.from_airport = AIRPORT_0.airport_cod... | Below are sql tables 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 nonstop flights from SFO to OAK that depart in the afternoon ### Input: CREATE TABLE airport (
airport_code varchar... |
List the name of enzymes in descending lexicographical order. | CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE medicine (
id number,
name text,
trade_name text,
fda_approved text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosom... | SELECT name FROM enzyme 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: List the name of enzymes in descending lexicographical order. ### Input: CREATE TABLE medicine_enzyme_interaction (
enzy... |
what was the first value of an mch lab test in patient 17953? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
ro... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17953) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') ORDER BY labevents.charttime LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the first value of an mch lab test in patient 17953? ### Input: CREATE TABLE d_icd_diagnoses (
row_id number,
... |
have blood pressure > 100 mmhg systolic or > 70 mmhg diastolic | CREATE TABLE table_train_154 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fpg" float,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"NOUSE" float
) | SELECT * FROM table_train_154 WHERE systolic_blood_pressure_sbp > 100 OR diastolic_blood_pressure_dbp > 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: have blood pressure > 100 mmhg systolic or > 70 mmhg diastolic ### Input: CREATE TABLE table_train_154 (
"id" int,
"... |
Visualize a bar chart about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, and rank by the X-axis in ascending please. | 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_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | Below are sql tables 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 All_Home and the average of Team_ID , and group by attribute All_Home, and r... |
How many competitions for each country?, rank by the Country in desc. | CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE competition (
Competition_ID in... | SELECT Country, COUNT(Country) FROM competition GROUP BY Country ORDER BY Country 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: How many competitions for each country?, rank by the Country in desc. ### Input: CREATE TABLE competition_result (
Compe... |
What date did the Indians have a record of 14-28? | CREATE TABLE table_74977 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | SELECT "Date" FROM table_74977 WHERE "Record" = '14-28' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date did the Indians have a record of 14-28? ### Input: CREATE TABLE table_74977 (
"Date" text,
"Opponent" text... |
For dates had a minimum dew point smaller than any day in zip code 94107, show the total number of such days for each weekday using a bar chart. | CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT date, COUNT(date) FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) | Below are sql tables 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 dates had a minimum dew point smaller than any day in zip code 94107, show the total number of such days for each weekda... |
how many days have elapsed since patient 1114 has first received a free calcium lab test on this hospital visit? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id n... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'free calcium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114 AND admissi... | Below are sql tables 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 elapsed since patient 1114 has first received a free calcium lab test on this hospital visit? ### Input: ... |
What is the team score of the away team at Junction Oval? | CREATE TABLE table_4896 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team score" FROM table_4896 WHERE "Venue" = 'junction 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: What is the team score of the away team at Junction Oval? ### Input: CREATE TABLE table_4896 (
"Home team" text,
"Ho... |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute headquarter, rank by the X in desc. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.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: For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and p... |
Show me about the distribution of meter_300 and ID in a bar chart, could you order by the y-axis in descending? | CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | SELECT meter_300, ID FROM swimmer ORDER BY ID 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_300 and ID in a bar chart, could you order by the y-axis in descending? ### Input: C... |
what is the maximum myoglobin value in 12/2105 for patient 021-80293? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-80293')) AND lab.labname = 'myoglobin' AND STRFTIME('%y-%m', lab.labresulttime... | Below are sql tables 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 maximum myoglobin value in 12/2105 for patient 021-80293? ### Input: CREATE TABLE intakeoutput (
intakeoutpu... |
among patients treated with main drug, how many of them had wheelchair dependence? | 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 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.short_title = "Wheelchair dependence" AND prescriptions.drug_type = "MAIN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients treated with main drug, how many of them had wheelchair dependence? ### Input: CREATE TABLE procedures (
... |
Display a bar chart for how many male and female assistant professors do we have?, list by the Sex from low to high. | 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 Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARC... | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY Sex | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Display a bar chart for how many male and female assistant professors do we have?, list by the Sex from low to high. ### Inp... |
Find the number of courses that have more than one prerequisites for each title with a bar chart, and list by the Y-axis in ascending please. | CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
... | SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY COUNT(title) | Below are sql tables 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 courses that have more than one prerequisites for each title with a bar chart, and list by the Y-axis in ... |
Who had the high rebounds when the record was 14 7? | CREATE TABLE table_29843 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "High rebounds" FROM table_29843 WHERE "Record" = '14–7' | Below are sql tables 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 high rebounds when the record was 14 7? ### Input: CREATE TABLE table_29843 (
"Game" real,
"Date" text,
... |
How many league cup goals on average for players with over 0 FA cup and 5 league goals? | CREATE TABLE table_57888 (
"Name" text,
"League" real,
"FA Cup" real,
"League Cup" real,
"Europe" real,
"Total" real
) | SELECT AVG("League Cup") FROM table_57888 WHERE "FA Cup" > '0' AND "League" = '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: How many league cup goals on average for players with over 0 FA cup and 5 league goals? ### Input: CREATE TABLE table_57888 ... |
A bar chart about how many different professors are there for the different schools?, and show from low to high by the Y-axis. | CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE EM... | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE 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: A bar chart about how many different professors are there for the different schools?, and show from low to high by the Y-axi... |
how did patient 25723 last get admitted until 3 years ago to the hospital? | CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 25723 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime 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: how did patient 25723 last get admitted until 3 years ago to the hospital? ### Input: CREATE TABLE admissions (
row_id n... |
What are the LAW classes that will be available this Spring-Summer ? | CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | 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 = 'LAW' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring-... | Below are sql tables 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 LAW classes that will be available this Spring-Summer ? ### Input: CREATE TABLE semester (
semester_id int,... |
Show me a scatter plot of council tax id and cmi_cross_ref_id for . | CREATE TABLE CMI_Cross_References (
cmi_cross_ref_id INTEGER,
master_customer_id INTEGER,
source_system_code CHAR(15)
)
CREATE TABLE Electoral_Register (
electoral_register_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Customer_Master_Index (
master_customer_id INTEGER,
cmi_details V... | SELECT council_tax_id, cmi_cross_ref_id FROM Parking_Fines | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a scatter plot of council tax id and cmi_cross_ref_id for . ### Input: CREATE TABLE CMI_Cross_References (
cmi_c... |
What are the total purchases for members rated at level 6? | CREATE TABLE member (
member_id number,
card_number text,
name text,
hometown text,
level number
)
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE purchase (
member_id number,
bra... | SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 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 the total purchases for members rated at level 6? ### Input: CREATE TABLE member (
member_id number,
card_n... |
Find the altitude (or elevation) of the airports in the city of New York with a bar chart, and sort in descending by the total number. | CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varchar(3),
icao character varchar(4)
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
... | SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY elevation 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 altitude (or elevation) of the airports in the city of New York with a bar chart, and sort in descending by the tot... |
in the previous year, when was the last time that patient 23858 was diagnosed with mult mye w/o achv rmson? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit ... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mult mye w/o achv rmson') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23858) AND DATETIM... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in the previous year, when was the last time that patient 23858 was diagnosed with mult mye w/o achv rmson? ### Input: CREAT... |
i would like to see all flights from DENVER to PHILADELPHIA | CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i would like to see all flights from DENVER to PHILADELPHIA ### Input: CREATE TABLE code_description (
code varchar,
... |
kelly gallardo is taking medication via which route? | 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 prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: kelly gallardo is taking medication via which route? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id t... |
What is the highest Pick # for the College of Maryland-Eastern Shore? | CREATE TABLE table_name_97 (
pick__number INTEGER,
college VARCHAR
) | SELECT MAX(pick__number) FROM table_name_97 WHERE college = "maryland-eastern shore" | Below are sql tables 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 Pick # for the College of Maryland-Eastern Shore? ### Input: CREATE TABLE table_name_97 (
pick__numb... |
What Outcome happened on a Date that was 20 november 2011? | CREATE TABLE table_name_61 (
outcome VARCHAR,
date VARCHAR
) | SELECT outcome FROM table_name_61 WHERE date = "20 november 2011" | Below are sql tables 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 Outcome happened on a Date that was 20 november 2011? ### Input: CREATE TABLE table_name_61 (
outcome VARCHAR,
... |
Calculate the number of patients admitted before 2145 who had dialys | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2145" AND prescriptions.route = "DIALYS" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Calculate the number of patients admitted before 2145 who had dialys ### Input: CREATE TABLE lab (
subject_id text,
... |
What is the tie no that has southport as the away team? | CREATE TABLE table_66643 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | SELECT "Tie no" FROM table_66643 WHERE "Away team" = 'southport' | Below are sql tables 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 tie no that has southport as the away team? ### Input: CREATE TABLE table_66643 (
"Tie no" text,
"Home t... |
Which Format has a Catalog of 561 445-1? | CREATE TABLE table_name_81 (
format VARCHAR,
catalog VARCHAR
) | SELECT format FROM table_name_81 WHERE catalog = "561 445-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: Which Format has a Catalog of 561 445-1? ### Input: CREATE TABLE table_name_81 (
format VARCHAR,
catalog VARCHAR
) #... |
Who constructed rolf stommelen's car? | CREATE TABLE table_54204 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT "Constructor" FROM table_54204 WHERE "Driver" = 'rolf stommelen' | Below are sql tables 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 constructed rolf stommelen's car? ### Input: CREATE TABLE table_54204 (
"Driver" text,
"Constructor" text,
"... |
Which courses are only available during Spring ? | CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (... | 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 WHERE course.department = 'EECS' AND semester.semester = 'Spring' AND (SELECT COUNT(DISTINCT SEMESTE... | Below are sql tables 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 are only available during Spring ? ### Input: CREATE TABLE gsi (
course_offering_id int,
student_id in... |
What is the train number when the time is 10:38? | CREATE TABLE table_74368 (
"Sl. No." real,
"Train number" real,
"Train name" text,
"Origin" text,
"Destination" text,
"Time" text,
"Service" text,
"Route/Via." text
) | SELECT MAX("Train number") FROM table_74368 WHERE "Time" = '10:38' | Below are sql tables 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 train number when the time is 10:38? ### Input: CREATE TABLE table_74368 (
"Sl. No." real,
"Train number... |
what is maximum age of patients whose death status is 0 and age is greater than or equal to 72? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "72" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is maximum age of patients whose death status is 0 and age is greater than or equal to 72? ### Input: CREATE TABLE pres... |
Draw a bar chart of type versus the total number, I want to sort x axis in desc order. | CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest text,
Height_feet int,
Floors int
)
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
seq... | SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY Type DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of type versus the total number, I want to sort x axis in desc order. ### Input: CREATE TABLE building (
... |
list the flights on sunday afternoon from OAKLAND to DALLAS | CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_... | Below are sql tables 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 on sunday afternoon from OAKLAND to DALLAS ### Input: CREATE TABLE time_zone (
time_zone_code text,
... |
What was the team's result in week 4? | CREATE TABLE table_19702 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | SELECT "Result" FROM table_19702 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 was the team's result in week 4? ### Input: CREATE TABLE table_19702 (
"Week" real,
"Date" text,
"Opponent"... |
Bar chart x axis away team y axis the number of away team, I want to rank by the y-axis from high to low. | CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE sta... | SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY COUNT(Away_team) 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 away team y axis the number of away team, I want to rank by the y-axis from high to low. ### Input: CREATE ... |
For minoring students in ACABS , which professor taught a course where students received a B- ? | 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: For minoring students in ACABS , which professor taught a course where students received a B- ? ### Input: CREATE TABLE cour... |
calculate the number of people who have had procedure-one vessel since 6 years ago. | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'procedure-one vessel') AND DATETIME(procedures_icd.c... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the number of people who have had procedure-one vessel since 6 years ago. ### Input: CREATE TABLE chartevents (
... |
Give me the number of patients who were admitted in the emergency room and have a lab test named as troponin t. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Troponin T" | Below are sql tables 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 who were admitted in the emergency room and have a lab test named as troponin t. ### Input: C... |
Visualize a bar chart that X-axis is the gender and compute the number of players in each gender as a Y-axis, show from low to high by the X. | CREATE TABLE player_coach (
Player_ID int,
Coach_ID int,
Starting_year int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE club (
Club_ID int,
Club_name text,
Region text,
Start_year int
)
CREATE TABLE match_resul... | SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY Gender | Below are sql tables 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 that X-axis is the gender and compute the number of players in each gender as a Y-axis, show from low ... |
what is the maximum days of hospital stay of patients whose primary disease is hypoxia? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" | Below are sql tables 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 maximum days of hospital stay of patients whose primary disease is hypoxia? ### Input: CREATE TABLE procedures (... |
what is the name of the output that patient 73713 first got on 05/14/this year? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | 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 = 73713)) AND DATETIME(outputevents.charttim... | Below are sql tables 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 output that patient 73713 first got on 05/14/this year? ### Input: CREATE TABLE cost (
row_id nu... |
how many people were diagnosed with nonrupt cerebral aneurym during the same hospital encounter after being diagnosed with dmii wo cmp uncntrld? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | Below are sql tables 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 people were diagnosed with nonrupt cerebral aneurym during the same hospital encounter after being diagnosed with d... |
count the number of patients whose ethnicity is black/cape verdean and drug name is 0.45% sodium chloride? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "0.45% Sodium Chloride" | Below are sql tables 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 ethnicity is black/cape verdean and drug name is 0.45% sodium chloride? ### Input: CREATE... |
Which MSDN integration has a IntelliTrace of yes? | CREATE TABLE table_name_12 (
msdn_integration VARCHAR,
intellitrace VARCHAR
) | SELECT msdn_integration FROM table_name_12 WHERE intellitrace = "yes" | Below are sql tables 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 MSDN integration has a IntelliTrace of yes? ### Input: CREATE TABLE table_name_12 (
msdn_integration VARCHAR,
... |
To declare a major in PHARMSCI , which classes are required ? | CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%PHARMSCI%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_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: To declare a major in PHARMSCI , which classes are required ? ### Input: CREATE TABLE program_requirement (
program_id i... |
For those employees who was hired before 2002-06-21, visualize a scatter chart about the correlation between employee_id and department_id . | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, visualize a scatter chart about the correlation between employee_id and... |
at what time was the patient with patient id 3343 admitted in hospital? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "3343" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: at what time was the patient with patient id 3343 admitted in hospital? ### Input: CREATE TABLE lab (
subject_id text,
... |
what was the last value of the systemicsystolic for patient 017-88691 since 12/01/2103? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691')) AND NOT vitalperiodic.systemicsystoli... | Below are sql tables 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 value of the systemicsystolic for patient 017-88691 since 12/01/2103? ### Input: CREATE TABLE treatment (
... |
what is the maximum monthly number of people diagnosed with tetralogy of fallot since 2103? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tetralogy of fallot') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2103' GROUP BY STRFTIME('%y-%m',... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the maximum monthly number of people diagnosed with tetralogy of fallot since 2103? ### Input: CREATE TABLE procedur... |
In what round was a left wing drafted? | CREATE TABLE table_name_58 (
round VARCHAR,
position VARCHAR
) | SELECT round FROM table_name_58 WHERE position = "left wing" | Below are sql tables 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 round was a left wing drafted? ### Input: CREATE TABLE table_name_58 (
round VARCHAR,
position VARCHAR
) ###... |
what are the top three most frequent specimen tests that patients took during the same hospital encounter after being diagnosed with hot substance accid nec since 4 years ago? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos... | Below are sql tables 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 frequent specimen tests that patients took during the same hospital encounter after being diagno... |
on their first hospital visit what is patient 013-23267's age? | 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 patient.age FROM patient WHERE patient.uniquepid = '013-23267' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on their first hospital visit what is patient 013-23267's age? ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid n... |
What was the earliest year that T rlea took 7th place? | CREATE TABLE table_name_6 (
year INTEGER,
position VARCHAR
) | SELECT MIN(year) FROM table_name_6 WHERE position = "7th" | Below are sql tables 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 earliest year that T rlea took 7th place? ### Input: CREATE TABLE table_name_6 (
year INTEGER,
position... |
calculate the five year survival rate among the patients who were prescribed cefazolin 2 gm in ns 100 ml ivpb after they were diagnosed with esophageal ca. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the five year survival rate among the patients who were prescribed cefazolin 2 gm in ns 100 ml ivpb after they wer... |
How many votes have a Seat of house A, and a Percentage of 75.44%, and a District smaller than 11? | CREATE TABLE table_60023 (
"District" real,
"Seat" text,
"Candidate" text,
"Party" text,
"Vote" real,
"Percentage" text
) | SELECT COUNT("Vote") FROM table_60023 WHERE "Seat" = 'house a' AND "Percentage" = '75.44%' AND "District" < '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: How many votes have a Seat of house A, and a Percentage of 75.44%, and a District smaller than 11? ### Input: CREATE TABLE t... |
What is the recoupa sudamericana 1996 of the team with a copa libertadores 1996 result of the round of 16? | CREATE TABLE table_35608 (
"Team" text,
"Copa Libertadores 1996" text,
"Supercopa Sudamericana 1996" text,
"Copa CONMEBOL 1996" text,
"Recopa Sudamericana 1996" text
) | SELECT "Recopa Sudamericana 1996" FROM table_35608 WHERE "Copa Libertadores 1996" = 'round of 16' | Below are sql tables 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 recoupa sudamericana 1996 of the team with a copa libertadores 1996 result of the round of 16? ### Input: CREATE... |
let me know the name and route of administration of medication with drug code hydm4. | 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 prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "HYDM4" | Below are sql tables 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 name and route of administration of medication with drug code hydm4. ### Input: CREATE TABLE demographic (
... |
how many government insurance patients had emergency room admission? | 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 WHERE demographic.insurance = "Government" 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 government insurance patients had emergency room admission? ### Input: CREATE TABLE diagnoses (
subject_id text... |
when is the last time patient 85700 has been prescribed medicine this month? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85700) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate 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 is the last time patient 85700 has been prescribed medicine this month? ### Input: CREATE TABLE outputevents (
row_... |
When South Melbourne was the Away Team, what was their score? | CREATE TABLE table_51599 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team score" FROM table_51599 WHERE "Away team" = 'south melbourne' | Below are sql tables 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 South Melbourne was the Away Team, what was their score? ### Input: CREATE TABLE table_51599 (
"Home team" text,
... |
Which 2012 has a 2008 of grand slam tournaments? | CREATE TABLE table_41030 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Win %" text
) | SELECT "2012" FROM table_41030 WHERE "2008" = '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: Which 2012 has a 2008 of grand slam tournaments? ### Input: CREATE TABLE table_41030 (
"Tournament" text,
"2002" tex... |
Points of 26, and a Rank smaller than 27 had what sum of wins? | CREATE TABLE table_6024 (
"Rank" real,
"Rider" text,
"Manufacturer" text,
"Points" real,
"Wins" real
) | SELECT SUM("Wins") FROM table_6024 WHERE "Points" = '26' AND "Rank" < '27' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Points of 26, and a Rank smaller than 27 had what sum of wins? ### Input: CREATE TABLE table_6024 (
"Rank" real,
"Ri... |
How many regions were affected by each storm. Visualize by bar chart. | CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_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: How many regions were affected by each storm. Visualize by bar chart. ### Input: CREATE TABLE storm (
Storm_ID int,
... |
price of flight from CLEVELAND to NASHVILLE | CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airp... | SELECT DISTINCT fare.fare_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 = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: price of flight from CLEVELAND to NASHVILLE ### Input: CREATE TABLE code_description (
code varchar,
description tex... |
is the value of white blood cells second measured on the current hospital visit of patient 13054 less than its value first measured on the current hospital visit? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13054 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') ORDER BY labevents.... | Below are sql tables 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 the value of white blood cells second measured on the current hospital visit of patient 13054 less than its value first m... |
RCIDIV 302 has been in the course listings for how long ? | 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,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'RCIDIV' AND course.number = 302 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: RCIDIV 302 has been in the course listings for how long ? ### Input: CREATE TABLE offering_instructor (
offering_instruc... |
What is the average latitude and longitude of stations located in San Jose city? | CREATE TABLE station (
lat INTEGER,
long INTEGER,
city VARCHAR
) | SELECT AVG(lat), AVG(long) FROM station WHERE city = "San Jose" | Below are sql tables 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 latitude and longitude of stations located in San Jose city? ### Input: CREATE TABLE station (
lat I... |
list the number of patients whose admission type is elective and drug code is guai600t. | 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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "GUAI600T" | Below are sql tables 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 number of patients whose admission type is elective and drug code is guai600t. ### Input: CREATE TABLE diagnoses (
... |
get me the type and location of admission for patient with patient id 42067. | 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 demographic.admission_type, demographic.admission_location FROM demographic WHERE demographic.subject_id = "42067" | Below are sql tables 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 type and location of admission for patient with patient id 42067. ### Input: CREATE TABLE diagnoses (
subject... |
how many persons got the third position whan sanyo electric tokushima got the fourth position? | CREATE TABLE table_21632864_1 (
third_place VARCHAR,
fourth_place VARCHAR
) | SELECT COUNT(third_place) FROM table_21632864_1 WHERE fourth_place = "Sanyo Electric Tokushima" | Below are sql tables 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 persons got the third position whan sanyo electric tokushima got the fourth position? ### Input: CREATE TABLE table... |
Easiest class I can take to fulfill the PreMajor requirement ? | 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 varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Easiest class I can take to fulfill the PreMajor requirement ? ### Input: CREATE TABLE course_offering (
offering_id int... |
If the average start is 11.8, what was the team name? | CREATE TABLE table_2190919_3 (
team_s_ VARCHAR,
avg_start VARCHAR
) | SELECT team_s_ FROM table_2190919_3 WHERE avg_start = "11.8" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the average start is 11.8, what was the team name? ### Input: CREATE TABLE table_2190919_3 (
team_s_ VARCHAR,
avg... |
What place was the scorer of 67-74-73=214? | CREATE TABLE table_80399 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "Place" FROM table_80399 WHERE "Score" = '67-74-73=214' | Below are sql tables 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 place was the scorer of 67-74-73=214? ### Input: CREATE TABLE table_80399 (
"Place" text,
"Player" text,
"C... |
Who is the player had the highest salary in 2015? | CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots text,
needed text,
votes text,
inducted text,
category text,
needed_note text
)
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
CREA... | SELECT player_id FROM salary WHERE year = "2015" ORDER BY salary 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: Who is the player had the highest salary in 2015? ### Input: CREATE TABLE hall_of_fame (
player_id text,
yearid numb... |
what is lab test abnormal status of subject name paul edwards? | 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 procedures (
... | SELECT lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.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: what is lab test abnormal status of subject name paul edwards? ### Input: CREATE TABLE diagnoses (
subject_id text,
... |
find a flight from TORONTO to SAN DIEGO with a layover in SAN FRANCISCO on AC | CREATE TABLE code_description (
code varchar,
description text
)
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,
fligh... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_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: find a flight from TORONTO to SAN DIEGO with a layover in SAN FRANCISCO on AC ### Input: CREATE TABLE code_description (
... |
Who was at home on april 14? | CREATE TABLE table_name_8 (
home VARCHAR,
date VARCHAR
) | SELECT home FROM table_name_8 WHERE date = "april 14" | Below are sql tables 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 at home on april 14? ### Input: CREATE TABLE table_name_8 (
home VARCHAR,
date VARCHAR
) ### Response: SELEC... |
For next semester , what upper-level electives are offered that do n't meet on Monday or Friday ? | 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 varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course... | Below are sql tables 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 , what upper-level electives are offered that do n't meet on Monday or Friday ? ### Input: CREATE TABLE co... |
What type of game had a result of 1:2? | CREATE TABLE table_38892 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | SELECT "Type of game" FROM table_38892 WHERE "Results\u00b9" = '1:2' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What type of game had a result of 1:2? ### Input: CREATE TABLE table_38892 (
"Date" text,
"City" text,
"Opponent... |
What was the original air date of the episode that had 5.30 million U.S. viewers? | CREATE TABLE table_25548505_1 (
original_air_date VARCHAR,
us_viewers__millions_ VARCHAR
) | SELECT original_air_date FROM table_25548505_1 WHERE us_viewers__millions_ = "5.30" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the original air date of the episode that had 5.30 million U.S. viewers? ### Input: CREATE TABLE table_25548505_1 (... |
Who was the incumbent in 1940? | CREATE TABLE table_18372 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | SELECT "Incumbent" FROM table_18372 WHERE "First elected" = '1940' | Below are sql tables 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 incumbent in 1940? ### Input: CREATE TABLE table_18372 (
"District" text,
"Incumbent" text,
"Party" ... |
Which week with Green Bay Packers as an opponent is the highest? | CREATE TABLE table_name_52 (
week INTEGER,
opponent VARCHAR
) | SELECT MAX(week) FROM table_name_52 WHERE opponent = "green bay packers" | Below are sql tables 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 week with Green Bay Packers as an opponent is the highest? ### Input: CREATE TABLE table_name_52 (
week INTEGER,
... |
What PreMajor or MDE courses are available in the Fall ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
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,
... | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Fal... | Below are sql tables 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 PreMajor or MDE courses are available in the Fall ? ### Input: CREATE TABLE course_prerequisite (
pre_course_id int... |
What are the dominant religions in the place with a population of 83? | CREATE TABLE table_27860 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" text,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | SELECT "Dominant religion (2002)" FROM table_27860 WHERE "Population (2011)" = '83' | Below are sql tables 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 dominant religions in the place with a population of 83? ### Input: CREATE TABLE table_27860 (
"Settlement"... |
what's the first time patient 003-17096 had a maximum -lymphs the last month? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
... | 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 = '003-17096')) AND lab.labname = '-lymphs' AND DATETIME(lab.labresulttime, 'start of ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the first time patient 003-17096 had a maximum -lymphs the last month? ### Input: CREATE TABLE lab (
labid number... |
For all employees who have the letters D or S in their first name, find job_id and the average of employee_id , and group by attribute job_id, and visualize them by a bar chart, rank in asc by the y-axis please. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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),
... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID 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 all employees who have the letters D or S in their first name, find job_id and the average of employee_id , and group by... |
Return a bar chart on what are the names of the different bank branches, and what are their total loan amounts?, display y-axis from low to high 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 bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY SUM(amount) | Below are sql tables 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 what are the names of the different bank branches, and what are their total loan amounts?, display y-a... |
Name the gt winning car for #88 team mitsubishi 88 mitsubishi starion | CREATE TABLE table_27965906_2 (
gt_winning_car VARCHAR,
a_winning_car VARCHAR
) | SELECT gt_winning_car FROM table_27965906_2 WHERE a_winning_car = "#88 Team Mitsubishi 88 Mitsubishi Starion" | Below are sql tables 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 gt winning car for #88 team mitsubishi 88 mitsubishi starion ### Input: CREATE TABLE table_27965906_2 (
gt_winn... |
Which Position has a Pick of 174? | CREATE TABLE table_36952 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"College" text
) | SELECT "Position" FROM table_36952 WHERE "Pick" = '174' | Below are sql tables 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 Position has a Pick of 174? ### Input: CREATE TABLE table_36952 (
"Round" real,
"Pick" real,
"Player" text... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.