instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Show me a scatter plot of destroyed by employee id and the total number for . | CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)... | SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a scatter plot of destroyed by employee id and the total number for . ### Input: CREATE TABLE Ref_Locations (
Lo... |
tell me the name of the output patient 010-32698 had last on the last icu visit? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698') AND NOT patient.unitdischargetime 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: tell me the name of the output patient 010-32698 had last on the last icu visit? ### Input: CREATE TABLE vitalperiodic (
... |
What is the rating of the episode with a share of 4 and a rating/share (18-49) of 0.7/2? | CREATE TABLE table_25751274_2 (
rating VARCHAR,
share VARCHAR
) | SELECT rating FROM table_25751274_2 WHERE share = 4 AND rating / SHARE(18 - 49) = 0.7 / 2 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rating of the episode with a share of 4 and a rating/share (18-49) of 0.7/2? ### Input: CREATE TABLE table_25751... |
Show me about the distribution of Team_Name and ACC_Percent in a bar chart. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_Name, ACC_Percent FROM basketball_match | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of Team_Name and ACC_Percent in a bar chart. ### Input: CREATE TABLE university (
School_... |
Visualize the average smallest rating of different movie title using a bar chart. | CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.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: Visualize the average smallest rating of different movie title using a bar chart. ### Input: CREATE TABLE Rating (
rID i... |
For all employees who have the letters D or S in their first name, find hire_date and the sum of salary bin hire_date by weekday, and visualize them by a bar chart, list total number of salary from low to high order. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLO... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, find hire_date and the sum of salary bin hire_date by wee... |
how many patients whose marital status is divorced and admission year is less than 2112? | 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.marital_status = "DIVORCED" AND demographic.admityear < "2112" | Below are sql tables 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 marital status is divorced and admission year is less than 2112? ### Input: CREATE TABLE diagnoses (... |
Which attendance has a Score of 3-5? | CREATE TABLE table_14561 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | SELECT "Attendance" FROM table_14561 WHERE "Score" = '3-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: Which attendance has a Score of 3-5? ### Input: CREATE TABLE table_14561 (
"Date" text,
"Opponent" text,
"Score"... |
What is the total number of gold medals of the nation with 1 bronze and less than 1 total medal? | CREATE TABLE table_8304 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT COUNT("Gold") FROM table_8304 WHERE "Bronze" = '1' AND "Total" < '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of gold medals of the nation with 1 bronze and less than 1 total medal? ### Input: CREATE TABLE tab... |
If the race time is 2:00:33, what is the average speed? | CREATE TABLE table_2260452_1 (
average_speed__mph_ VARCHAR,
race_time VARCHAR
) | SELECT average_speed__mph_ FROM table_2260452_1 WHERE race_time = "2:00:33" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the race time is 2:00:33, what is the average speed? ### Input: CREATE TABLE table_2260452_1 (
average_speed__mph_ VA... |
Top Android Users in Egypt. | CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.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: Top Android Users in Egypt. ### Input: CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... |
give me the number of patients whose procedure icd9 code is 5771 and drug type is additive? | 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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "ADDITIVE" | Below are sql tables 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 procedure icd9 code is 5771 and drug type is additive? ### Input: CREATE TABLE diagnose... |
what is the number of patients who died in or before 2168 with lab test item id 51131? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2168.0" AND lab.itemid = "51131" | Below are sql tables 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 who died in or before 2168 with lab test item id 51131? ### Input: CREATE TABLE prescriptions... |
what is the organism name found in the first urine, catheter specimen test of patient 031-24513 in 03/last year? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND microlab.culturesite = 'urine, catheter specimen' AND DA... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the organism name found in the first urine, catheter specimen test of patient 031-24513 in 03/last year? ### Input: ... |
specify the admission type of patient with patient id 2560. | 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 demographic.admission_type FROM demographic WHERE demographic.subject_id = "2560" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the admission type of patient with patient id 2560. ### Input: CREATE TABLE lab (
subject_id text,
hadm_id t... |
how many patients with primary disease bowel obstruction died in or before 2174? | 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 WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" 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: how many patients with primary disease bowel obstruction died in or before 2174? ### Input: CREATE TABLE demographic (
s... |
calculate how many drugs patient 021-100763 is prescribed on this hospital visit. | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-100763' AND patient.hospitaldischargetime 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: calculate how many drugs patient 021-100763 is prescribed on this hospital visit. ### Input: CREATE TABLE diagnosis (
di... |
StackOverflow users in Denver, CO ordered by reputation. | CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | SELECT DisplayName, Reputation, Location FROM Users WHERE UPPER(Location) LIKE '%DENVER%' ORDER BY Reputation 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: StackOverflow users in Denver, CO ordered by reputation. ### Input: CREATE TABLE CloseReasonTypes (
Id number,
Name ... |
What is the class count for upper-level 17 -credit PATH classes in the Spring course catalog ? | 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) FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 17 AND course.department = 'PATH' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the class count for upper-level 17 -credit PATH classes in the Spring course catalog ? ### Input: CREATE TABLE cours... |
what is diagnoses long title of subject id 2560? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "2560" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is diagnoses long title of subject id 2560? ### Input: CREATE TABLE demographic (
subject_id text,
hadm_id text... |
which country had the highest number of medals ? | CREATE TABLE table_203_812 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | SELECT "nation" FROM table_203_812 ORDER BY "total" 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: which country had the highest number of medals ? ### Input: CREATE TABLE table_203_812 (
id number,
"rank" number,
... |
smoking or illicit substance abuse | CREATE TABLE table_train_174 (
"id" int,
"fasting_plasma_glucose_fpg" float,
"hemoglobin_a1c_hba1c" float,
"substance_dependence" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"allergy_to_insulin_lispro" bool,
"urine_albumin_to_creatinine_ratio_uacr" int,
"smoking" bool,
"NO... | SELECT * FROM table_train_174 WHERE smoking = 1 OR substance_dependence = 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: smoking or illicit substance abuse ### Input: CREATE TABLE table_train_174 (
"id" int,
"fasting_plasma_glucose_fpg" ... |
what is gender and lab test name of subject id 2560? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT demographic.gender, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is gender and lab test name of subject id 2560? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id t... |
when was the last time that patient 006-158689 had maximum mchc value in 11/last year? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | SELECT 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 = '006-158689')) AND lab.labname = 'mchc' AND DATETIME(lab.labresulttime, 'start of ye... | Below are sql tables 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 006-158689 had maximum mchc value in 11/last year? ### Input: CREATE TABLE diagnosis (
... |
What is the home team of the game with tie number 34? | CREATE TABLE table_name_76 (
home_team VARCHAR,
tie_no VARCHAR
) | SELECT home_team FROM table_name_76 WHERE tie_no = "34" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the home team of the game with tie number 34? ### Input: CREATE TABLE table_name_76 (
home_team VARCHAR,
tie... |
Date of april 9 had what score? | CREATE TABLE table_36525 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT "Score" FROM table_36525 WHERE "Date" = 'april 9' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Date of april 9 had what score? ### Input: CREATE TABLE table_36525 (
"Date" text,
"Opponent" text,
"Score" text... |
Count the number of captains that have each rank Visualize by bar chart, and order by the y-axis in ascending please. | CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank 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: Count the number of captains that have each rank Visualize by bar chart, and order by the y-axis in ascending please. ### In... |
What is the date for the home detroit and visitor was chicago? | CREATE TABLE table_74986 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | SELECT "Date" FROM table_74986 WHERE "Home" = 'detroit' AND "Visitor" = 'chicago' | Below are sql tables 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 for the home detroit and visitor was chicago? ### Input: CREATE TABLE table_74986 (
"Date" text,
"V... |
count the number of patients who have been treated with a creat esophagastr sphinc procedure in this year. | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_c... | 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 = 'creat esophagastr sphinc') AND DATETIME(procedures_i... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have been treated with a creat esophagastr sphinc procedure in this year. ### Input: CREATE... |
find a flight from TORONTO to SAN DIEGO with a layover in WASHINGTON on DL | CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | 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 WASHINGTON on DL ### Input: CREATE TABLE airport_service (
cit... |
had patient 021-227292 have a respiration greater than 21.0 today? | 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 COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-227292')) AND vitalperiodic.respiration > 21.0 AND NOT vitalperi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 021-227292 have a respiration greater than 21.0 today? ### Input: CREATE TABLE intakeoutput (
intakeoutputid... |
What is the player with a Span of 1998-2009? | CREATE TABLE table_32835 (
"Player" text,
"Span" text,
"Start" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text,
"Lost" text,
"Draw" text
) | SELECT "Player" FROM table_32835 WHERE "Span" = '1998-2009' | Below are sql tables 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 player with a Span of 1998-2009? ### Input: CREATE TABLE table_32835 (
"Player" text,
"Span" text,
"... |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter, list in desc by the Y. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarte... |
list all flights from BOSTON to SAN FRANCISCO on UA | 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 flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE aircraft (
aircraft_code varc... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list all flights from BOSTON to SAN FRANCISCO on UA ### Input: CREATE TABLE airport (
airport_code varchar,
airport_... |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of email and manager_id in a bar chart. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distri... |
What was the title for episode 2? | CREATE TABLE table_73188 (
"Series #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text
) | SELECT "Title" FROM table_73188 WHERE "Episode #" = '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 was the title for episode 2? ### Input: CREATE TABLE table_73188 (
"Series #" real,
"Episode #" real,
"Titl... |
What is the Country with a Launched that is april 3, 1990? | CREATE TABLE table_39892 (
"Channel" text,
"Country" text,
"Type" text,
"Launched" text,
"Description" text
) | SELECT "Country" FROM table_39892 WHERE "Launched" = 'april 3, 1990' | Below are sql tables 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 Country with a Launched that is april 3, 1990? ### Input: CREATE TABLE table_39892 (
"Channel" text,
"Co... |
provide the number of patients whose discharge location is snf and primary disease is hyperglycemia? | 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 WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA" | Below are sql tables 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 discharge location is snf and primary disease is hyperglycemia? ### Input: CREATE TABLE... |
count the number of people who were prescribed methadone hcl in the same hospital visit after having received a cont inv mec ven 96+ hrs procedure until 2102. | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numb... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... | Below are sql tables 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 people who were prescribed methadone hcl in the same hospital visit after having received a cont inv mec... |
What type of game had a 0:0 result? | CREATE TABLE table_37777 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | SELECT "Type of game" FROM table_37777 WHERE "Results\u00b9" = '0: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 type of game had a 0:0 result? ### Input: CREATE TABLE table_37777 (
"Date" text,
"City" text,
"Opponent" t... |
List the name of all products along with the number of complaints that they have received with a bar chart, and I want to rank by the x axis in ascending please. | CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE ... | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY product_name | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the name of all products along with the number of complaints that they have received with a bar chart, and I want to ra... |
in 2105 patient 006-47576 had been prescribed maalox? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medication... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576')) AND medication.drugname = 'maalox' AND STRFTIME('%y', medicat... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in 2105 patient 006-47576 had been prescribed maalox? ### Input: CREATE TABLE lab (
labid number,
patientunitstayid ... |
Please give me a bar chart to show the total number of singers who sang the top 3 most highly rated songs from different countries. | CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
languages varchar2(20),
releas... | SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T1.country ORDER BY T2.rating DESC LIMIT 3 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please give me a bar chart to show the total number of singers who sang the top 3 most highly rated songs from different cou... |
what's patient 021-35326's maximum value of anion gap until 04/2104? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | 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-35326')) AND lab.labname = 'anion gap' 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's patient 021-35326's maximum value of anion gap until 04/2104? ### Input: CREATE TABLE cost (
costid number,
u... |
when was the last time patient 027-178044 heartrate was measured greater than 86.0 until 01/18/2105. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178044')) AND vitalperiodic.heartrate > 86.0 AN... | Below are sql tables 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 patient 027-178044 heartrate was measured greater than 86.0 until 01/18/2105. ### Input: CREATE TABLE... |
Is a morning class available for HISTORY 348 ? | CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'HISTORY' AND course.number = 348 AND semester.semester = 'WN' AND semester.semester_id = 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: Is a morning class available for HISTORY 348 ? ### Input: CREATE TABLE course (
course_id int,
name varchar,
dep... |
What is the qual 1 with a 1:09.567 best? | CREATE TABLE table_44321 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | SELECT "Qual 1" FROM table_44321 WHERE "Best" = '1:09.567' | Below are sql tables 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 qual 1 with a 1:09.567 best? ### Input: CREATE TABLE table_44321 (
"Name" text,
"Team" text,
"Qual 1... |
What is the average crowd attendance for Collingwood? | CREATE TABLE table_78498 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT AVG("Crowd") FROM table_78498 WHERE "Home team" = 'collingwood' | Below are sql tables 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 crowd attendance for Collingwood? ### Input: CREATE TABLE table_78498 (
"Home team" text,
"Home ... |
For each director who directed more than one movie, for each movie title, bin their dates of release into Year interval and count the total number in each bucket using a line chart, sort year from high to low order. | CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year 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 each director who directed more than one movie, for each movie title, bin their dates of release into Year interval and ... |
find the cheapest one way fare from BOSTON to SAN FRANCISCO | CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | Below are sql tables 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 cheapest one way fare from BOSTON to SAN FRANCISCO ### Input: CREATE TABLE aircraft (
aircraft_code varchar,
... |
i need a flight from DENVER to PHILADELPHIA | CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
... | 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 need a flight from DENVER to PHILADELPHIA ### Input: CREATE TABLE restriction (
restriction_code text,
advance_pur... |
what were the five most frequent lab tests that patients had within the same hospital visit after receiving a parent infus nutrit sub? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i... | Below are sql tables 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 frequent lab tests that patients had within the same hospital visit after receiving a parent infus n... |
provide me with the top five most common intake until 2100? | 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 d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) <= '2100' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 5) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide me with the top five most common intake until 2100? ### Input: CREATE TABLE admissions (
row_id number,
subj... |
What is the name of the player in position lb and an overall of 128? | CREATE TABLE table_name_65 (
player VARCHAR,
position VARCHAR,
overall VARCHAR
) | SELECT player FROM table_name_65 WHERE position = "lb" AND overall = 128 | Below are sql tables 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 player in position lb and an overall of 128? ### Input: CREATE TABLE table_name_65 (
player VARC... |
what is the number of hours elapsed since the first time patient 007-15837 had a intake (ml)-gastrostomy/enterostomy gastrostomy 20 fr. luq intake on the current icu visit? | 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of hours elapsed since the first time patient 007-15837 had a intake (ml)-gastrostomy/enterostomy gastros... |
what are the different classes that an airline offers | 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_airport text,
arrival_time int,
arrival_airline text,
arrival_flig... | SELECT DISTINCT booking_class FROM class_of_service | Below are sql tables 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 different classes that an airline offers ### Input: CREATE TABLE city (
city_code varchar,
city_name va... |
On what date does Essendon play as the away team? | CREATE TABLE table_name_19 (
date VARCHAR,
away_team VARCHAR
) | SELECT date FROM table_name_19 WHERE away_team = "essendon" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date does Essendon play as the away team? ### Input: CREATE TABLE table_name_19 (
date VARCHAR,
away_team VA... |
what were the top three most common medications that followed during the same hospital visit for patients who were prescribed sodium phosphate 3 mmol/ml 15 ml inj since 2102? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'sodium phosphate... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top three most common medications that followed during the same hospital visit for patients who were prescribe... |
How many rounds were there an offensive tackle position? | CREATE TABLE table_name_66 (
round VARCHAR,
position VARCHAR
) | SELECT COUNT(round) FROM table_name_66 WHERE position = "offensive tackle" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many rounds were there an offensive tackle position? ### Input: CREATE TABLE table_name_66 (
round VARCHAR,
posi... |
Bar graph to show meter_100 from different meter 400 | 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_400, meter_100 FROM swimmer | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show meter_100 from different meter 400 ### Input: CREATE TABLE record (
ID int,
Result text,
Swimm... |
What is the type of video game Call of Destiny. | CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
... | SELECT gtype FROM video_games WHERE gname = "Call of Destiny" | Below are sql tables 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 type of video game Call of Destiny. ### Input: CREATE TABLE student (
stuid number,
lname text,
fnam... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a scatter chart about the correlation between employee_id and department_id . | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT EMPLOYEE_ID, DEPARTMENT_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 ... |
how many patients whose diagnoses short title is chordae tendinae rupture? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chordae tendinae rupture" | Below are sql tables 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 diagnoses short title is chordae tendinae rupture? ### Input: CREATE TABLE demographic (
subject... |
Name the score for september 25 | CREATE TABLE table_name_93 (
score VARCHAR,
date VARCHAR
) | SELECT score FROM table_name_93 WHERE date = "september 25" | Below are sql tables 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 score for september 25 ### Input: CREATE TABLE table_name_93 (
score VARCHAR,
date VARCHAR
) ### Response: ... |
Which round did the bout against Jonatas Novaes end in? | CREATE TABLE table_name_36 (
round VARCHAR,
opponent VARCHAR
) | SELECT round FROM table_name_36 WHERE opponent = "jonatas novaes" | Below are sql tables 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 round did the bout against Jonatas Novaes end in? ### Input: CREATE TABLE table_name_36 (
round VARCHAR,
oppon... |
what is average age of patients whose ethnicity is hispanic/latino - puerto rican and days of hospital stay is 15? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay = "15" | Below are sql tables 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 ethnicity is hispanic/latino - puerto rican and days of hospital stay is 15? ### Input... |
how much is the cheapest flight from DENVER to PITTSBURGH | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | Below are sql tables 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 is the cheapest flight from DENVER to PITTSBURGH ### Input: CREATE TABLE equipment_sequence (
aircraft_code_seq... |
Show the names and ids of tourist attractions that are visited at most once, I want to order by the y-axis from high to low. | CREATE TABLE Street_Markets (
Market_ID INTEGER,
Market_Details VARCHAR(255)
)
CREATE TABLE Visits (
Visit_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Tourist_ID INTEGER,
Visit_Date DATETIME,
Visit_Details VARCHAR(40)
)
CREATE TABLE Tourist_Attraction_Features (
Tourist_Attraction_ID IN... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_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 the names and ids of tourist attractions that are visited at most once, I want to order by the y-axis from high to low.... |
how many upper gi bleed primary disease patients died on or before 2154? | 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 WHERE demographic.diagnosis = "UPPER GI BLEED" AND demographic.dod_year <= "2154.0" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many upper gi bleed primary disease patients died on or before 2154? ### Input: CREATE TABLE demographic (
subject_i... |
How many points against when 41 is the tries for? | CREATE TABLE table_46096 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | SELECT "Points against" FROM table_46096 WHERE "Tries for" = '41' | Below are sql tables 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 points against when 41 is the tries for? ### Input: CREATE TABLE table_46096 (
"Club" text,
"Played" text,
... |
is there any results of the sputum microbiology test of patient 55281 in 12/2105? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2105-12' | Below are sql tables 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 there any results of the sputum microbiology test of patient 55281 in 12/2105? ### Input: CREATE TABLE labevents (
ro... |
Name the high assists for l 98 103 (ot) | CREATE TABLE table_72889 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | SELECT "High assists" FROM table_72889 WHERE "Score" = 'L 98–103 (OT)' | Below are sql tables 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 high assists for l 98 103 (ot) ### Input: CREATE TABLE table_72889 (
"Game" real,
"Date" text,
"Team" t... |
how many patients whose diagnoses icd9 code is 57450? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "57450" | Below are sql tables 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 diagnoses icd9 code is 57450? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
... |
How difficult on average are the PreMajor classes ? | CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
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,
tes... | SELECT AVG(workload) FROM program_course WHERE category LIKE '%PreMajor%' | Below are sql tables 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 difficult on average are the PreMajor classes ? ### Input: CREATE TABLE program_course (
program_id int,
course_... |
what number of patients have been diagnosed with late ef-hemplga side nos and lab test category is hematology? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Late ef-hemplga side NOS" AND lab."CATEGORY" = "Hematology" | Below are sql tables 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 number of patients have been diagnosed with late ef-hemplga side nos and lab test category is hematology? ### Input: CR... |
List the first name of the students who do not have any food type allergy and count them in a bar chart, I want to show X-axis in descending order. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT Fname, COUNT(Fname) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY Fname ORDER BY Fname 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 first name of the students who do not have any food type allergy and count them in a bar chart, I want to show X-ax... |
Show me a bar chart for what is the average price of the products for each category?, could you show from high to low by the y axis? | CREATE TABLE Customers (
customer_id INTEGER,
customer_type_code VARCHAR(20),
address_line_1 VARCHAR(80),
address_line_2 VARCHAR(80),
town_city VARCHAR(80),
state VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
pare... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart for what is the average price of the products for each category?, could you show from high to low by the... |
Visualize a bar chart about the distribution of All_Neutral and Team_ID , rank in ascending by the y-axis. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of All_Neutral and Team_ID , rank in ascending by the y-axis. ### Input: CREATE... |
For those employees who was hired before 2002-06-21, draw a scatter chart about the correlation between commission_pct and department_id . | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT COMMISSION_PCT, 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, draw a scatter chart about the correlation between commission_pct and d... |
count the number of patients whose insurance is private and diagnoses long title is fever presenting with conditions classified elsewhere? | 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.insurance = "Private" AND diagnoses.long_title = "Fever presenting with conditions classified elsewhere" | Below are sql tables 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 diagnoses long title is fever presenting with conditions classif... |
What is the largest silver number when the rank is smaller than 1? | CREATE TABLE table_name_92 (
silver INTEGER,
rank INTEGER
) | SELECT MAX(silver) FROM table_name_92 WHERE rank < 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the largest silver number when the rank is smaller than 1? ### Input: CREATE TABLE table_name_92 (
silver INTEGE... |
What is the number of 200 -level courses being offered in the Fall and Winter terms ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
... | 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 200 AND 200 + 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: What is the number of 200 -level courses being offered in the Fall and Winter terms ? ### Input: CREATE TABLE course_prerequ... |
Name the professors who teach 560 other than Prof. Joseph Doman . | CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 560 AND NOT instructor.name LIKE '%Joseph Doman%' AND offering_instructor.instructor_id = instructor.instructor_id AND offer... | Below are sql tables 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 professors who teach 560 other than Prof. Joseph Doman . ### Input: CREATE TABLE offering_instructor (
offering... |
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, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, order by the total number from low to high. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
A bar chart showing the number of different competition types, display by the y axis in descending. | CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_... | SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type ORDER BY COUNT(Competition_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: A bar chart showing the number of different competition types, display by the y axis in descending. ### Input: CREATE TABLE ... |
What are all the the participant ids, type code and details? | CREATE TABLE Participants (
Participant_ID VARCHAR,
Participant_Type_Code VARCHAR,
Participant_Details VARCHAR
) | SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all the the participant ids, type code and details? ### Input: CREATE TABLE Participants (
Participant_ID VARCH... |
when was the last time patient 14749 until 04/2104 had a base excess laboratory test? | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid num... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'base excess') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14749) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-04' 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 was the last time patient 14749 until 04/2104 had a base excess laboratory test? ### Input: CREATE TABLE d_items (
... |
What was the opposing team's score at the match that was played at Victoria Park? | CREATE TABLE table_4804 (
"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_4804 WHERE "Venue" = 'victoria park' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the opposing team's score at the match that was played at Victoria Park? ### Input: CREATE TABLE table_4804 (
"... |
What was the attendance at the Footscray away game? | CREATE TABLE table_51769 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Crowd" FROM table_51769 WHERE "Away team" = 'footscray' | Below are sql tables 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 attendance at the Footscray away game? ### Input: CREATE TABLE table_51769 (
"Home team" text,
"Home te... |
Compare the total number of captains with different classes using a bar graph, and display total number from low to high order. | CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY COUNT(Class) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Compare the total number of captains with different classes using a bar graph, and display total number from low to high ord... |
What is the name on the Republican ticket when the Socialist ticket was louis waldman? | CREATE TABLE table_39754 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"Socialist ticket" text,
"Workers ticket" text
) | SELECT "Republican ticket" FROM table_39754 WHERE "Socialist ticket" = 'louis waldman' | Below are sql tables 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 on the Republican ticket when the Socialist ticket was louis waldman? ### Input: CREATE TABLE table_39754 (... |
when did patient 86786 last receive until 8 months ago a prescription for hydrochlorothiazide? | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
r... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86786) AND prescriptions.drug = 'hydrochlorothiazide' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-8 month') ORDER BY prescriptions.startdate D... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 86786 last receive until 8 months ago a prescription for hydrochlorothiazide? ### Input: CREATE TABLE chart... |
count the number of people in the previous year diagnosed with dvrtcli colon w/o hmrhg. | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
r... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dvrtcli colon w/o hmrhg') AND DATETIME(diagnoses_icd.chart... | Below are sql tables 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 people in the previous year diagnosed with dvrtcli colon w/o hmrhg. ### Input: CREATE TABLE diagnoses_ic... |
Which general election had a vote swing of 1.84? | CREATE TABLE table_149330_1 (
general_election VARCHAR,
votes_swing VARCHAR
) | SELECT general_election FROM table_149330_1 WHERE votes_swing = "1.84" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which general election had a vote swing of 1.84? ### Input: CREATE TABLE table_149330_1 (
general_election VARCHAR,
... |
Who was the away team when the venue was Windy Hill? | CREATE TABLE table_54354 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team" FROM table_54354 WHERE "Venue" = 'windy hill' | Below are sql tables 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 when the venue was Windy Hill? ### Input: CREATE TABLE table_54354 (
"Home team" text,
"Home t... |
how much heparin sodium was prescribed on the last hospital visit for the last time to patient 14621? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14621 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'heparin sodium' ORDER BY prescriptions.startdate DE... | Below are sql tables 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 heparin sodium was prescribed on the last hospital visit for the last time to patient 14621? ### Input: CREATE TABL... |
What is the highest 1995 with a 1990 less than 36, a 1987 less than 1987, and a 2007 value greater than 107? | CREATE TABLE table_name_4 (
Id VARCHAR
) | SELECT MAX(1995) FROM table_name_4 WHERE 1990 > 36 AND 1987 < 1987 AND 2007 > 107 | Below are sql tables 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 1995 with a 1990 less than 36, a 1987 less than 1987, and a 2007 value greater than 107? ### Input: CREA... |
what is the number of patients whose year of birth is less than 2065? | 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 WHERE demographic.dob_year < "2065" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose year of birth is less than 2065? ### Input: CREATE TABLE prescriptions (
subject_id... |
bp ( blood pressure ) > 180 / 100 mmhg ( on one measurement ) | CREATE TABLE table_test_22 (
"id" int,
"ejection_fraction_ef" int,
"pregnancy_or_lactation" bool,
"child_pugh_class" string,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"leukocyte_count" int,
"hiv_infection" bool,
"left_ventricular_dysfunction" bool,
... | SELECT * FROM table_test_22 WHERE systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 100 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: bp ( blood pressure ) > 180 / 100 mmhg ( on one measurement ) ### Input: CREATE TABLE table_test_22 (
"id" int,
"eje... |
which team had the most wins ? | CREATE TABLE table_203_30 (
id number,
"place" number,
"team" text,
"played" number,
"won" number,
"draw" number,
"lost" number,
"goals\nscored" number,
"goals\nconceded" number,
"+/-" number,
"points" number
) | SELECT "team" FROM table_203_30 ORDER BY "won" 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: which team had the most wins ? ### Input: CREATE TABLE table_203_30 (
id number,
"place" number,
"team" text,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.