instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
count the number of patients whose primary disease is hypoxia and year of death is less than or equal to 2155? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.dod_year <= "2155.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: count the number of patients whose primary disease is hypoxia and year of death is less than or equal to 2155? ### Input: CR... |
How many classes are held in each department Visualize by bar chart, and list by the total number from high to low. | CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
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),
... | SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE 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: How many classes are held in each department Visualize by bar chart, and list by the total number from high to low. ### Inpu... |
Which party is tobias a. plants the incumbent? | CREATE TABLE table_name_11 (
party VARCHAR,
incumbent VARCHAR
) | SELECT party FROM table_name_11 WHERE incumbent = "tobias a. plants" | Below are sql tables 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 party is tobias a. plants the incumbent? ### Input: CREATE TABLE table_name_11 (
party VARCHAR,
incumbent VARC... |
I want to know the proportion of allergy types for each allergytype. | CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP 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: I want to know the proportion of allergy types for each allergytype. ### Input: CREATE TABLE Allergy_Type (
Allergy VARC... |
A bar chart shows the distribution of All_Neutral and 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 All_Neutral, School_ID 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 bar chart shows the distribution of All_Neutral and School_ID . ### Input: CREATE TABLE basketball_match (
Team_ID int... |
count the number of patients whose insurance is private and admission year is less than 2173? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admityear < "2173" | Below are sql tables 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 insurance is private and admission year is less than 2173? ### Input: CREATE TABLE lab (
... |
Whats the song of name with an original artist Garth Brooks | CREATE TABLE table_2470 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | SELECT "Song choice" FROM table_2470 WHERE "Original artist" = 'Garth Brooks' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Whats the song of name with an original artist Garth Brooks ### Input: CREATE TABLE table_2470 (
"Week #" text,
"The... |
when did it first happen on 03/01/2103 that the respiratory rate of patient 31300 was less than 19.0? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31300)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did it first happen on 03/01/2103 that the respiratory rate of patient 31300 was less than 19.0? ### Input: CREATE TABL... |
What is the average attendance for the game that was after week 4 and on November 14, 1954? | CREATE TABLE table_38945 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT AVG("Attendance") FROM table_38945 WHERE "Week" > '4' AND "Date" = 'november 14, 1954' | Below are sql tables 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 attendance for the game that was after week 4 and on November 14, 1954? ### Input: CREATE TABLE table_38... |
Find the number of patients who have aortic valve insufficiency/aortic valve replacement/sda as their primary disease. | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | Below are sql tables 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 who have aortic valve insufficiency/aortic valve replacement/sda as their primary disease. ### I... |
Show all countries and the number of people from each country, rank bar in asc 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 Country, COUNT(*) FROM people GROUP BY Country ORDER BY Country | Below are sql tables 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 countries and the number of people from each country, rank bar in asc order. ### Input: CREATE TABLE wedding (
... |
when was the last time that patient 9038 has had the maximum arterial bp mean since 771 days 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 chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9038)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time that patient 9038 has had the maximum arterial bp mean since 771 days ago? ### Input: CREATE TABLE d_... |
What is Opponents In The Final, when Score is 4-1 5-4 (7) 4-2? | CREATE TABLE table_name_84 (
opponents_in_the_final VARCHAR,
score VARCHAR
) | SELECT opponents_in_the_final FROM table_name_84 WHERE score = "4-1 5-4 (7) 4-2" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Opponents In The Final, when Score is 4-1 5-4 (7) 4-2? ### Input: CREATE TABLE table_name_84 (
opponents_in_the_... |
Which Sydney has a Perth of no, a Melbourne of yes, and a Gold Coast of no? | CREATE TABLE table_68017 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
) | SELECT "Sydney" FROM table_68017 WHERE "Perth" = 'no' AND "Melbourne" = 'yes' AND "Gold Coast" = 'no' | Below are sql tables 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 Sydney has a Perth of no, a Melbourne of yes, and a Gold Coast of no? ### Input: CREATE TABLE table_68017 (
"Sydne... |
how many dukedoms are listed ? | CREATE TABLE table_203_172 (
id number,
"title" text,
"date of creation" text,
"surname" text,
"first titular" text
) | SELECT COUNT("title") FROM table_203_172 | Below are sql tables 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 dukedoms are listed ? ### Input: CREATE TABLE table_203_172 (
id number,
"title" text,
"date of creatio... |
Show all party names and the number of members in each party Show bar chart, show by the X-axis in desc. | CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
Region_name tex... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all party names and the number of members in each party Show bar chart, show by the X-axis in desc. ### Input: CREATE T... |
Name the ERP W for frequency of 92.7 | CREATE TABLE table_75357 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | SELECT "ERP W" FROM table_75357 WHERE "Frequency MHz" = '92.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: Name the ERP W for frequency of 92.7 ### Input: CREATE TABLE table_75357 (
"Call sign" text,
"Frequency MHz" real,
... |
How many patients have hospital stay above 6 days with lab test category blood gas? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab."CATEGORY" = "Blood Gas" | Below are sql tables 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 hospital stay above 6 days with lab test category blood gas? ### Input: CREATE TABLE diagnoses (
... |
What is the sum of the episode numbers where chip esten is the 4th performer and christopher smith was the 2nd performer? | CREATE TABLE table_name_37 (
episode INTEGER,
performer_4 VARCHAR,
performer_2 VARCHAR
) | SELECT SUM(episode) FROM table_name_37 WHERE performer_4 = "chip esten" AND performer_2 = "christopher smith" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of the episode numbers where chip esten is the 4th performer and christopher smith was the 2nd performer? ##... |
The safety position is represented in the draft by which colleges? | CREATE TABLE table_32775 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | SELECT "College" FROM table_32775 WHERE "Position" = 'safety' | Below are sql tables 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 safety position is represented in the draft by which colleges? ### Input: CREATE TABLE table_32775 (
"Round" real,
... |
During the Fall and Winter term , how many 300 -level classes are you guys offering ? | 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 COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: During the Fall and Winter term , how many 300 -level classes are you guys offering ? ### Input: CREATE TABLE course_tags_co... |
What team played on the road against the Buffalo Bills at home ? | CREATE TABLE table_name_21 (
visiting_team VARCHAR,
host_team VARCHAR
) | SELECT visiting_team FROM table_name_21 WHERE host_team = "buffalo bills" | Below are sql tables 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 team played on the road against the Buffalo Bills at home ? ### Input: CREATE TABLE table_name_21 (
visiting_team V... |
give me the total amount of lr ivf that patient 006-70268 took on 04/13/this year. | 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 SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-70268')) AND intakeoutput.celllabel = 'lr iv... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the total amount of lr ivf that patient 006-70268 took on 04/13/this year. ### Input: CREATE TABLE treatment (
t... |
What is the highest amount of money a play from Scotland United States has? | CREATE TABLE table_name_99 (
money___ INTEGER,
country VARCHAR
) | SELECT MAX(money___) AS $__ FROM table_name_99 WHERE country = "scotland united states" | Below are sql tables 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 amount of money a play from Scotland United States has? ### Input: CREATE TABLE table_name_99 (
mone... |
Return the number of the date of birth for all the guests with gender code 'Male'. | CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Guests (
gue... | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the number of the date of birth for all the guests with gender code 'Male'. ### Input: CREATE TABLE Apartment_Facilit... |
Who was the away team at the game held at Brunswick Street Oval? | CREATE TABLE table_name_45 (
away_team VARCHAR,
venue VARCHAR
) | SELECT away_team FROM table_name_45 WHERE venue = "brunswick street oval" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the away team at the game held at Brunswick Street Oval? ### Input: CREATE TABLE table_name_45 (
away_team VARCH... |
How many patients were diagnosed with hemorrhagic complications and had lab test category as chemistry? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hemorrhage complic proc" AND lab."CATEGORY" = "Chemistry" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many patients were diagnosed with hemorrhagic complications and had lab test category as chemistry? ### Input: CREATE TA... |
what is the number of patients whose admission location is trsf within this facility and procedure icd9 code is 3733? | 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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "3733" | Below are sql tables 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 admission location is trsf within this facility and procedure icd9 code is 3733? ### In... |
Which venue had a lost 5-4 result? | CREATE TABLE table_name_15 (
venue VARCHAR,
result VARCHAR
) | SELECT venue FROM table_name_15 WHERE result = "lost 5-4" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue had a lost 5-4 result? ### Input: CREATE TABLE table_name_15 (
venue VARCHAR,
result VARCHAR
) ### Respo... |
What options do I have for my Core in ORTHO ? | CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%ORTHO%' AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_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: What options do I have for my Core in ORTHO ? ### Input: CREATE TABLE program_requirement (
program_id int,
category... |
provide the number of patients whose admission type is elective and lab test name is asparate aminotransferase (ast)? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Asparate Aminotransferase (AST)" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission type is elective and lab test name is asparate aminotransferase (ast)? ### In... |
Show the location codes and the number of documents in each location in a bar chart, and I want to display by the names from high to low. | CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_De... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the location codes and the number of documents in each location in a bar chart, and I want to display by the names from... |
Return a bar chart on what is the number of professors for different school?, and sort from high to low by the the total number . | CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE STUDENT ... | 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(*) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on what is the number of professors for different school?, and sort from high to low by the the total num... |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of job_id and department_id , could you order by the DEPARTMENT_ID in asc please? | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_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, return a bar chart about... |
adult age 21 _ 70 years of age. | CREATE TABLE table_train_267 (
"id" int,
"pregnancy_or_lactation" bool,
"smoking" bool,
"allergy_to_nuts" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | SELECT * FROM table_train_267 WHERE age >= 21 AND age <= 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: adult age 21 _ 70 years of age. ### Input: CREATE TABLE table_train_267 (
"id" int,
"pregnancy_or_lactation" bool,
... |
Give me a histogram for what are the names and total prices of all products in the store?, display from low to high by the y-axis please. | 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 Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) | Below are sql tables 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 a histogram for what are the names and total prices of all products in the store?, display from low to high by the y... |
What is the result foe October 12, 2005? | CREATE TABLE table_name_75 (
result VARCHAR,
date VARCHAR
) | SELECT result FROM table_name_75 WHERE date = "october 12, 2005" | Below are sql tables 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 foe October 12, 2005? ### Input: CREATE TABLE table_name_75 (
result VARCHAR,
date VARCHAR
) ### ... |
provide the number of patients less than 77 years of age with drug code nabc50i. | 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.age < "77" AND prescriptions.formulary_drug_cd = "NABC50I" | Below are sql tables 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 less than 77 years of age with drug code nabc50i. ### Input: CREATE TABLE diagnoses (
sub... |
Find the first and last name of students who are living in the dorms that have amenity TV Lounge. | CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CRE... | SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | Below are sql tables 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 first and last name of students who are living in the dorms that have amenity TV Lounge. ### Input: CREATE TABLE st... |
what voice acter played tien | CREATE TABLE table_38208 (
"Character Name" text,
"Voice Actor (Japanese)" text,
"Voice Actor (English 1997 / Saban)" text,
"Voice Actor (English 1998 / Pioneer)" text,
"Voice Actor (English 2006 / FUNimation)" text
) | SELECT "Voice Actor (Japanese)" FROM table_38208 WHERE "Character Name" = 'tien' | Below are sql tables 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 voice acter played tien ### Input: CREATE TABLE table_38208 (
"Character Name" text,
"Voice Actor (Japanese)" t... |
find travel arrangements for a round trip flight from BALTIMORE to PITTSBURGH after 2000 o'clock pm before 2200 o'clock pm | CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arriv... | 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 (((NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id = fare.fare_id AND flight.departure_time < 2200 AND flight.flight_id = flight_fare... | Below are sql tables 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 travel arrangements for a round trip flight from BALTIMORE to PITTSBURGH after 2000 o'clock pm before 2200 o'clock pm #... |
Who was the away team that played Fitzroy on May 13, 1950 at Brunswick Street Oval. | CREATE TABLE table_name_86 (
away_team VARCHAR,
venue VARCHAR
) | SELECT away_team FROM table_name_86 WHERE venue = "brunswick street oval" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the away team that played Fitzroy on May 13, 1950 at Brunswick Street Oval. ### Input: CREATE TABLE table_name_86 (
... |
count the number of patients whose admission year is less than 2180 and drug name is cefazolin? | 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.admityear < "2180" AND prescriptions.drug = "CefazoLIN" | Below are sql tables 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 admission year is less than 2180 and drug name is cefazolin? ### Input: CREATE TABLE demo... |
Show the different countries and the number of members from each with a bar chart. | CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
) | SELECT Country, COUNT(*) FROM member GROUP BY Country | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the different countries and the number of members from each with a bar chart. ### Input: CREATE TABLE round (
Round... |
who shot the best 73 m | CREATE TABLE table_204_234 (
id number,
"round" text,
"100 yd (91 m)" text,
"80 yd (73 m)" text,
"60 yd (55 m)" text,
"50 yd (46 m)" text,
"40 yd (37 m)" text
) | SELECT "round" FROM table_204_234 ORDER BY "80 yd (73 m)" 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 shot the best 73 m ### Input: CREATE TABLE table_204_234 (
id number,
"round" text,
"100 yd (91 m)" text,
... |
how many patients whose admission type is urgent and diagnoses long title is hyperpotassemia? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Hyperpotassemia" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is urgent and diagnoses long title is hyperpotassemia? ### Input: CREATE TABLE lab (
... |
give me the number of patients born before 2200 who had lab test item id 50882. | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2200" AND lab.itemid = "50882" | Below are sql tables 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 born before 2200 who had lab test item id 50882. ### Input: CREATE TABLE prescriptions (
... |
how many patients have been discharged until 2101? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2101' | Below are sql tables 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 until 2101? ### Input: CREATE TABLE treatment (
treatmentid number,
patientun... |
For a CS major , what classes are available this Winter that would count towards that ? | CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE program_course.course_id = course.course_id AND program_course.course_id = course.course_id AND program.name LIKE '%CS%' AND program.program_id = program_course.program_id AND semester.sem... | Below are sql tables 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 a CS major , what classes are available this Winter that would count towards that ? ### Input: CREATE TABLE student (
... |
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of revenue , and group by attribute founder in a bar chart, I want to list X in desc order please. | 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 Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder 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, show me about the distribution of founder and the sum o... |
how long does the ground transportation take from the SALT LAKE CITY airport | 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 class_of_ser... | SELECT DISTINCT AIRPORT_SERVICE_0.minutes_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE airport.airport_code = AIRPORT_SERVICE_0.airport_code AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND CITY_0.city_code = AIRPORT_... | Below are sql tables 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 long does the ground transportation take from the SALT LAKE CITY airport ### Input: CREATE TABLE flight_stop (
fligh... |
What is the average number of points for players with 4 touchdowns and more than 0 field goals? | CREATE TABLE table_75198 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | SELECT AVG("Points") FROM table_75198 WHERE "Touchdowns" = '4' AND "Field goals" > '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: What is the average number of points for players with 4 touchdowns and more than 0 field goals? ### Input: CREATE TABLE tabl... |
Which Opponent was played on 1991-10-13? | CREATE TABLE table_78475 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | SELECT "Opponent" FROM table_78475 WHERE "Date" = '1991-10-13' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Opponent was played on 1991-10-13? ### Input: CREATE TABLE table_78475 (
"Week" real,
"Date" text,
"Oppone... |
how many asian patients had 78057 as their diagnosis icd9 code | 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.ethnicity = "ASIAN" AND diagnoses.icd9_code = "78057" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many asian patients had 78057 as their diagnosis icd9 code ### Input: CREATE TABLE diagnoses (
subject_id text,
... |
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, a scatter chart shows the correlation between commission_pct and manager_id . | 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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | Below are sql tables 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 ... |
when was patient 002-21509 prescribed a medication on the last hospital visit for the last time? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-21509' AND NOT patient.hospitaldischargetime IS NULL ORDER... | Below are sql tables 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 002-21509 prescribed a medication on the last hospital visit for the last time? ### Input: CREATE TABLE int... |
how many hours have passed since patient 95892 received a pt laboratory test for the first time in this hospital encounter? | 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
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | SELECT 24 * (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 = 'pt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND admissions.disc... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours have passed since patient 95892 received a pt laboratory test for the first time in this hospital encounter? ... |
what is average age of patients whose insurance is medicare and year of death is less than 2174? | 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 AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dod_year < "2174.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: what is average age of patients whose insurance is medicare and year of death is less than 2174? ### Input: CREATE TABLE dia... |
what is the average points when the goal difference is less than 17, the club is getafe cf and the goals for is more than 30? | CREATE TABLE table_58240 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | SELECT AVG("Points") FROM table_58240 WHERE "Goal Difference" < '17' AND "Club" = 'getafe cf' AND "Goals for" > '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 is the average points when the goal difference is less than 17, the club is getafe cf and the goals for is more than 30... |
what were the five most commonly prescribed drugs for patients who had been previously diagnosed with neonatal bradycardia within 2 months, in this year? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five most commonly prescribed drugs for patients who had been previously diagnosed with neonatal bradycardia w... |
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and department_id , I want to show y-axis in descending order please. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_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: For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about t... |
What is the attendance of the game against the houston oilers? | CREATE TABLE table_name_6 (
attendance VARCHAR,
opponent VARCHAR
) | SELECT attendance FROM table_name_6 WHERE opponent = "houston oilers" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the attendance of the game against the houston oilers? ### Input: CREATE TABLE table_name_6 (
attendance VARCHAR... |
How many students have each different allergy. Show bar chart. | CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy | Below are sql tables 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 students have each different allergy. Show bar chart. ### Input: CREATE TABLE Allergy_Type (
Allergy VARCHAR(20... |
What was St Kilda's home team opponents score? | CREATE TABLE table_name_56 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team AS score FROM table_name_56 WHERE away_team = "st kilda" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was St Kilda's home team opponents score? ### Input: CREATE TABLE table_name_56 (
home_team VARCHAR,
away_team ... |
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT HIRE_DATE, AVG(EMPLOYEE_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 bar chart about the distribution of hire_date and the avera... |
what are the three commonly tested specimens for patients that received packed cell transfusion previously within the same month, until 2 years ago? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | 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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the three commonly tested specimens for patients that received packed cell transfusion previously within the same m... |
show me the nonstop flights from TORONTO to ST. PETERSBURG | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE... | 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. P... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the nonstop flights from TORONTO to ST. PETERSBURG ### Input: CREATE TABLE flight_fare (
flight_id int,
fare... |
What is the date of the Cubs game when the Cubs had a record of 1-0? | CREATE TABLE table_54866 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT "Date" FROM table_54866 WHERE "Record" = '1-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: What is the date of the Cubs game when the Cubs had a record of 1-0? ### Input: CREATE TABLE table_54866 (
"Date" text,
... |
give me the number of patients whose marital status is single and lab test name is po2? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "pO2" | Below are sql tables 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 marital status is single and lab test name is po2? ### Input: CREATE TABLE demographic ... |
Show post to Socratic badge. shows all posts that are meet the Socratic badge requirements. | CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | SELECT Id, Id AS "post_link" FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 1 AND Score > 0 AND DeletionDate IS NULL AND ClosedDate IS NULL 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 post to Socratic badge. shows all posts that are meet the Socratic badge requirements. ### Input: CREATE TABLE PostNoti... |
how much patient 76372 had to pay for their stay in hospital on this hospital encounter? | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
insuranc... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76372 AND admissions.dischtime IS NULL) | Below are sql tables 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 much patient 76372 had to pay for their stay in hospital on this hospital encounter? ### Input: CREATE TABLE d_items (
... |
when did patient 73075 have the maximum value of creatinine for the first time in 12/last year? | 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 labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73075) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURR... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 73075 have the maximum value of creatinine for the first time in 12/last year? ### Input: CREATE TABLE outp... |
how many patients this year were staying in the careunit sicu? | 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'sicu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 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: how many patients this year were staying in the careunit sicu? ### Input: CREATE TABLE prescriptions (
row_id number,
... |
when did patient 025-44495's first sputum, tracheal specimen microbiology test during their first hospital visit be performed? | 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 microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 025-44495's first sputum, tracheal specimen microbiology test during their first hospital visit be performe... |
Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order. Show bar chart. | CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
... | SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_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: Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending ord... |
Return a bar chart about the distribution of Days and the average of Credits , and group by attribute Days. | CREATE TABLE Gradeconversion (
lettergrade VARCHAR(2),
gradepoint FLOAT
)
CREATE TABLE Enrolled_in (
StuID INTEGER,
CID VARCHAR(7),
Grade VARCHAR(2)
)
CREATE TABLE Member_of (
FacID INTEGER,
DNO INTEGER,
Appt_Type VARCHAR(15)
)
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCH... | SELECT Days, AVG(Credits) FROM Course GROUP BY Days ORDER BY Credits | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of Days and the average of Credits , and group by attribute Days. ### Input: CREAT... |
Top 500 users from Pakistan. | CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name te... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PAK' ORDER BY Reputation DESC LIMIT 500 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 500 users from Pakistan. ### Input: CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName ... |
how many patients had admission location as clinic referral/premature and diagnoses icd9 code as 25541? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients had admission location as clinic referral/premature and diagnoses icd9 code as 25541? ### Input: CREATE TA... |
What is the series record for the game on April 24? | CREATE TABLE table_name_41 (
series VARCHAR,
date VARCHAR
) | SELECT series FROM table_name_41 WHERE date = "april 24" | Below are sql tables 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 series record for the game on April 24? ### Input: CREATE TABLE table_name_41 (
series VARCHAR,
date VAR... |
count the number of patients whose marital status is single and item id is 51265? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "51265" | Below are sql tables 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 marital status is single and item id is 51265? ### Input: CREATE TABLE diagnoses (
su... |
Which Rank has a Gold of 3, and a Bronze of 4, and a Total larger than 8? | CREATE TABLE table_60845 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Rank") FROM table_60845 WHERE "Gold" = '3' AND "Bronze" = '4' AND "Total" > '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 Rank has a Gold of 3, and a Bronze of 4, and a Total larger than 8? ### Input: CREATE TABLE table_60845 (
"Rank" r... |
Find the first name and age of the students who are playing both Football and Lacrosse. | CREATE TABLE Student (
fname VARCHAR,
age VARCHAR,
StuID VARCHAR,
SportName VARCHAR
)
CREATE TABLE Sportsinfo (
fname VARCHAR,
age VARCHAR,
StuID VARCHAR,
SportName VARCHAR
) | SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = "Football" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = "Lacrosse") | Below are sql tables 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 first name and age of the students who are playing both Football and Lacrosse. ### Input: CREATE TABLE Student (
... |
How many credits is 595 ? | CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_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,
t... | SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 595 | Below are sql tables 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 credits is 595 ? ### Input: CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,... |
give me the number of patients whose admission location is phys referral/normal deli and item id is 51005? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51005" | Below are sql tables 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 location is phys referral/normal deli and item id is 51005? ### Input: CREATE... |
Find the number of booking start date for the apartments that have more than two bedrooms for each weekday with a bar chart, and order total number in asc order. | CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CH... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_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: Find the number of booking start date for the apartments that have more than two bedrooms for each weekday with a bar chart,... |
Who was the incumbent in the Arkansas 2 district election? | CREATE TABLE table_18436 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | SELECT "Incumbent" FROM table_18436 WHERE "District" = 'Arkansas 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: Who was the incumbent in the Arkansas 2 district election? ### Input: CREATE TABLE table_18436 (
"District" text,
"I... |
I want to know the proportion of each type. | CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | SELECT Type, COUNT(Type) FROM ship GROUP BY Type | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to know the proportion of each type. ### Input: CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code ... |
what percentile of a red blood cells is at 4.1 among a patient at the same age as patient 65582 in their current hospital encounter? | 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 DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissio... | Below are sql tables 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 percentile of a red blood cells is at 4.1 among a patient at the same age as patient 65582 in their current hospital en... |
What was nominee nominated for outstanding featured actor in a musical? | CREATE TABLE table_name_65 (
nominee VARCHAR,
category VARCHAR,
result VARCHAR
) | SELECT nominee FROM table_name_65 WHERE category = "outstanding featured actor in a musical" AND result = "nominated" | Below are sql tables 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 nominee nominated for outstanding featured actor in a musical? ### Input: CREATE TABLE table_name_65 (
nominee ... |
Return a bar chart about the distribution of Team_Name and School_ID . | 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, School_ID 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: Return a bar chart about the distribution of Team_Name and School_ID . ### Input: CREATE TABLE university (
School_ID in... |
What was the Score on October 24, 1982 in Tokyo, Japan? | CREATE TABLE table_6327 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | SELECT "Score" FROM table_6327 WHERE "Tournament" = 'tokyo, japan' AND "Date" = 'october 24, 1982' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Score on October 24, 1982 in Tokyo, Japan? ### Input: CREATE TABLE table_6327 (
"Outcome" text,
"Date" ... |
what is the lowest laps when the grid is smaller than 5 and the driver is juan manuel fangio? | CREATE TABLE table_name_45 (
laps INTEGER,
grid VARCHAR,
driver VARCHAR
) | SELECT MIN(laps) FROM table_name_45 WHERE grid < 5 AND driver = "juan manuel fangio" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the lowest laps when the grid is smaller than 5 and the driver is juan manuel fangio? ### Input: CREATE TABLE table_... |
Name the tournament for semifinal hard surface for opponent of pam casale | CREATE TABLE table_69644 (
"Tournament" text,
"Date" text,
"Surface" text,
"Round" text,
"Opponent" text
) | SELECT "Tournament" FROM table_69644 WHERE "Round" = 'semifinal' AND "Surface" = 'hard' AND "Opponent" = 'pam casale' | Below are sql tables 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 tournament for semifinal hard surface for opponent of pam casale ### Input: CREATE TABLE table_69644 (
"Tournam... |
give me the number of patients whose lab test chart time is 2111-12-31 12:16:00? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2111-12-31 12:16:00" | Below are sql tables 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 lab test chart time is 2111-12-31 12:16:00? ### Input: CREATE TABLE diagnoses (
sub... |
Show me about the distribution of All_Road and All_Games_Percent in a bar chart, and I want to show by the names in desc please. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road 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 All_Road and All_Games_Percent in a bar chart, and I want to show by the names in desc ple... |
among the patients of age 60 or above during this year, what were the top five most frequent laboratory tests? | 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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype tex... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(labevents.charttime, '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: among the patients of age 60 or above during this year, what were the top five most frequent laboratory tests? ### Input: CR... |
What is the highest number of top-10s in events with more than 0 wins? | CREATE TABLE table_name_46 (
top_10 INTEGER,
wins INTEGER
) | SELECT MAX(top_10) FROM table_name_46 WHERE wins > 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: What is the highest number of top-10s in events with more than 0 wins? ### Input: CREATE TABLE table_name_46 (
top_10 IN... |
since 1 year ago, patient 19144 has been admitted into the hospital? | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 19144 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-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: since 1 year ago, patient 19144 has been admitted into the hospital? ### Input: CREATE TABLE chartevents (
row_id number... |
what are the ids and names of all start stations that were the beginning of at least 200 trips?, sort start_station_id from high to low order. | CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_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: what are the ids and names of all start stations that were the beginning of at least 200 trips?, sort start_station_id from ... |
Bar chart x axis acc road y axis the average of school id, and sort bar in asc order 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 ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER 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, and sort bar in asc order please. ### Input: CREATE TABLE basketb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.