instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
What's the average interview with Preliminaries larger than 8.27, an Evening Gown of 8.85, and an Average smaller than 8.842? | CREATE TABLE table_name_65 (
interview INTEGER,
average VARCHAR,
preliminaries VARCHAR,
evening_gown VARCHAR
) | SELECT AVG(interview) FROM table_name_65 WHERE preliminaries > 8.27 AND evening_gown = 8.85 AND average < 8.842 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the average interview with Preliminaries larger than 8.27, an Evening Gown of 8.85, and an Average smaller than 8.842... |
Which circuit had a round larger than 5? | CREATE TABLE table_41116 (
"Round" real,
"Race name" text,
"Circuit" text,
"City/State" text,
"Date" text,
"Winner(s)" text,
"Team" text
) | SELECT "Circuit" FROM table_41116 WHERE "Round" > '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 circuit had a round larger than 5? ### Input: CREATE TABLE table_41116 (
"Round" real,
"Race name" text,
"... |
provide the number of patients whose admission type is elective and admission year is less than 2108? | 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.admission_type = "ELECTIVE" AND demographic.admityear < "2108" | Below are sql tables 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 admission year is less than 2108? ### Input: CREATE TABL... |
What was the loss of the Brewers game when the record was 46-48? | CREATE TABLE table_name_90 (
loss VARCHAR,
record VARCHAR
) | SELECT loss FROM table_name_90 WHERE record = "46-48" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the loss of the Brewers game when the record was 46-48? ### Input: CREATE TABLE table_name_90 (
loss VARCHAR,
... |
What shows for 2010 when 2011 is 1r at the US Open tournament? | CREATE TABLE table_name_35 (
tournament VARCHAR
) | SELECT 2010 FROM table_name_35 WHERE 2011 = "1r" AND tournament = "us open" | Below are sql tables 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 shows for 2010 when 2011 is 1r at the US Open tournament? ### Input: CREATE TABLE table_name_35 (
tournament VARCHA... |
Who is in class during 1995-96? | CREATE TABLE table_15315103_1 (
class_aAAAA VARCHAR,
school_year VARCHAR
) | SELECT class_aAAAA FROM table_15315103_1 WHERE school_year = "1995-96" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is in class during 1995-96? ### Input: CREATE TABLE table_15315103_1 (
class_aAAAA VARCHAR,
school_year VARCHAR
... |
Which Touchdowns is the lowest one that has Extra points smaller than 14, and a Player of white, and Points smaller than 5? | CREATE TABLE table_38932 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | SELECT MIN("Touchdowns") FROM table_38932 WHERE "Extra points" < '14' AND "Player" = 'white' AND "Points" < '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 Touchdowns is the lowest one that has Extra points smaller than 14, and a Player of white, and Points smaller than 5? ... |
calculate the length of the first hospital stay of patient 65883. | 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 STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 65883 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime 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: calculate the length of the first hospital stay of patient 65883. ### Input: CREATE TABLE admissions (
row_id number,
... |
Who was the home team when the record was 2-3? | CREATE TABLE table_50367 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | SELECT "Home" FROM table_50367 WHERE "Record" = '2-3' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team when the record was 2-3? ### Input: CREATE TABLE table_50367 (
"Date" text,
"Visitor" text,
... |
How many people attended the game with the home side scoring 11.13 (79)? | CREATE TABLE table_32373 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT COUNT("Crowd") FROM table_32373 WHERE "Home team score" = '11.13 (79)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people attended the game with the home side scoring 11.13 (79)? ### Input: CREATE TABLE table_32373 (
"Home tea... |
get me the diagnosis short title and procedure short title for the patient shawn green. | 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 diagnoses.short_title, procedures.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Shawn Green" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the diagnosis short title and procedure short title for the patient shawn green. ### Input: CREATE TABLE prescription... |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the amount of name , and group by attribute name, and show from high to low by the bars. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and t... |
show me flights from NEW YORK to MIAMI | CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_s... | 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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI... | Below are sql tables 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 flights from NEW YORK to MIAMI ### Input: CREATE TABLE time_interval (
period text,
begin_time int,
end_... |
Show the number of the countries that have managers of age above 50 or below 46, and could you show by the bars from low to high? | CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built tex... | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 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 the number of the countries that have managers of age above 50 or below 46, and could you show by the bars from low to ... |
How did he win with a time of 0:38? | CREATE TABLE table_4984 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | SELECT "Method" FROM table_4984 WHERE "Time" = '0:38' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How did he win with a time of 0:38? ### Input: CREATE TABLE table_4984 (
"Res." text,
"Record" text,
"Opponent" ... |
When the laps are 31 and the constructor was honda, what's the sum of all grid values? | CREATE TABLE table_51289 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT SUM("Grid") FROM table_51289 WHERE "Constructor" = 'honda' AND "Laps" = '31' | Below are sql tables 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 the laps are 31 and the constructor was honda, what's the sum of all grid values? ### Input: CREATE TABLE table_51289 (... |
find out the number of divorced patients who were admitted in hospital before 2112. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic 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: find out the number of divorced patients who were admitted in hospital before 2112. ### Input: CREATE TABLE procedures (
... |
what was the name of the last intake that patient 739 yesterday had? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id num... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739)) AND DATETIME(inputevents_cv.ch... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the last intake that patient 739 yesterday had? ### Input: CREATE TABLE labevents (
row_id number,
... |
show me all flights and fares from DENVER to SAN FRANCISCO | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPO... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all flights and fares from DENVER to SAN FRANCISCO ### Input: CREATE TABLE equipment_sequence (
aircraft_code_se... |
Top 250 Reputation Holder From India. | CREATE TABLE ReviewTaskStates (
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 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 250 | Below are sql tables 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 250 Reputation Holder From India. ### Input: CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descripti... |
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the change of manager_id over hire_date, and could you show in desc by the x axis? | 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 HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the c... |
show all flights PHILADELPHIA to DALLAS | CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
... | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '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: show all flights PHILADELPHIA to DALLAS ### Input: CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
... |
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, show by the total number in descending. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_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 did not have any job in the past, return a bar chart about the distribution of job_id and the averag... |
A line chart for giveing me the number of the dates when the max temperature was higher than 85. | CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY 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: A line chart for giveing me the number of the dates when the max temperature was higher than 85. ### Input: CREATE TABLE sta... |
give me the number of patients whose drug name is bisoprolol fumarate? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "bisoprolol fumarate" | Below are sql tables 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 drug name is bisoprolol fumarate? ### Input: CREATE TABLE lab (
subject_id text,
... |
What is the number for the international with 669 domestic earlier than 2005? | CREATE TABLE table_name_78 (
international INTEGER,
domestic VARCHAR,
year VARCHAR
) | SELECT AVG(international) FROM table_name_78 WHERE domestic = 669 AND year < 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 number for the international with 669 domestic earlier than 2005? ### Input: CREATE TABLE table_name_78 (
in... |
give me the number of patients with diagnoses icd9 code e8799 who have been ordered other body fluid lab test. | 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.icd9_code = "E8799" AND lab.fluid = "Other Body Fluid" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients with diagnoses icd9 code e8799 who have been ordered other body fluid lab test. ### Input: CR... |
Who were the candidates in the Kentucky 4 voting district? | CREATE TABLE table_1342218_17 (
candidates VARCHAR,
district VARCHAR
) | SELECT candidates FROM table_1342218_17 WHERE district = "Kentucky 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: Who were the candidates in the Kentucky 4 voting district? ### Input: CREATE TABLE table_1342218_17 (
candidates VARCHAR... |
What's the attendance for the game held on January 2, 2005? | CREATE TABLE table_32710 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" text
) | SELECT "Attendance" FROM table_32710 WHERE "Date" = 'january 2, 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's the attendance for the game held on January 2, 2005? ### Input: CREATE TABLE table_32710 (
"Week" real,
"Date... |
what is the id and trade name of the medicines can interact with at least 3 enzymes?, and I want to show by the x axis from high to low. | CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_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: what is the id and trade name of the medicines can interact with at least 3 enzymes?, and I want to show by the x axis from ... |
What is the losses for the 5 matches? | CREATE TABLE table_name_40 (
losses VARCHAR,
matches VARCHAR
) | SELECT losses FROM table_name_40 WHERE matches = "5" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the losses for the 5 matches? ### Input: CREATE TABLE table_name_40 (
losses VARCHAR,
matches VARCHAR
) ### ... |
Who was the team with the smallest crowd at the Princes Park venue? | CREATE TABLE table_name_73 (
crowd INTEGER,
venue VARCHAR
) | SELECT MIN(crowd) FROM table_name_73 WHERE venue = "princes park" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the team with the smallest crowd at the Princes Park venue? ### Input: CREATE TABLE table_name_73 (
crowd INTEGE... |
what is last weight of patient 013-29301 during their first hospital visit. | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-29301' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY 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: what is last weight of patient 013-29301 during their first hospital visit. ### Input: CREATE TABLE patient (
uniquepid ... |
How many losses has more than 59 goals against and more than 17 position? | CREATE TABLE table_name_32 (
losses INTEGER,
goals_against VARCHAR,
position VARCHAR
) | SELECT MIN(losses) FROM table_name_32 WHERE goals_against > 59 AND position > 17 | Below are sql tables 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 losses has more than 59 goals against and more than 17 position? ### Input: CREATE TABLE table_name_32 (
losses... |
provide the number of patients whose ethnicity is white and age is less than 49? | 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.ethnicity = "WHITE" AND demographic.age < "49" | Below are sql tables 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 ethnicity is white and age is less than 49? ### Input: CREATE TABLE demographic (
s... |
was there any calcium gluconate or lisinopril or iso-osmotic dextrose ordered until 4 years ago for patient 41132? | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 41132) AND prescriptions.drug IN ('calcium gluconate', 'lisinopril', 'iso-osmotic dextrose') AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 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: was there any calcium gluconate or lisinopril or iso-osmotic dextrose ordered until 4 years ago for patient 41132? ### Input... |
Find the number of professors for each first name with a bar chart, I want to show from high to low by the bar. | CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NU... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY EMP_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: Find the number of professors for each first name with a bar chart, I want to show from high to low by the bar. ### Input: C... |
when did patient 94956 last receive a microbiology test in 06/2105? | CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94956) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2105-06' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 94956 last receive a microbiology test in 06/2105? ### Input: CREATE TABLE icustays (
row_id number,
... |
What was the date when the attendance was 73,529? | CREATE TABLE table_name_89 (
date VARCHAR,
attendance VARCHAR
) | SELECT date FROM table_name_89 WHERE attendance = "73,529" | Below are sql tables 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 date when the attendance was 73,529? ### Input: CREATE TABLE table_name_89 (
date VARCHAR,
attendance V... |
What is the Type with a Location with justus lipsius building, brussels, and a Year of 2012, and a President with herman van rompuy (1st term), and a Date with 23 may? | CREATE TABLE table_54599 (
"Year" real,
"Date" text,
"Type" text,
"President" text,
"Location" text
) | SELECT "Type" FROM table_54599 WHERE "Location" = 'justus lipsius building, brussels' AND "Year" = '2012' AND "President" = 'herman van rompuy (1st term)' AND "Date" = '23 may' | Below are sql tables 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 with a Location with justus lipsius building, brussels, and a Year of 2012, and a President with herman van... |
what flights go from SAN FRANCISCO to DENVER on MONDAY | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,... | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AND fl... | Below are sql tables 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 flights go from SAN FRANCISCO to DENVER on MONDAY ### Input: CREATE TABLE city (
city_code varchar,
city_name v... |
What score has 34-19-6 as the record? | CREATE TABLE table_34098 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | SELECT "Score" FROM table_34098 WHERE "Record" = '34-19-6' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What score has 34-19-6 as the record? ### Input: CREATE TABLE table_34098 (
"Game" real,
"February" real,
"Oppon... |
How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field goals? | CREATE TABLE table_34975 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | SELECT AVG("Extra points") FROM table_34975 WHERE "Touchdowns" < '2' AND "Player" = 'herrnstein' 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: How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field goals? ### Input: CREA... |
Up vs Down votes by day of week of Accepted Answer. | CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | SELECT TIME_TO_STR(p.CreationDate, 'WEEKDA%Y') AS Day, COUNT(*) AS Amount, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS FLOAT) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS F... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Up vs Down votes by day of week of Accepted Answer. ### Input: CREATE TABLE PostHistoryTypes (
Id number,
Name text
... |
At what venue did the match where the home team scored 8.6 (54) take place? | CREATE TABLE table_33293 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_33293 WHERE "Home team score" = '8.6 (54)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: At what venue did the match where the home team scored 8.6 (54) take place? ### Input: CREATE TABLE table_33293 (
"Home ... |
What Player's Score is 69-71-69=208? | CREATE TABLE table_name_88 (
player VARCHAR,
score VARCHAR
) | SELECT player FROM table_name_88 WHERE score = 69 - 71 - 69 = 208 | Below are sql tables 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 Player's Score is 69-71-69=208? ### Input: CREATE TABLE table_name_88 (
player VARCHAR,
score VARCHAR
) ### Res... |
Which Monarch has succession unclear 1100-1103 as his Status? | CREATE TABLE table_58172 (
"Heir" text,
"Status" text,
"Relationship to Monarch" text,
"Became heir" text,
"Reason" text,
"Ceased to be heir" text,
"Monarch" text
) | SELECT "Monarch" FROM table_58172 WHERE "Status" = 'succession unclear 1100-1103' | Below are sql tables 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 Monarch has succession unclear 1100-1103 as his Status? ### Input: CREATE TABLE table_58172 (
"Heir" text,
"St... |
What away team played Footscray? | CREATE TABLE table_74722 (
"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_74722 WHERE "Home 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 away team played Footscray? ### Input: CREATE TABLE table_74722 (
"Home team" text,
"Home team score" text,
... |
how many patients whose primary disease is brain mass;intracranial hemorrhage and lab test fluid is joint fluid? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Joint Fluid" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose primary disease is brain mass;intracranial hemorrhage and lab test fluid is joint fluid? ### Input: ... |
count the number of patients whose were born before year 2110 and procedure icd9 code is 4105. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2110" AND procedures.icd9_code = "4105" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose were born before year 2110 and procedure icd9 code is 4105. ### Input: CREATE TABLE proce... |
what is the number of patients whose gender is m and lab test name is protein/creatinine ratio? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Protein/Creatinine Ratio" | Below are sql tables 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 gender is m and lab test name is protein/creatinine ratio? ### Input: CREATE TABLE diag... |
give me the number of patients admitted before 2194 who were diagnosed with dysphagia nec. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.short_title = "Dysphagia NEC" | Below are sql tables 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 admitted before 2194 who were diagnosed with dysphagia nec. ### Input: CREATE TABLE lab (
... |
What venue hosted the 2003 event? | CREATE TABLE table_name_91 (
venue VARCHAR,
year VARCHAR
) | SELECT venue FROM table_name_91 WHERE year = 2003 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What venue hosted the 2003 event? ### Input: CREATE TABLE table_name_91 (
venue VARCHAR,
year VARCHAR
) ### Response... |
What is the average attendance at week earlier than 6 on October 14, 2001? | CREATE TABLE table_50686 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" real
) | SELECT AVG("Attendance") FROM table_50686 WHERE "Week" < '6' AND "Date" = 'october 14, 2001' | Below are sql tables 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 at week earlier than 6 on October 14, 2001? ### Input: CREATE TABLE table_50686 (
"Week" ... |
find me the age and status of death of patient alice nixon. | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.age, demographic.expire_flag FROM demographic WHERE demographic.name = "Alice Nixon" | Below are sql tables 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 me the age and status of death of patient alice nixon. ### Input: CREATE TABLE demographic (
subject_id text,
h... |
give me the number of patients whose marital status is divorced and lab test name is alkaline phosphatase? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Alkaline Phosphatase" | Below are sql tables 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 divorced and lab test name is alkaline phosphatase? ### Input: CREATE... |
What's the lowest Gold if the Rank is over 4 but the Total is less than 1? | CREATE TABLE table_name_88 (
gold INTEGER,
rank VARCHAR,
total VARCHAR
) | SELECT MIN(gold) FROM table_name_88 WHERE rank > 4 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's the lowest Gold if the Rank is over 4 but the Total is less than 1? ### Input: CREATE TABLE table_name_88 (
gold ... |
Show me about the distribution of All_Home and the amount of All_Home , and group by attribute All_Home in a bar chart, and could you order by the y-axis from low to high? | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Home and the amount of All_Home , and group by attribute All_Home in a bar chart, and ... |
What film did abdelatif hwidar direct that was in the short film 2007 prix uip category? | CREATE TABLE table_name_93 (
film VARCHAR,
category VARCHAR,
director_s_ VARCHAR
) | SELECT film FROM table_name_93 WHERE category = "short film 2007 prix uip" AND director_s_ = "abdelatif hwidar" | Below are sql tables 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 film did abdelatif hwidar direct that was in the short film 2007 prix uip category? ### Input: CREATE TABLE table_name_... |
is there ground transportation available at the PHOENIX airport | CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHOENIX' AND ground_service.city_code = city.city_code | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is there ground transportation available at the PHOENIX airport ### Input: CREATE TABLE dual_carrier (
main_airline varc... |
What was the name of the leader whose term ended in 2013? | CREATE TABLE table_name_49 (
name VARCHAR,
term_end VARCHAR
) | SELECT name FROM table_name_49 WHERE term_end = "2013" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the name of the leader whose term ended in 2013? ### Input: CREATE TABLE table_name_49 (
name VARCHAR,
term... |
How many courses for each course description? Show me a bar chart. | CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE STUDENT (
STU_NUM... | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many courses for each course description? Show me a bar chart. ### Input: CREATE TABLE DEPARTMENT (
DEPT_CODE varcha... |
how many patients are born before 2090 and tested with lab item id 51108? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2090" AND lab.itemid = "51108" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are born before 2090 and tested with lab item id 51108? ### Input: CREATE TABLE procedures (
subject_i... |
how many prescriptions were issued for hydrocerin in 2105? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'hydrocerin' AND STRFTIME('%y', prescriptions.startdate) = '2105' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many prescriptions were issued for hydrocerin in 2105? ### Input: CREATE TABLE diagnoses_icd (
row_id number,
su... |
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the name , and group by attribute name, and could you sort from low to high by the y axis? | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.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: For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the ... |
what are the new drugs prescribed to patient 31854 today compared to that yesterday? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions 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 are the new drugs prescribed to patient 31854 today compared to that yesterday? ### Input: CREATE TABLE d_icd_procedure... |
Name the Height metres / ft of Years with tallest of 1098 1310? | CREATE TABLE table_59049 (
"Name" text,
"Location" text,
"Years as tallest" text,
"Height metres / ft" text,
"Floors" text
) | SELECT "Height metres / ft" FROM table_59049 WHERE "Years as tallest" = '1098–1310' | Below are sql tables 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 Height metres / ft of Years with tallest of 1098 1310? ### Input: CREATE TABLE table_59049 (
"Name" text,
"... |
Give me a histogram for what are the names and average salaries for departments with average salary higher than 42000?, and could you order by the Y-axis from high to low? | CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2)... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a histogram for what are the names and average salaries for departments with average salary higher than 42000?, and ... |
Find Team_Name and All_Games_Percent , and visualize them by a bar chart, display by the x axis in asc. | 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 Team_Name, All_Games_Percent FROM basketball_match ORDER BY Team_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: Find Team_Name and All_Games_Percent , and visualize them by a bar chart, display by the x axis in asc. ### Input: CREATE TA... |
In the game on or before week 9, who was the opponent when the attendance was 61,626? | CREATE TABLE table_name_49 (
opponent VARCHAR,
week VARCHAR,
attendance VARCHAR
) | SELECT opponent FROM table_name_49 WHERE week < 9 AND attendance = "61,626" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the game on or before week 9, who was the opponent when the attendance was 61,626? ### Input: CREATE TABLE table_name_49 ... |
provide the number of patients whose insurance is medicare and lab test name is hemoglobin? | 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.insurance = "Medicare" AND lab.label = "Hemoglobin" | Below are sql tables 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 insurance is medicare and lab test name is hemoglobin? ### Input: CREATE TABLE demograp... |
tell me the total amount of tpn d11.0 that patient 30826 has taken on this month/27. | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE out... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | Below are sql tables 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 total amount of tpn d11.0 that patient 30826 has taken on this month/27. ### Input: CREATE TABLE prescriptions (... |
When the VFL played Brunswick Street Oval what was the home team score? | CREATE TABLE table_4544 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team score" FROM table_4544 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: When the VFL played Brunswick Street Oval what was the home team score? ### Input: CREATE TABLE table_4544 (
"Home team"... |
Which Athlete has a Run 1 larger than 57.37, and a Run 4 smaller than 59.05, and a Run 3 of 58.08? | CREATE TABLE table_12403 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real,
"Run 4" real,
"Total" text
) | SELECT "Athlete" FROM table_12403 WHERE "Run 1" > '57.37' AND "Run 4" < '59.05' AND "Run 3" = '58.08' | Below are sql tables 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 Athlete has a Run 1 larger than 57.37, and a Run 4 smaller than 59.05, and a Run 3 of 58.08? ### Input: CREATE TABLE t... |
I want to see trend of the number of date of notes by date of notes, order X in descending order. | CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Behavior_Incident (
inc... | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes ORDER BY date_of_notes 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: I want to see trend of the number of date of notes by date of notes, order X in descending order. ### Input: CREATE TABLE Te... |
What are the names and seatings for all tracks opened after 2000, ordered by seating. Show the proportion. | CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
) | SELECT Name, Seating FROM track WHERE Year_Opened > 2000 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names and seatings for all tracks opened after 2000, ordered by seating. Show the proportion. ### Input: CREATE... |
On what date was a match held at MCG? | CREATE TABLE table_name_50 (
date VARCHAR,
venue VARCHAR
) | SELECT date FROM table_name_50 WHERE venue = "mcg" | Below are sql tables 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 was a match held at MCG? ### Input: CREATE TABLE table_name_50 (
date VARCHAR,
venue VARCHAR
) ### Resp... |
A bar chart for what are the number of the names of photos taken with the lens brand 'Sigma' or 'Olympus'?, and sort by the names in descending please. | CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id ... | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY T1.name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the names of photos taken with the lens brand 'Sigma' or 'Olympus'?, and sort by the ... |
What brakes for the 4-speed automatic gearbox? | CREATE TABLE table_27285 (
"Model" text,
"Power" text,
"Torque" text,
"Gearbox" text,
"Weight" text,
"Seating" text,
"Brakes" text,
"Wheels" text,
"Tyres" text
) | SELECT "Brakes" FROM table_27285 WHERE "Gearbox" = '4-speed automatic' | Below are sql tables 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 brakes for the 4-speed automatic gearbox? ### Input: CREATE TABLE table_27285 (
"Model" text,
"Power" text,
... |
Which opponent is friendly and played on 15-08-2012? | CREATE TABLE table_name_38 (
opponent VARCHAR,
competition VARCHAR,
date VARCHAR
) | SELECT opponent FROM table_name_38 WHERE competition = "friendly" AND date = "15-08-2012" | Below are sql tables 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 is friendly and played on 15-08-2012? ### Input: CREATE TABLE table_name_38 (
opponent VARCHAR,
compe... |
What is the lowest laps that Vittorio Iannuzzo completed? | CREATE TABLE table_47537 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | SELECT MIN("Laps") FROM table_47537 WHERE "Rider" = 'vittorio iannuzzo' | Below are sql tables 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 that Vittorio Iannuzzo completed? ### Input: CREATE TABLE table_47537 (
"Rider" text,
"Bike"... |
count the number of patients whose admission type is urgent and drug name is diphenhydramine hcl? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "DiphenhydrAMINE HCl" | Below are sql tables 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 type is urgent and drug name is diphenhydramine hcl? ### Input: CREATE TABLE pr... |
what specimen test has patient 031-22988 received for the first time until 03/2104? | 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 cost (
costid num... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2104... | Below are sql tables 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 specimen test has patient 031-22988 received for the first time until 03/2104? ### Input: CREATE TABLE vitalperiodic (
... |
previous enrollment in this study. | CREATE TABLE table_train_73 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"in_another_study" bool,
"systolic_blood_pressure_sbp" int,
"skin_mottling_score" int,
"glasgow_come_score_gcs" int,
"mr_scanning" bool,
"age" float,
"NOUSE" float
) | SELECT * FROM table_train_73 WHERE in_another_study = 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: previous enrollment in this study. ### Input: CREATE TABLE table_train_73 (
"id" int,
"gender" string,
"pregnanc... |
What are the distinct last names of the students who have class president votes? | CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
stuid number,
... | SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.class_president_vote | Below are sql tables 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 distinct last names of the students who have class president votes? ### Input: CREATE TABLE voting_record (
... |
How many millions of U.S. viewers watched the episode with the production code of 3AJN01? | CREATE TABLE table_25757 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | SELECT "U.S. viewers (millions)" FROM table_25757 WHERE "Production code" = '3AJN01' | Below are sql tables 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 millions of U.S. viewers watched the episode with the production code of 3AJN01? ### Input: CREATE TABLE table_2575... |
provide the number of patients whose age is less than 83 and diagnoses long title is personal history of malignant neoplasm of gastrointestinal tract, unspecified? | 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.age < "83" AND diagnoses.long_title = "Personal history of malignant neoplasm of gastrointestinal tract, unspecified" | Below are sql tables 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 age is less than 83 and diagnoses long title is personal history of malignant neoplasm ... |
until 2 years ago what are the four most frequent microbiological tests given to patients within 2 months after receiving infectious disease consultation? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'infectious disease consultation' AND DATETIM... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 2 years ago what are the four most frequent microbiological tests given to patients within 2 months after receiving in... |
What's the bronze medal count for Rank 33 when the silver count was less than 2 and the total was more than 4? | CREATE TABLE table_64195 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MAX("Bronze") FROM table_64195 WHERE "Silver" < '2' AND "Total" > '4' AND "Rank" = '33' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the bronze medal count for Rank 33 when the silver count was less than 2 and the total was more than 4? ### Input: CR... |
count the number of patients who are dead after being diagnosed with subdural hemorrhage within 2 months until 2104. | 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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | Below are sql tables 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 are dead after being diagnosed with subdural hemorrhage within 2 months until 2104. ### Inp... |
show the flights from DENVER to SAN FRANCISCO | CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minu... | 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 = 'SAN FRA... | Below are sql tables 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 flights from DENVER to SAN FRANCISCO ### Input: CREATE TABLE ground_service (
city_code text,
airport_code ... |
Return the name of rooms and the number of reservations made for each of the rooms to draw a bar chart, display from low to high by the Y-axis. | CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the name of rooms and the number of reservations made for each of the rooms to draw a bar chart, display from low to ... |
give me the number of newborn patients whose lab test fluid is ascites. | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.fluid = "Ascites" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of newborn patients whose lab test fluid is ascites. ### Input: CREATE TABLE procedures (
subject_id ... |
What was the score of the game with the Broadview Hawks as the home team? | CREATE TABLE table_43140 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | SELECT "Score" FROM table_43140 WHERE "Home" = 'broadview hawks' | Below are sql tables 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 of the game with the Broadview Hawks as the home team? ### Input: CREATE TABLE table_43140 (
"Date" t... |
how many patients whose year of death is less than or equal to 2186 and item id is 50805? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2186.0" AND lab.itemid = "50805" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose year of death is less than or equal to 2186 and item id is 50805? ### Input: CREATE TABLE lab (
... |
What was the highest crowd at the venue MCG? | CREATE TABLE table_name_97 (
crowd INTEGER,
venue VARCHAR
) | SELECT MAX(crowd) FROM table_name_97 WHERE venue = "mcg" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the highest crowd at the venue MCG? ### Input: CREATE TABLE table_name_97 (
crowd INTEGER,
venue VARCHAR
) ... |
If the equation is 6 9 + 6 9 + 6, what is the 3rd throw? | CREATE TABLE table_21440 (
"1st throw" real,
"2nd throw" real,
"3rd throw" real,
"Equation" text,
"Result" real
) | SELECT MAX("3rd throw") FROM table_21440 WHERE "Equation" = '6 × 9² + 6 × 9 + 6' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the equation is 6 9 + 6 9 + 6, what is the 3rd throw? ### Input: CREATE TABLE table_21440 (
"1st throw" real,
"2n... |
what is the drug patient 64136 was prescribed for within 2 days after being diagnosed with chr pulmon heart dis nec when they visited the hospital last time? | CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id nu... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 64136 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chr pu... | Below are sql tables 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 drug patient 64136 was prescribed for within 2 days after being diagnosed with chr pulmon heart dis nec when the... |
Draw a bar chart of description versus the number of description, and could you sort by the y axis in asc? | CREATE TABLE match (
Round real,
Location text,
Country text,
Date text,
Fastest_Qualifying text,
Winning_Pilot text,
Winning_Aircraft text
)
CREATE TABLE airport_aircraft (
ID int,
Airport_ID int,
Aircraft_ID int
)
CREATE TABLE airport (
Airport_ID int,
Airport_Name te... | SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description ORDER BY COUNT(Description) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of description versus the number of description, and could you sort by the y axis in asc? ### Input: CREATE... |
which country scored the most points ? | CREATE TABLE table_203_803 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"place" number,
"points" number
) | SELECT "country" FROM table_203_803 ORDER BY "points" 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 scored the most points ? ### Input: CREATE TABLE table_203_803 (
id number,
"draw" number,
"countr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.