instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
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, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart. | CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID... | SELECT HIRE_DATE, AVG(EMPLOYEE_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 ... |
what is the highest events when the cuts made is less than 34, the top-25 is less than 5 and the top-10 is more than 1? | CREATE TABLE table_name_72 (
events INTEGER,
top_10 VARCHAR,
cuts_made VARCHAR,
top_25 VARCHAR
) | SELECT MAX(events) FROM table_name_72 WHERE cuts_made < 34 AND top_25 < 5 AND top_10 > 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 highest events when the cuts made is less than 34, the top-25 is less than 5 and the top-10 is more than 1? ### ... |
count the number of patients whose death status is 0 and diagnoses short title is angioneurotic edema? | 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 WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Angioneurotic edema" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose death status is 0 and diagnoses short title is angioneurotic edema? ### Input: CREATE TAB... |
For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart, and show by the total number in ascending. | 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 JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the average of manager_id ... |
What is the bronze value associated with ranks over 5? | CREATE TABLE table_15485 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT "Bronze" FROM table_15485 WHERE "Rank" > '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 bronze value associated with ranks over 5? ### Input: CREATE TABLE table_15485 (
"Rank" real,
"Nation" t... |
A bar chart about what are the destinations and number of flights to each one?, could you show Y in ascending order? | CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what are the destinations and number of flights to each one?, could you show Y in ascending order? ### Inp... |
when was the first time that patient 007-849 on the last intensive care unit visit had systemicmean less than 215.0? | 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 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 = '007-849') AND NOT patient.unitdischargetime 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: when was the first time that patient 007-849 on the last intensive care unit visit had systemicmean less than 215.0? ### Inp... |
Create a bar chart showing the total number across denomination, I want to sort by the Denomination from high to low. | CREATE TABLE school (
School_ID int,
School text,
Location text,
Enrollment real,
Founded real,
Denomination text,
Boys_or_Girls text,
Day_or_Boarding text,
Year_Entered_Competition real,
School_Colors text
)
CREATE TABLE player (
Player_ID int,
Player text,
Team tex... | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY Denomination 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: Create a bar chart showing the total number across denomination, I want to sort by the Denomination from high to low. ### In... |
For those records from the products and each product's manufacturer, show me about the correlation between price and code , and group by attribute founder in a scatter chart. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the correlation between price and code , ... |
What date did the Mountaineers score 27 points and their opponent scored more that 7? | CREATE TABLE table_name_82 (
date VARCHAR,
points_against VARCHAR,
points_for VARCHAR
) | SELECT date FROM table_name_82 WHERE points_against > 7 AND points_for = 27 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date did the Mountaineers score 27 points and their opponent scored more that 7? ### Input: CREATE TABLE table_name_82 ... |
What is the home team score when the away team was Hawthorn? | CREATE TABLE table_name_1 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team AS score FROM table_name_1 WHERE away_team = "hawthorn" | Below are sql tables 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 score when the away team was Hawthorn? ### Input: CREATE TABLE table_name_1 (
home_team VARCHAR,
... |
Which record happened on the date of May 7? | CREATE TABLE table_71677 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | SELECT "Record" FROM table_71677 WHERE "Date" = 'may 7' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which record happened on the date of May 7? ### Input: CREATE TABLE table_71677 (
"Date" text,
"Opponent" text,
... |
For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of price , and group by attribute founder in a bar chart. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the distribution of founder and the avera... |
What was the Indians' record during the game that had 31,467 in attendance? | CREATE TABLE table_name_82 (
record VARCHAR,
attendance VARCHAR
) | SELECT record FROM table_name_82 WHERE attendance = "31,467" | Below are sql tables 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 Indians' record during the game that had 31,467 in attendance? ### Input: CREATE TABLE table_name_82 (
reco... |
What team was played on november 24? | CREATE TABLE table_23211041_5 (
team VARCHAR,
date VARCHAR
) | SELECT team FROM table_23211041_5 WHERE date = "November 24" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team was played on november 24? ### Input: CREATE TABLE table_23211041_5 (
team VARCHAR,
date VARCHAR
) ### Res... |
which driver has the least amount of points ? | CREATE TABLE table_203_76 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | SELECT "driver" FROM table_203_76 ORDER BY "points" 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 driver has the least amount of points ? ### Input: CREATE TABLE table_203_76 (
id number,
"pos" text,
"no"... |
i mean what was patient 031-23724's first mch value in 08/last year? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | SELECT 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 = '031-23724')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of 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: i mean what was patient 031-23724's first mch value in 08/last year? ### Input: CREATE TABLE lab (
labid number,
pat... |
How many patients with brain mass intracranial hemorrhage as their primary disease had an abnormal lab test status? | 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 prescription... | 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.flag = "abnormal" | Below are sql tables 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 brain mass intracranial hemorrhage as their primary disease had an abnormal lab test status? ### Inpu... |
Show me the total number by origin in a histogram | CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CR... | SELECT origin, COUNT(*) FROM train GROUP BY origin | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me the total number by origin in a histogram ### Input: CREATE TABLE weekly_weather (
station_id int,
day_of_we... |
Return a bar chart on how many events are there for each party?, and could you order by the x axis from high to low? | CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
Region_name tex... | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on how many events are there for each party?, and could you order by the x axis from high to low? ### Inp... |
how many female patients were admitted to the hospital before year 2200? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2200" | Below are sql tables 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 female patients were admitted to the hospital before year 2200? ### Input: CREATE TABLE procedures (
subject_id... |
what would be patient 022-164523's yearly minimum weight since 2105? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-164523') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) >= '2105' GROUP BY STRFTIME('%y', patient.unitadmit... | Below are sql tables 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 would be patient 022-164523's yearly minimum weight since 2105? ### Input: CREATE TABLE treatment (
treatmentid num... |
Give the minimum product price for each product type in a bar chart, and could you rank x axis in ascending order please? | CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(10),
customer_code VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(25... | SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_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: Give the minimum product price for each product type in a bar chart, and could you rank x axis in ascending order please? ##... |
what is the number of patients on iv bolus route of drug administration who are diagnosed with pressure ulcer of hip? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Pressure ulcer, hip" AND prescriptions.route = "IV BOLUS" | Below are sql tables 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 on iv bolus route of drug administration who are diagnosed with pressure ulcer of hip? ### In... |
For each branch id, what are the names of the branches that were registered after 2015 Visualize by bar chart, could you order the total number in asc order? | CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE purchase (
Member_ID int,
Branch_ID text,
Year text,
Total_pounds real
)
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_I... | SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID 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: For each branch id, what are the names of the branches that were registered after 2015 Visualize by bar chart, could you ord... |
What is the sum of Pick #, when Position is Guard, and when Round is greater than 2? | CREATE TABLE table_47100 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
) | SELECT SUM("Pick #") FROM table_47100 WHERE "Position" = 'guard' AND "Round" > '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 sum of Pick #, when Position is Guard, and when Round is greater than 2? ### Input: CREATE TABLE table_47100 (
... |
what are the top four most common medications that followed during the same month for those patients who were prescribed propranolol hcl? | 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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'propranolol hcl') AS t1 JOIN (SELECT admissions.subject_id, presc... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top four most common medications that followed during the same month for those patients who were prescribed pro... |
did patient 013-28507 have a therapeutic antibacterials - directed antibacterial therapy on their current hospital 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 treatment (
treat... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatme... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 013-28507 have a therapeutic antibacterials - directed antibacterial therapy on their current hospital visit. ##... |
Give me the comparison about meter_100 over the meter_400 , could you order in asc by the x axis? | CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_400 | Below are sql tables 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 comparison about meter_100 over the meter_400 , could you order in asc by the x axis? ### Input: CREATE TABLE re... |
Top 100 stackoverflow user in Bangladesh. | CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
... | SELECT ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS "#", Users.Id AS "user_link", Users.Age, Users.Location, Users.Reputation, Users.Views, Users.UpVotes, Users.DownVotes, (SELECT COUNT(*) FROM Posts AS PQ WHERE PostTypeId = 1 AND PQ.OwnerUserId = Users.Id) AS "questions", (SELECT COUNT(*) FROM Posts AS PA WHE... | Below are sql tables 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 100 stackoverflow user in Bangladesh. ### Input: CREATE TABLE PostNotices (
Id number,
PostId number,
PostNo... |
Scatter plot to show school id on x axis and acc_percent on y axis. | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT School_ID, 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: Scatter plot to show school id on x axis and acc_percent on y axis. ### Input: CREATE TABLE university (
School_ID int,
... |
information on a flight from SAN FRANCISCO to PHILADELPHIA | CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
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... | 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: information on a flight from SAN FRANCISCO to PHILADELPHIA ### Input: CREATE TABLE compartment_class (
compartment varch... |
Draw a bar chart for how many students are affected by each allergy type?, show by the bar in descending. | CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
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 INTEGE... | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart for how many students are affected by each allergy type?, show by the bar in descending. ### Input: CREATE ... |
Draw a bar chart about the distribution of meter_600 and meter_100 , and could you display by the Y in desc? | 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 swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of meter_600 and meter_100 , and could you display by the Y in desc? ### Input: CREA... |
how many patients with government insurance had the procedure icd9 code as 3727? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "3727" | Below are sql tables 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 government insurance had the procedure icd9 code as 3727? ### Input: CREATE TABLE prescriptions (
... |
What is the lowest amount of draws club ud l rida, which has less than 41 goals, has? | CREATE TABLE table_7860 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | SELECT MIN("Draws") FROM table_7860 WHERE "Club" = 'ud lérida' AND "Goals 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: What is the lowest amount of draws club ud l rida, which has less than 41 goals, has? ### Input: CREATE TABLE table_7860 (
... |
What are the dates that have the 5 highest cloud cover rates and what are the rates? | CREATE TABLE weather (
date text,
max_temperature_f number,
mean_temperature_f number,
min_temperature_f number,
max_dew_point_f number,
mean_dew_point_f number,
min_dew_point_f number,
max_humidity number,
mean_humidity number,
min_humidity number,
max_sea_level_pressure_inc... | SELECT date, cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the dates that have the 5 highest cloud cover rates and what are the rates? ### Input: CREATE TABLE weather (
d... |
Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, and show by the Y-axis from low to high. | CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) | Below are sql tables 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 comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, and show by the... |
Who had the highest assists on November 4 | CREATE TABLE table_17281 (
"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_17281 WHERE "Date" = 'November 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 had the highest assists on November 4 ### Input: CREATE TABLE table_17281 (
"Game" real,
"Date" text,
"Team"... |
What was the record on July 28? | CREATE TABLE table_11939 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT "Record" FROM table_11939 WHERE "Date" = 'july 28' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record on July 28? ### Input: CREATE TABLE table_11939 (
"Date" text,
"Opponent" text,
"Score" text... |
What is the original airdate of the episode that had 8.23 million viewers? | CREATE TABLE table_3482 (
"Episode #" real,
"Series #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original airdate" text,
"Viewers (in millions)" text
) | SELECT "Original airdate" FROM table_3482 WHERE "Viewers (in millions)" = '8.23' | Below are sql tables 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 original airdate of the episode that had 8.23 million viewers? ### Input: CREATE TABLE table_3482 (
"Episode... |
Top 100 programmers in Marrakesh, Morocco. | CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation FROM Users WHERE LOWER(Location) LIKE '%marrakesh%' ORDER BY Reputation DESC LIMIT 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: Top 100 programmers in Marrakesh, Morocco. ### Input: CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepte... |
when was the first time patient 1561 had their temperature c (calc) measured or taken on this month/30? | 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 prescriptions (
row_id number,
subject_id number,
h... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatu... | Below are sql tables 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 first time patient 1561 had their temperature c (calc) measured or taken on this month/30? ### Input: CREATE TA... |
How many black/african american patients were born before the year 2074? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2074" | Below are sql tables 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 black/african american patients were born before the year 2074? ### Input: CREATE TABLE diagnoses (
subject_id ... |
what are the top five most prescribed drugs for patients who were prescribed sulfasalazine_ at the same time during this year? | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
sub... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'sulfasalazine_' AND DATETIME(prescriptions.startdate, 'start of y... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top five most prescribed drugs for patients who were prescribed sulfasalazine_ at the same time during this yea... |
what is the number of patients whose discharge location is home and age is less than 62? | 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.discharge_location = "HOME" AND demographic.age < "62" | Below are sql tables 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 discharge location is home and age is less than 62? ### Input: CREATE TABLE procedures ... |
How many patients are diagnosed with icd9 code 7098 and have abnormal lab test status? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "7098" AND lab.flag = "abnormal" | Below are sql tables 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 diagnosed with icd9 code 7098 and have abnormal lab test status? ### Input: CREATE TABLE demographic (... |
What is the amount of silver for rank 11 having less than 0 gold? | CREATE TABLE table_name_21 (
silver INTEGER,
rank VARCHAR,
gold VARCHAR
) | SELECT MIN(silver) FROM table_name_21 WHERE rank = "11" AND gold < 0 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the amount of silver for rank 11 having less than 0 gold? ### Input: CREATE TABLE table_name_21 (
silver INTEGER... |
give me the number of patients whose diagnoses short title is ac on chr syst hrt fail 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Ac on chr syst hrt fail" 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: give me the number of patients whose diagnoses short title is ac on chr syst hrt fail and lab test fluid is joint fluid? ###... |
how much does it cost for patient 27591's hospital stay until 2102. | 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 SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27591) AND STRFTIME('%y', cost.chargetime) <= '2102' | Below are sql tables 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 does it cost for patient 27591's hospital stay until 2102. ### Input: CREATE TABLE admissions (
row_id number,
... |
What is the date where the home team scores 8.7 (55)? | CREATE TABLE table_32441 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_32441 WHERE "Home team score" = '8.7 (55)' | Below are sql tables 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 where the home team scores 8.7 (55)? ### Input: CREATE TABLE table_32441 (
"Home team" text,
"Home ... |
which patients have diagnoses icd9 code 5680? | 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 diagnoses.icd9_code = "5680" | Below are sql tables 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 patients have diagnoses icd9 code 5680? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
... |
Where was the game that the attendance was 24,694? | CREATE TABLE table_name_99 (
game INTEGER,
attendance VARCHAR
) | SELECT MIN(game) FROM table_name_99 WHERE attendance = 24 OFFSET 694 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the game that the attendance was 24,694? ### Input: CREATE TABLE table_name_99 (
game INTEGER,
attendance ... |
how many patients diagnosed with short title sec neuroendo tumor-bone have blood gas lab test category? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Sec neuroendo tumor-bone" AND lab."CATEGORY" = "Blood Gas" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients diagnosed with short title sec neuroendo tumor-bone have blood gas lab test category? ### Input: CREATE TA... |
calculate the total number of unmarried patients. | 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.marital_status = "SINGLE" | Below are sql tables 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 total number of unmarried patients. ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm_id t... |
tell me the change in weight in patient 20066 second measured on the first hospital visit compared to the first value measured on the first hospital visit? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20066 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev... | Below are sql tables 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 change in weight in patient 20066 second measured on the first hospital visit compared to the first value measur... |
Count the lowest Year which has gas explosion, Colliery of tylorstown colliery, and a Death toll larger than 57? | CREATE TABLE table_name_15 (
year INTEGER,
death_toll VARCHAR,
cause VARCHAR,
colliery VARCHAR
) | SELECT MIN(year) FROM table_name_15 WHERE cause = "gas explosion" AND colliery = "tylorstown colliery" AND death_toll > 57 | Below are sql tables 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 lowest Year which has gas explosion, Colliery of tylorstown colliery, and a Death toll larger than 57? ### Input: ... |
show me flights from DENVER to BOSTON on tuesday | CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
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,
round_trip_req... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 22 AND date_day.month_number = 3 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: show me flights from DENVER to BOSTON on tuesday ### Input: CREATE TABLE time_interval (
period text,
begin_time int... |
Bar chart, the-axis is the state, and the Y axis is each state's the smallest enrollment, show in descending by the y axis. | CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
) | SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart, the-axis is the state, and the Y axis is each state's the smallest enrollment, show in descending by the y axis. ... |
How many items are listed for U.S. viewers for episode number 5 in the series? | CREATE TABLE table_27910411_1 (
us_viewers__millions_ VARCHAR,
no_in_series VARCHAR
) | SELECT COUNT(us_viewers__millions_) FROM table_27910411_1 WHERE no_in_series = 5 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many items are listed for U.S. viewers for episode number 5 in the series? ### Input: CREATE TABLE table_27910411_1 (
... |
Draw a bar chart of description versus the number of description, show by the x-axis in descending. | CREATE TABLE airport_aircraft (
ID int,
Airport_ID int,
Aircraft_ID int
)
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 text,
International_Passengers real,
Domestic_Passengers real,
Transit_Passengers real,
Aircraft_Movements... | SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description ORDER BY Description DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of description versus the number of description, show by the x-axis in descending. ### Input: CREATE TABLE ... |
in this year has patient 035-2057 have had any allergy? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2057')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURREN... | Below are sql tables 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 this year has patient 035-2057 have had any allergy? ### Input: CREATE TABLE intakeoutput (
intakeoutputid number,
... |
What player's hometown is Abilene, Texas? | CREATE TABLE table_17084 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | SELECT "Player" FROM table_17084 WHERE "Hometown" = 'Abilene, Texas' | Below are sql tables 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 hometown is Abilene, Texas? ### Input: CREATE TABLE table_17084 (
"Player" text,
"Position" text,
... |
how many patients whose days of hospital stay is greater than 5 and diagnoses icd9 code is 40391? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.icd9_code = "40391" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose days of hospital stay is greater than 5 and diagnoses icd9 code is 40391? ### Input: CREATE TABLE la... |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the sum of revenue , and group by attribute headquarter. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | Below are sql tables 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, visualize a bar chart about the distribution of headqua... |
what name was the drug that patient 7375 had been prescribed two times until 08/2101? | CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7375) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-08' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1... | Below are sql tables 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 name was the drug that patient 7375 had been prescribed two times until 08/2101? ### Input: CREATE TABLE prescriptions ... |
Name the eps for net profit being 39.2 | CREATE TABLE table_22241 (
"Year to April" real,
"Revenue (\u00a3million)" text,
"EBIT (\u00a3m)" text,
"Net profit (\u00a3m)" text,
"Earnings per share (p)" text
) | SELECT "Earnings per share (p)" FROM table_22241 WHERE "Net profit (\u00a3m)" = '39.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: Name the eps for net profit being 39.2 ### Input: CREATE TABLE table_22241 (
"Year to April" real,
"Revenue (\u00a3m... |
what is the drug that patient 021-93953 was prescribed with in the same day after having undergone mechanical ventilation in their last hospital encounter? | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-93953' AND NOT patient.hospit... | Below are sql tables 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 that patient 021-93953 was prescribed with in the same day after having undergone mechanical ventilation in... |
provide the number of patients whose discharge location is disch-tran to psych hosp and procedure short title is exc/des hrt les,endovasc? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Exc/des hrt les,endovasc" | Below are sql tables 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 disch-tran to psych hosp and procedure short title is exc/des hrt... |
specify the lab test abnormal status of patient jerry deberry | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry" | Below are sql tables 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 lab test abnormal status of patient jerry deberry ### Input: CREATE TABLE lab (
subject_id text,
hadm_id... |
Which departments have the top 3 highest number of students? Show the department name and number of students with 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 STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB d... | SELECT DEPT_NAME, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) 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: Which departments have the top 3 highest number of students? Show the department name and number of students with a bar char... |
A bar chart for what are the number of the dates of the assessment notes?, could you sort by the total number from high to low? | CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
)
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_s... | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes ORDER BY COUNT(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: A bar chart for what are the number of the dates of the assessment notes?, could you sort by the total number from high to l... |
what does a lab alt (sgpt) test cost? | 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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'alt (sgpt)') | Below are sql tables 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 does a lab alt (sgpt) test cost? ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitsta... |
What is Label, when Region is Japan? | CREATE TABLE table_name_40 (
label VARCHAR,
region VARCHAR
) | SELECT label FROM table_name_40 WHERE region = "japan" | Below are sql tables 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 Label, when Region is Japan? ### Input: CREATE TABLE table_name_40 (
label VARCHAR,
region VARCHAR
) ### Res... |
How many points are there for 63 tries against? | CREATE TABLE table_17625749_3 (
points_for VARCHAR,
tries_against VARCHAR
) | SELECT points_for FROM table_17625749_3 WHERE tries_against = "63" | Below are sql tables 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 are there for 63 tries against? ### Input: CREATE TABLE table_17625749_3 (
points_for VARCHAR,
tries... |
What Outcome happened on a Date that was 20 november 2011? | CREATE TABLE table_35999 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | SELECT "Outcome" FROM table_35999 WHERE "Date" = '20 november 2011' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Outcome happened on a Date that was 20 november 2011? ### Input: CREATE TABLE table_35999 (
"Outcome" text,
"Da... |
what changes have been made to the arterial bp [diastolic] of patient 18877 second measured on the last icu visit compared to the first value measured on the last icu visit? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 ti... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18877) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | Below are sql tables 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 changes have been made to the arterial bp [diastolic] of patient 18877 second measured on the last icu visit compared t... |
since 2 years ago, what were the top five most frequent microbiological tests ordered for patients in the same month after monitor vital capacities for deterioration? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | SELECT 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 = 'monitor vital capacities for deterioration' ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 2 years ago, what were the top five most frequent microbiological tests ordered for patients in the same month after m... |
Return a bar graph for the name of the school that has the smallest enrollment in each state, could you order by the x axis in asc please? | CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar graph for the name of the school that has the smallest enrollment in each state, could you order by the x axis ... |
provide the number of patients whose admission location is clinic referral/premature and diagnoses short title is chr tot occlus cor artry? | 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Chr tot occlus cor artry" | Below are sql tables 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 location is clinic referral/premature and diagnoses short title is chr tot oc... |
What is the lowest swimsuit for a contestant with an average of 9.125? | CREATE TABLE table_10367 (
"State" text,
"Swimsuit" real,
"Interview" real,
"Evening Gown" real,
"Average" real
) | SELECT MIN("Swimsuit") FROM table_10367 WHERE "Average" = '9.125' | Below are sql tables 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 swimsuit for a contestant with an average of 9.125? ### Input: CREATE TABLE table_10367 (
"State" tex... |
the previous year, what are the top five frequently ordered prescriptions for patients 50s? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: the previous year, what are the top five frequently ordered prescriptions for patients 50s? ### Input: CREATE TABLE patient ... |
For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between code and revenue , and group by attribute name. | 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.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY 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: For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between... |
For those records from the products and each product's manufacturer, show me about the correlation between code and price , and group by attribute founder in a scatter chart. | 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.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, show me about the correlation between code and price , ... |
count the number of patients whose lab test abnormal status is delta and lab test name is c-reactive protein? | 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 lab.flag = "delta" AND lab.label = "C-Reactive Protein" | Below are sql tables 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 lab test abnormal status is delta and lab test name is c-reactive protein? ### Input: CRE... |
Show the first name and last name for all the instructors. | CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE partic... | SELECT fname, lname FROM faculty WHERE rank = "Instructor" | Below are sql tables 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 first name and last name for all the instructors. ### Input: CREATE TABLE faculty_participates_in (
facid numbe... |
Search posts with string after some date. | CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | SELECT Id AS "post_link" FROM Posts WHERE CreationDate >= '##datefrom##' AND Body LIKE '%##string##%' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Search posts with string after some date. ### Input: CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Descri... |
provide the number of patients whose admission type is urgent and diagnosis icd9 code is 42840. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.icd9_code = "42840" | Below are sql tables 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 urgent and diagnosis icd9 code is 42840. ### Input: CREATE TABLE proc... |
Which title had the production code 1ACX04? | CREATE TABLE table_14724369_1 (
title VARCHAR,
production_code VARCHAR
) | SELECT title FROM table_14724369_1 WHERE production_code = "1ACX04" | Below are sql tables 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 title had the production code 1ACX04? ### Input: CREATE TABLE table_14724369_1 (
title VARCHAR,
production_cod... |
Where was the match with a score of 18.6 (114) - 21.14 (140)? | CREATE TABLE table_31667 (
"Year" text,
"Competition" text,
"Opponent" text,
"Score" text,
"Venue" text
) | SELECT "Venue" FROM table_31667 WHERE "Score" = '18.6 (114) - 21.14 (140)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the match with a score of 18.6 (114) - 21.14 (140)? ### Input: CREATE TABLE table_31667 (
"Year" text,
"Co... |
How many companies that are not headquartered in the United States for each main industry? Show me a pie chart. | CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry | Below are sql tables 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 companies that are not headquartered in the United States for each main industry? Show me a pie chart. ### Input: C... |
What are the names and distances for all airplanes Visualize by bar chart, list by the X-axis in asc. | CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREAT... | SELECT name, distance FROM aircraft ORDER BY 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: What are the names and distances for all airplanes Visualize by bar chart, list by the X-axis in asc. ### Input: CREATE TABL... |
What is the score for the Dec 11 game? | CREATE TABLE table_39365 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
) | SELECT "Score" FROM table_39365 WHERE "December" = '11' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score for the Dec 11 game? ### Input: CREATE TABLE table_39365 (
"Game" real,
"December" real,
"Oppo... |
Which Gold is the lowest one that has a Bronze of 14, and a Total larger than 42? | CREATE TABLE table_35627 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Gold") FROM table_35627 WHERE "Bronze" = '14' AND "Total" > '42' | Below are sql tables 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 Gold is the lowest one that has a Bronze of 14, and a Total larger than 42? ### Input: CREATE TABLE table_35627 (
... |
What is every score when the date is January 2? | CREATE TABLE table_28220778_21 (
score VARCHAR,
date VARCHAR
) | SELECT score FROM table_28220778_21 WHERE date = "January 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 every score when the date is January 2? ### Input: CREATE TABLE table_28220778_21 (
score VARCHAR,
date VARC... |
has patient 87232 got admitted to the hospital since 3 years ago? | CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 87232 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 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: has patient 87232 got admitted to the hospital since 3 years ago? ### Input: CREATE TABLE inputevents_cv (
row_id number... |
what is the number of patients whose admission type is emergency and drug code is d545ns1000? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "D545NS1000" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is emergency and drug code is d545ns1000? ### Input: CREATE TABLE diagno... |
provide the number of patients whose diagnoses long title is hypoxemia and drug route is iv? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Hypoxemia" AND prescriptions.route = "IV" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose diagnoses long title is hypoxemia and drug route is iv? ### Input: CREATE TABLE demogra... |
What is the attendance for the game against the Kansas City Chiefs earlier than week 13? | CREATE TABLE table_78612 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT AVG("Attendance") FROM table_78612 WHERE "Opponent" = 'kansas city chiefs' AND "Week" < '13' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the attendance for the game against the Kansas City Chiefs earlier than week 13? ### Input: CREATE TABLE table_78612... |
How many documents are there of each type. Plot them as pie chart. | CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Documen... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_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: How many documents are there of each type. Plot them as pie chart. ### Input: CREATE TABLE Documents_with_Expenses (
Doc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.