instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
List the name of ships whose nationality is not 'United States'. | CREATE TABLE ship (
Name VARCHAR,
Nationality VARCHAR
) | SELECT Name FROM ship WHERE Nationality <> "United States" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the name of ships whose nationality is not 'United States'. ### Input: CREATE TABLE ship (
Name VARCHAR,
Nation... |
What 's 501 's schedule next semester ? | CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program (
program_id int,
name varchar,
... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe... | Below are sql tables 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 501 's schedule next semester ? ### Input: CREATE TABLE instructor (
instructor_id int,
name varchar,
un... |
indicate the monthly maximum dose of volume (ml) milrinone that patient 007-4322 has received since 1038 days ago. | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patie... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322')) AND intakeoutput.celllabel = 'volume... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the monthly maximum dose of volume (ml) milrinone that patient 007-4322 has received since 1038 days ago. ### Input... |
Who directed the eposide that was watched by 1.95 million US viewers? | CREATE TABLE table_28980 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | SELECT "Directed by" FROM table_28980 WHERE "U.S. viewers (millions)" = '1.95' | Below are sql tables 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 directed the eposide that was watched by 1.95 million US viewers? ### Input: CREATE TABLE table_28980 (
"No. in seri... |
For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and order from high to low by the y axis. | 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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the sum of d... |
what were the top five most common output events a year before? | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top five most common output events a year before? ### Input: CREATE TABLE transfers (
row_id number,
s... |
what drug was patient 62298 prescribed for within the same hospital visit after being diagnosed with hyperlipidemia nec/nos since 04/2103? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title 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... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 62298 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s... | Below are sql tables 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 drug was patient 62298 prescribed for within the same hospital visit after being diagnosed with hyperlipidemia nec/nos ... |
What is the set 3 when the total is 78 92? | CREATE TABLE table_58654 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | SELECT "Set 3" FROM table_58654 WHERE "Total" = '78–92' | Below are sql tables 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 set 3 when the total is 78 92? ### Input: CREATE TABLE table_58654 (
"Date" text,
"Time" text,
"Scor... |
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart, and list in desc by the total number of manager id please. | 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, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(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 was hired before 2002-06-21, show me about the distribution of hire_date and the sum of manager_id b... |
when did patient 26286 get prescription for labetalol hcl and sodium chloride 3% (hypertonic) for the last time at the same time in this month? | 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,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
s... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'labetalol hcl' AND admissions.subject_id = 26286 AND DATETIME(prescriptions.startdate, 'start of month') = 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: when did patient 26286 get prescription for labetalol hcl and sodium chloride 3% (hypertonic) for the last time at the same ... |
Show the number of games for each away team in a bar chart, I want to display by the Y-axis in desc. | CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
... | SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY COUNT(Away_team) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of games for each away team in a bar chart, I want to display by the Y-axis in desc. ### Input: CREATE TABLE... |
What was the Attendance in Week 10? | CREATE TABLE table_47144 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | SELECT "Attendance" FROM table_47144 WHERE "Week" = '10' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Attendance in Week 10? ### Input: CREATE TABLE table_47144 (
"Week" real,
"Date" text,
"Opponent" t... |
Visualize a bar chart for how many players are from each country? | CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_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: Visualize a bar chart for how many players are from each country? ### Input: CREATE TABLE player (
Player_ID int,
Pl... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the email , and I want to list by the total number from high to low. | 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 EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY 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: For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a... |
how many days since first time patient 55360 was diagnosed with hepatic encephalopathy during this hospital encounter? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hepatic encephalopathy') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admis... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days since first time patient 55360 was diagnosed with hepatic encephalopathy during this hospital encounter? ### I... |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of email and salary , I want to show by the X-axis from high to low please. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL 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 bar chart shows the di... |
What is the rank when the total is less than 1? | CREATE TABLE table_59803 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Rank") FROM table_59803 WHERE "Total" < '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rank when the total is less than 1? ### Input: CREATE TABLE table_59803 (
"Rank" real,
"Nation" text,
... |
how many patients whose year of birth is less than 2200 and item id is 50882? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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.dob_year < "2200" AND lab.itemid = "50882" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose year of birth is less than 2200 and item id is 50882? ### Input: CREATE TABLE prescriptions (
su... |
What percentage of users were using Internet Explorer during the period in which 2.1% were using mobile browsers? | CREATE TABLE table_name_66 (
internet_explorer VARCHAR,
mobile VARCHAR
) | SELECT internet_explorer FROM table_name_66 WHERE mobile = "2.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 percentage of users were using Internet Explorer during the period in which 2.1% were using mobile browsers? ### Input:... |
Show the average share count of transactions each each investor, ordered by average share count. | CREATE TABLE TRANSACTIONS (
investor_id VARCHAR,
share_count INTEGER
) | SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY AVG(share_count) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the average share count of transactions each each investor, ordered by average share count. ### Input: CREATE TABLE TRA... |
Bin all date of transactions into the YEAR interval, and sum the share count of each bin Return the result using a line chart, and I want to display from high to low by the x axis please. | CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
... | SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction 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: Bin all date of transactions into the YEAR interval, and sum the share count of each bin Return the result using a line char... |
since 2103, what are the top three most frequent drugs prescribed to patients within 2 months after the prescription of sodium chloride 0.9% 250 ml pb? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'sodium chloride 0.9% 250 ml pb' AND STRFTIME('%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: since 2103, what are the top three most frequent drugs prescribed to patients within 2 months after the prescription of sodi... |
Which location includes Sakakita BS? | CREATE TABLE table_name_18 (
location__all_in_nagano__ VARCHAR,
name VARCHAR
) | SELECT location__all_in_nagano__ FROM table_name_18 WHERE name = "sakakita bs" | Below are sql tables 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 location includes Sakakita BS? ### Input: CREATE TABLE table_name_18 (
location__all_in_nagano__ VARCHAR,
name... |
Number of questions in Stack Overflow. | CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT COUNT(*) AS count FROM Posts WHERE PostTypeId = 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: Number of questions in Stack Overflow. ### Input: CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... |
Who is the incumbent who was first elected before 2002 from the maryland 3 district? | CREATE TABLE table_name_41 (
incumbent VARCHAR,
first_elected VARCHAR,
district VARCHAR
) | SELECT incumbent FROM table_name_41 WHERE first_elected < 2002 AND district = "maryland 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 is the incumbent who was first elected before 2002 from the maryland 3 district? ### Input: CREATE TABLE table_name_41 (... |
Which order deals with the most items? Return the order id. | CREATE TABLE products (
product_id number,
product_name text,
product_details text
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_number number,
shipment_tracking_number text,
shipment_date time,
other_shipment_details text
)
CREATE TABLE shipment_items (
... | SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) 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 order deals with the most items? Return the order id. ### Input: CREATE TABLE products (
product_id number,
pr... |
What is the admission location and number of days of hospital stay for subject id 55094? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.days_stay, demographic.admission_location FROM demographic WHERE demographic.subject_id = "55094" | Below are sql tables 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 admission location and number of days of hospital stay for subject id 55094? ### Input: CREATE TABLE prescriptio... |
What is the highest earnings of a player with more than 19 wins? | CREATE TABLE table_37575 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Wins" real
) | SELECT MAX("Earnings ( $ )") FROM table_37575 WHERE "Wins" > '19' | Below are sql tables 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 earnings of a player with more than 19 wins? ### Input: CREATE TABLE table_37575 (
"Rank" real,
... |
Who replaced the manager on Team Cfr Cluj? | CREATE TABLE table_1607 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | SELECT "Replaced by" FROM table_1607 WHERE "Team" = 'CFR Cluj' | Below are sql tables 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 replaced the manager on Team Cfr Cluj? ### Input: CREATE TABLE table_1607 (
"Team" text,
"Outgoing manager" text... |
how many total opponents are there ? | CREATE TABLE table_204_441 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" number,
"scorers" text
) | SELECT COUNT("opponent") FROM table_204_441 | Below are sql tables 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 total opponents are there ? ### Input: CREATE TABLE table_204_441 (
id number,
"date" text,
"opponent" ... |
What was the top crowd when the away team scored 11.14 (80)? | CREATE TABLE table_52950 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT MAX("Crowd") FROM table_52950 WHERE "Away team score" = '11.14 (80)' | Below are sql tables 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 top crowd when the away team scored 11.14 (80)? ### Input: CREATE TABLE table_52950 (
"Home team" text,
... |
how many patients are of black/haitian ethnicity and used the main drug type? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug_type = "MAIN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are of black/haitian ethnicity and used the main drug type? ### Input: CREATE TABLE lab (
subject_id t... |
Show the number of departments created in different year and bin creation time by year in a line chart, and sort Creation in ascending order please. | CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | SELECT Creation, COUNT(Creation) FROM department ORDER BY Creation | Below are sql tables 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 departments created in different year and bin creation time by year in a line chart, and sort Creation in... |
Who had high assists when they played against San Antonio? | CREATE TABLE table_72134 (
"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_72134 WHERE "Team" = 'San Antonio' | Below are sql tables 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 high assists when they played against San Antonio? ### Input: CREATE TABLE table_72134 (
"Game" real,
"Date"... |
mention the admission time and diagnosis icd9 code of patient with patient id 74032. | 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.admittime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "74032" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mention the admission time and diagnosis icd9 code of patient with patient id 74032. ### Input: CREATE TABLE demographic (
... |
What is the brigade when Al-Hamra ('arab al-hamra) shows for name? | CREATE TABLE table_name_63 (
brigade VARCHAR,
name VARCHAR
) | SELECT brigade FROM table_name_63 WHERE name = "al-hamra ('arab al-hamra)" | Below are sql tables 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 brigade when Al-Hamra ('arab al-hamra) shows for name? ### Input: CREATE TABLE table_name_63 (
brigade VARCH... |
how many patients have undergone anticonvulsants - phenytoin this year? | 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(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'anticonvulsants - phenytoin' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients have undergone anticonvulsants - phenytoin this year? ### Input: CREATE TABLE vitalperiodic (
vitalper... |
flights from LGA to JFK | 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 flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE AIRPORT_0.airport_code = 'LGA' AND AIRPORT_1.airport_code = 'JFK' AND flight.from_airport = AIRPORT_0.airport_code AND flight.to_airport = AIRPORT_1.airport_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: flights from LGA to JFK ### Input: CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopo... |
What are the title and maximum price of each film, and show from high to low by the Title. | CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the title and maximum price of each film, and show from high to low by the Title. ### Input: CREATE TABLE schedule ... |
What district was a republican first elected in 2000? | CREATE TABLE table_62254 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | SELECT "District" FROM table_62254 WHERE "First elected" = '2000' AND "Party" = 'republican' | Below are sql tables 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 district was a republican first elected in 2000? ### Input: CREATE TABLE table_62254 (
"District" text,
"Incumb... |
How many hispanic or latino-puerto rican patients are less than 64 years of age? | 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.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.age < "64" | Below are sql tables 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 hispanic or latino-puerto rican patients are less than 64 years of age? ### Input: CREATE TABLE procedures (
su... |
Draw a bar chart of affiliation versus sum enrollment, and I want to display y axis from low to high order please. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment) | Below are sql tables 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 affiliation versus sum enrollment, and I want to display y axis from low to high order please. ### Input... |
Visualize a pie chart with what are the hometowns of gymnasts and the corresponding number of gymnasts? | CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height real,
Hometown text
)
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real... | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a pie chart with what are the hometowns of gymnasts and the corresponding number of gymnasts? ### Input: CREATE TA... |
What college did the #22 overall draft pick attend? | CREATE TABLE table_44399 (
"Rnd." text,
"Pick #" real,
"NFL team" text,
"Pos." text,
"College" text,
"Conf." text
) | SELECT "College" FROM table_44399 WHERE "Pick #" = '22' | Below are sql tables 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 college did the #22 overall draft pick attend? ### Input: CREATE TABLE table_44399 (
"Rnd." text,
"Pick #" real... |
Language trends (# of Questions per Month). | CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Language trends (# of Questions per Month). ### Input: CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId ... |
how many patients whose diagnoses icd9 code is 80126 and drug route is inhalation? | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "80126" AND prescriptions.route = "INHALATION" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose diagnoses icd9 code is 80126 and drug route is inhalation? ### Input: CREATE TABLE diagnoses (
s... |
please list the FRIDAY night flights from ST. PAUL to KANSAS CITY | CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_... | 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 ((((flight.departure_time <= 2400 AND flight.departure_time >= 1800) AND days.day_name = 'FRIDAY' AND flight.flight_days = days.days_code) OR ((flight.depa... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: please list the FRIDAY night flights from ST. PAUL to KANSAS CITY ### Input: CREATE TABLE time_interval (
period text,
... |
how many patients whose primary disease is liver transplant and admission year is less than 2170? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.admityear < "2170" | Below are sql tables 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 liver transplant and admission year is less than 2170? ### Input: CREATE TABLE de... |
Where was the game held where North Melbourne was the away team? | CREATE TABLE table_name_89 (
venue VARCHAR,
away_team VARCHAR
) | SELECT venue FROM table_name_89 WHERE away_team = "north melbourne" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the game held where North Melbourne was the away team? ### Input: CREATE TABLE table_name_89 (
venue VARCHAR,
... |
What MDE classes are offered next semester ? | CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admi... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_i... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What MDE classes are offered next semester ? ### Input: CREATE TABLE program (
program_id int,
name varchar,
col... |
Create a bar chart showing the total number across denomination | CREATE TABLE school_performance (
School_Id int,
School_Year text,
Class_A text,
Class_AA text
)
CREATE TABLE school_details (
School_ID int,
Nickname text,
Colors text,
League text,
Class text,
Division text
)
CREATE TABLE player (
Player_ID int,
Player text,
Team ... | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination | Below are sql tables 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 ### Input: CREATE TABLE school_performance (
School_Id i... |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name. | 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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.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 bar chart about the distribution of name an... |
provide the number of patients whose religion is romanian east. orth and item id is 50878? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "ROMANIAN EAST. ORTH" AND lab.itemid = "50878" | Below are sql tables 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 religion is romanian east. orth and item id is 50878? ### Input: CREATE TABLE lab (
... |
out of total number of patients who had coronar arteriogr-1 cath, calculate the number of those belonging to black/cape verdean ethnic origin. | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.short_title = "Coronar arteriogr-1 cath" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: out of total number of patients who had coronar arteriogr-1 cath, calculate the number of those belonging to black/cape verd... |
what are the top four most frequent medications that followed in the same month for patients who received antibacterials until 3 years ago? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'antibacterials' AND DATETIME(treatment.treatmentti... | Below are sql tables 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 frequent medications that followed in the same month for patients who received antibacterials unt... |
What's the smallest amount of earnings when the wins are less than 72 and the rank is more than 3? | CREATE TABLE table_39494 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Wins" real
) | SELECT MIN("Earnings ( $ )") FROM table_39494 WHERE "Wins" < '72' AND "Rank" > '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: What's the smallest amount of earnings when the wins are less than 72 and the rank is more than 3? ### Input: CREATE TABLE t... |
what is the difference in years between his last role and his first role ? | CREATE TABLE table_204_707 (
id number,
"year" number,
"english title" text,
"chinese title" text,
"director" text,
"role" text
) | SELECT MAX("year") - MIN("year") FROM table_204_707 | Below are sql tables 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 difference in years between his last role and his first role ? ### Input: CREATE TABLE table_204_707 (
id nu... |
what number of players have canada listed as their nationality ? | CREATE TABLE table_203_305 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) | SELECT COUNT("player") FROM table_203_305 WHERE "nationality" = 'canada' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of players have canada listed as their nationality ? ### Input: CREATE TABLE table_203_305 (
id number,
... |
Show the names and ids of tourist attractions that are visited at most once by a bar chart, and show Tourist_Attraction_ID in descending order please. | CREATE TABLE Visitors (
Tourist_ID INTEGER,
Tourist_Details VARCHAR(255)
)
CREATE TABLE Museums (
Museum_ID INTEGER,
Museum_Details VARCHAR(255)
)
CREATE TABLE Theme_Parks (
Theme_Park_ID INTEGER,
Theme_Park_Details VARCHAR(255)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attract... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the names and ids of tourist attractions that are visited at most once by a bar chart, and show Tourist_Attraction_ID i... |
The player who plays left wing is from what college/junior/club team? | CREATE TABLE table_21657 (
"Round" real,
"Overall Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | SELECT "College/Junior/Club Team (League)" FROM table_21657 WHERE "Position" = 'Left Wing' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The player who plays left wing is from what college/junior/club team? ### Input: CREATE TABLE table_21657 (
"Round" real... |
Questions filtered by tag, sorted by # of answers. | CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count ... | SELECT q.Id AS "post_link", q.CreationDate, q.AnswerCount, q.Score FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '##tagName:string##' ORDER BY AnswerCount 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: Questions filtered by tag, sorted by # of answers. ### Input: CREATE TABLE CloseReasonTypes (
Id number,
Name text,
... |
Who is the visitor on April 5? | CREATE TABLE table_69745 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | SELECT "Visitor" FROM table_69745 WHERE "Date" = 'april 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: Who is the visitor on April 5? ### Input: CREATE TABLE table_69745 (
"Date" text,
"Visitor" text,
"Score" text,
... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart, list from low to high by the X please. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
how many times did patient 90663 visit an icu in this year? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times did patient 90663 visit an icu in this year? ### Input: CREATE TABLE patients (
row_id number,
subjec... |
count the number of patients whose diagnoses short title is acute pancreatitis and drug type is main? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute pancreatitis" AND prescriptions.drug_type = "MAIN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses short title is acute pancreatitis and drug type is main? ### Input: CREATE TABL... |
What is the total number of episodes where alexa wyatt is the writer? | CREATE TABLE table_20590 (
"Season #" real,
"Series #" real,
"Title" text,
"Director(s)" text,
"Writer(s)" text,
"Original airdate" text
) | SELECT COUNT("Series #") FROM table_20590 WHERE "Writer(s)" = 'Alexa Wyatt' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of episodes where alexa wyatt is the writer? ### Input: CREATE TABLE table_20590 (
"Season #" r... |
Show the facility codes of apartments with more than 4 bedrooms. | CREATE TABLE view_unit_status (
apt_id number,
apt_booking_id number,
status_date time,
available_yn others
)
CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking... | SELECT T1.facility_code FROM apartment_facilities AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 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: Show the facility codes of apartments with more than 4 bedrooms. ### Input: CREATE TABLE view_unit_status (
apt_id numbe... |
If the RR Rate is less than 0.75 with a result of RR:08,09, what is the average appeared? | CREATE TABLE table_name_56 (
appeared INTEGER,
rr_w_rate VARCHAR,
result VARCHAR
) | SELECT AVG(appeared) FROM table_name_56 WHERE rr_w_rate < 0.75 AND result = "rr:08,09" | Below are sql tables 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 RR Rate is less than 0.75 with a result of RR:08,09, what is the average appeared? ### Input: CREATE TABLE table_name... |
what is the name of drug patient 88659 was prescribed in the same hospital encounter after receiving a endosc destruc bronc les procedure? | 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 t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 88659 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the name of drug patient 88659 was prescribed in the same hospital encounter after receiving a endosc destruc bronc ... |
what medical procedure did patient 013-33898 first receive during this hospital visit? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898' AND patient.hospitaldischargetime IS NULL)) ORDER BY t... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what medical procedure did patient 013-33898 first receive during this hospital visit? ### Input: CREATE TABLE treatment (
... |
how many married patients had the item id 51000? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51000" | Below are sql tables 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 married patients had the item id 51000? ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id text,... |
Show the average age for male and female students. Show the proportion. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the average age for male and female students. Show the proportion. ### Input: CREATE TABLE Student (
StuID INTEGER,... |
What is the lowest round for an offensive guard when the overall is smaller than 150? | CREATE TABLE table_name_59 (
round INTEGER,
overall VARCHAR,
position VARCHAR
) | SELECT MIN(round) FROM table_name_59 WHERE overall < 150 AND position = "offensive guard" | Below are sql tables 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 round for an offensive guard when the overall is smaller than 150? ### Input: CREATE TABLE table_name_59 ... |
was there any organism found in patient 30460's first mrsa screen microbiological examination in 03/last year? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
chartt... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30460) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, '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: was there any organism found in patient 30460's first mrsa screen microbiological examination in 03/last year? ### Input: CR... |
show me the cities served by CP | CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description 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,
ro... | SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'CP' AND flight.from_airport = airport_service.airport_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: show me the cities served by CP ### Input: CREATE TABLE food_service (
meal_code text,
meal_number int,
compartm... |
When the Home team of collingwood played, what was the opposing Away team score? | CREATE TABLE table_name_49 (
away_team VARCHAR,
home_team VARCHAR
) | SELECT away_team AS score FROM table_name_49 WHERE home_team = "collingwood" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Home team of collingwood played, what was the opposing Away team score? ### Input: CREATE TABLE table_name_49 (
... |
For those products with a price between 60 and 120, a scatter chart shows the correlation between code and price . | 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 Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 | Below are sql tables 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 products with a price between 60 and 120, a scatter chart shows the correlation between code and price . ### Input... |
count the number of patients whose admission type is elective and diagnoses icd9 code is 42789? | 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_type = "ELECTIVE" AND diagnoses.icd9_code = "42789" | Below are sql tables 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 elective and diagnoses icd9 code is 42789? ### Input: CREATE TABLE pres... |
tell me the number of patients who had bicarbonate lab test and were hospitalized for more than 15 days. | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Bicarbonate" | Below are sql tables 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 number of patients who had bicarbonate lab test and were hospitalized for more than 15 days. ### Input: CREATE T... |
For those employees who was hired before 2002-06-21, visualize a line chart about the change of employee_id over hire_date . | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, visualize a line chart about the change of employee_id over hire_date .... |
Find the country of the airlines whose name starts with 'Orbit', and count them by a bar chart, rank from high to low by the y-axis. | CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varchar(3),
icao character varchar(4)
)
CREATE TABLE routes (
rid integer,
dst_apid integer,
dst_ap varchar(4),
src_apid bigint,
src_ap varc... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the country of the airlines whose name starts with 'Orbit', and count them by a bar chart, rank from high to low by the... |
please list the TUESDAY flights from ATLANTA to ST. LOUIS | CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (... | 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 = 'ST. LOUIS' AND days.day_name = 'TUESDAY' AND flight.flight_days = days.days_code AN... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: please list the TUESDAY flights from ATLANTA to ST. LOUIS ### Input: CREATE TABLE fare_basis (
fare_basis_code text,
... |
What are average ages for students living in each city? Return a bar chart, could you sort names in desc order? | CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_ca... | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY city_code DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are average ages for students living in each city? Return a bar chart, could you sort names in desc order? ### Input: C... |
provide the number of patients whose diagnoses is lap surg convert to open and they are female. | 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 WHERE demographic.gender = "F" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA" | Below are sql tables 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 is lap surg convert to open and they are female. ### Input: CREATE TABLE diag... |
What professor teaches LACS 471 ? | CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LACS' AND course.number = 471 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What professor teaches LACS 471 ? ### Input: CREATE TABLE course_offering (
offering_id int,
course_id int,
seme... |
When the Away team of essendon played and the Crowd was larger than 18,704 people, which Date did this take place on? | CREATE TABLE table_10097 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_10097 WHERE "Crowd" > '18,704' AND "Away team" = 'essendon' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Away team of essendon played and the Crowd was larger than 18,704 people, which Date did this take place on? ### In... |
hba1c between 7 and 9 % | CREATE TABLE table_train_229 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"active_metabolic" bool,
"body_weight" float,
"hba1c" float,
"age" float,
"NOUSE" float
) | SELECT * FROM table_train_229 WHERE hba1c >= 7 AND hemoglobin_a1c_hba1c <= 9 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: hba1c between 7 and 9 % ### Input: CREATE TABLE table_train_229 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"activ... |
What was the home team's score when North Melbourne was the away team? | CREATE TABLE table_name_39 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team AS score FROM table_name_39 WHERE away_team = "north melbourne" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the home team's score when North Melbourne was the away team? ### Input: CREATE TABLE table_name_39 (
home_team... |
What is the smallest number of bronze medals with more than 4 gold medals? | CREATE TABLE table_69395 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Bronze") FROM table_69395 WHERE "Gold" > '4' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest number of bronze medals with more than 4 gold medals? ### Input: CREATE TABLE table_69395 (
"Rank" ... |
What is the total number of bronze that has less than 2 gold, and more than 1 silver? | CREATE TABLE table_60713 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT COUNT("Bronze") FROM table_60713 WHERE "Gold" < '2' AND "Silver" > '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of bronze that has less than 2 gold, and more than 1 silver? ### Input: CREATE TABLE table_60713 (
... |
Bar chart of mean price from each name, order names in desc order. | 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 Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart of mean price from each name, order names in desc order. ### Input: CREATE TABLE Manufacturers (
Code INTEGER,... |
when did patient 78221 first receive a lab test until 11/2101? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND STRFTIME('%y-%m', labevents.charttime) <= '2101-11' ORDER BY labevents.charttime LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 78221 first receive a lab test until 11/2101? ### Input: CREATE TABLE cost (
row_id number,
subject... |
When did the length of 60 minutes air? | CREATE TABLE table_15117 (
"Title" text,
"Length" text,
"Writer" text,
"Director" text,
"Airdate" text
) | SELECT "Airdate" FROM table_15117 WHERE "Length" = '60 minutes' | Below are sql tables 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 the length of 60 minutes air? ### Input: CREATE TABLE table_15117 (
"Title" text,
"Length" text,
"Write... |
number of episodes in the first season | CREATE TABLE table_203_685 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text
) | SELECT COUNT("title") FROM table_203_685 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: number of episodes in the first season ### Input: CREATE TABLE table_203_685 (
id number,
"no. in\nseries" number,
... |
how many times has a o2 sat (%) test been given to patient 005-4044 in 2101? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044')) AND lab.labname = 'o2 sat (%)' AND STRFTIME('%y', lab.labresulttime) = '2101' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times has a o2 sat (%) test been given to patient 005-4044 in 2101? ### Input: CREATE TABLE lab (
labid number,... |
What is the mean difficulty of the classes that are PreMajor ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
... | SELECT AVG(workload) FROM program_course WHERE category LIKE '%PreMajor%' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the mean difficulty of the classes that are PreMajor ? ### Input: CREATE TABLE course_prerequisite (
pre_course_... |
What is the highest number of poles? | CREATE TABLE table_29027 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Podiums" real,
"F/Laps" real,
"Points" text,
"Final Placing" text
) | SELECT MAX("Poles") FROM table_29027 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest number of poles? ### Input: CREATE TABLE table_29027 (
"Season" real,
"Series" text,
"Team N... |
Which County has an IHSAA Class of aaaa, and a Mascot of cardinals? | CREATE TABLE table_64064 (
"School" text,
"City" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"County" text
) | SELECT "County" FROM table_64064 WHERE "IHSAA Class" = 'aaaa' AND "Mascot" = 'cardinals' | Below are sql tables 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 County has an IHSAA Class of aaaa, and a Mascot of cardinals? ### Input: CREATE TABLE table_64064 (
"School" text,... |
have a serum creatinine greater than or equal to 1.5 milligrams / deciliter ( mg / dl ) ( male ) or greater than or equal to 1.4 mg / dl ( female ) , or a creatinine clearance less than 60 milliliters / minute ( ml / minute ) | CREATE TABLE table_dev_38 (
"id" int,
"gender" string,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"diastolic_blood_pressure_dbp" int,
"ace_inhibitors" bool,
"serum_creatinine" float,
... | SELECT * FROM table_dev_38 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female') OR creatinine_clearance_cl < 60 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: have a serum creatinine greater than or equal to 1.5 milligrams / deciliter ( mg / dl ) ( male ) or greater than or equal to... |
how many hours have pass since the first time patient 12927 stayed in ward 23 on their current hospital encounter? | 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 icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927 AND admissions.dischtime IS NULL)) AND transfers... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many hours have pass since the first time patient 12927 stayed in ward 23 on their current hospital encounter? ### Input... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.