instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the amount of hire_date bin hire_date by time in a bar chart, display by the y-axis in descending.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varc...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the amoun...
indicate the monthly maximum arterial bp mean of patient 28253 on the first hospital encounter.
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_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
SELECT MAX(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 = 28253 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevent...
Below are sql tables 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 arterial bp mean of patient 28253 on the first hospital encounter. ### Input: CREATE TABLE char...
Draw a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, order from low to high by the x-axis please.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, order fr...
How many on the list are called the Austrian Grand Prix?
CREATE TABLE table_16638 ( "Rd." real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text )
SELECT COUNT("Rd.") FROM table_16638 WHERE "Grand Prix" = 'Austrian Grand Prix'
Below are sql tables 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 on the list are called the Austrian Grand Prix? ### Input: CREATE TABLE table_16638 ( "Rd." real, "Grand Pr...
count the number of patients who were diagnosed with diabetes mellitus but did not return to the hospital within 2 months in 2104.
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104') AS t1) - (SELECT COUNT(DIST...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who were diagnosed with diabetes mellitus but did not return to the hospital within 2 months in...
what are the four most frequently performed procedures for patients of the 50s in 2100?
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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', treatment.treatmenttime) = '2100' GROUP BY treatment.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 are the four most frequently performed procedures for patients of the 50s in 2100? ### Input: CREATE TABLE medication (...
What was the score for the home team St Kilda?
CREATE TABLE table_74582 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team score" FROM table_74582 WHERE "Home team" = 'st kilda'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score for the home team St Kilda? ### Input: CREATE TABLE table_74582 ( "Home team" text, "Home team sc...
what is days of hospital stay and death status of subject id 23733?
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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "23733"
Below are sql tables 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 days of hospital stay and death status of subject id 23733? ### Input: CREATE TABLE diagnoses ( subject_id text,...
When (v kha) is the belarusian how many slovaks are there?
CREATE TABLE table_28993 ( "Proto-Slavic" text, "Russian" text, "Ukrainian" text, "Belarusian" text, "Polish" text, "Czech" text, "Slovak" text, "Slovene" text, "Serbo-Croatian" text, "Bulgarian" text, "Macedonian" text )
SELECT COUNT("Slovak") FROM table_28993 WHERE "Belarusian" = 'вуха (vúkha)'
Below are sql tables 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 (v kha) is the belarusian how many slovaks are there? ### Input: CREATE TABLE table_28993 ( "Proto-Slavic" text, ...
give me the number of intensive care unit visits patient 004-86136 had during the current hospital visit.
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136' AND patient.hospitaldischargetime IS NULL)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of intensive care unit visits patient 004-86136 had during the current hospital visit. ### Input: CREATE ...
What was the away team when the game was at corio oval?
CREATE TABLE table_74749 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_74749 WHERE "Venue" = 'corio oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away team when the game was at corio oval? ### Input: CREATE TABLE table_74749 ( "Home team" text, "Hom...
Which Home team has a Home team score of 7.8 (50)?
CREATE TABLE table_10213 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_10213 WHERE "Home team score" = '7.8 (50)'
Below are sql tables 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 Home team has a Home team score of 7.8 (50)? ### Input: CREATE TABLE table_10213 ( "Home team" text, "Home tea...
what is the total amount of fentanyl intake that patient 030-30152 received since 01/07/2103?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-30152')) AND intakeoutput.celllabel = 'fenta...
Below are sql tables 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 amount of fentanyl intake that patient 030-30152 received since 01/07/2103? ### Input: CREATE TABLE allerg...
has any organism was found in the first pleural fluid microbiology test of patient 60136 in this month?
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136) AND microbiologyevents.spec_type_desc = 'pleural fluid' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of month')...
Below are sql tables 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 any organism was found in the first pleural fluid microbiology test of patient 60136 in this month? ### Input: CREATE TA...
What is the sum of the interview scores from North Dakota that have averages less than 8.697, evening gown scores less than 8.73, and swimsuit scores greater than 8.41?
CREATE TABLE table_name_4 ( interview INTEGER, swimsuit VARCHAR, state VARCHAR, average VARCHAR, evening_gown VARCHAR )
SELECT SUM(interview) FROM table_name_4 WHERE average < 8.697 AND evening_gown < 8.73 AND state = "north dakota" AND swimsuit > 8.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 sum of the interview scores from North Dakota that have averages less than 8.697, evening gown scores less than ...
How many total show when silver is 0, bronze is 1, and the rank is less than 3?
CREATE TABLE table_75065 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT("Total") FROM table_75065 WHERE "Silver" = '0' AND "Bronze" = '1' 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: How many total show when silver is 0, bronze is 1, and the rank is less than 3? ### Input: CREATE TABLE table_75065 ( "R...
Who had the highest assists on November 4
CREATE TABLE table_11959669_3 ( high_assists VARCHAR, date VARCHAR )
SELECT high_assists FROM table_11959669_3 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_11959669_3 ( high_assists VARCHAR, date VARC...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the average of manager_id bin hire_date by weekday, rank in descending by the y axis.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the a...
What is the week more than 58,675 attended on october 22, 1995?
CREATE TABLE table_32830 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT SUM("Week") FROM table_32830 WHERE "Attendance" > '58,675' AND "Date" = 'october 22, 1995'
Below are sql tables 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 week more than 58,675 attended on october 22, 1995? ### Input: CREATE TABLE table_32830 ( "Week" real, "...
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 hire_date and the average of manager_id bin hire_date by time.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 varc...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the di...
What was their record when the attendance was 26,827?
CREATE TABLE table_69248 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Record" FROM table_69248 WHERE "Attendance" = '26,827'
Below are sql tables 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 their record when the attendance was 26,827? ### Input: CREATE TABLE table_69248 ( "Date" text, "Opponent" ...
What is every Gregorian month when the season in Tamil is ?
CREATE TABLE table_21670 ( "Season in Tamil" text, "English Transliteration" text, "English Translation" text, "Season in Sanskrit" text, "Season in English" text, "Tamil Months" text, "Gregorian Months" text )
SELECT "Gregorian Months" FROM table_21670 WHERE "Season in Tamil" = 'இளவேனில்'
Below are sql tables 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 Gregorian month when the season in Tamil is ? ### Input: CREATE TABLE table_21670 ( "Season in Tamil" text...
what is primary disease and lab test name of subject id 2560?
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 demographic.diagnosis, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is primary disease and lab test name of subject id 2560? ### Input: CREATE TABLE diagnoses ( subject_id text, h...
A bar chart shows how many locations.
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
SELECT Location, COUNT(Location) FROM station GROUP BY Location
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows how many locations. ### Input: CREATE TABLE train ( Train_ID int, Name text, Time text, Se...
What score has 3-7 as the record?
CREATE TABLE table_33808 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Time" text, "Att." text, "Record" text )
SELECT "Score" FROM table_33808 WHERE "Record" = '3-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: What score has 3-7 as the record? ### Input: CREATE TABLE table_33808 ( "Date" text, "Opponent" text, "Score" te...
Show me about the distribution of All_Neutral and All_Games_Percent in a bar chart, I want to display by the total number in ascending.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Neutral and All_Games_Percent in a bar chart, I want to display by the total number in...
What date was the attendance 82,500?
CREATE TABLE table_name_81 ( date VARCHAR, attendance VARCHAR )
SELECT date FROM table_name_81 WHERE attendance = "82,500"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date was the attendance 82,500? ### Input: CREATE TABLE table_name_81 ( date VARCHAR, attendance VARCHAR ) ### ...
How many assets can each parts be used in? List the part name and the number with a bar chart, and rank by the x axis in ascending.
CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ) CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Engineer_Visits ( ...
SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_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: How many assets can each parts be used in? List the part name and the number with a bar chart, and rank by the x axis in asc...
What is the score of the game where the Rangers record was 16-8-4?
CREATE TABLE table_5772 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text )
SELECT "Score" FROM table_5772 WHERE "Record" = '16-8-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 score of the game where the Rangers record was 16-8-4? ### Input: CREATE TABLE table_5772 ( "Game" real, ...
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 salary over the job_id , and group by attribute job_id, and display in ascending by the X.
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT JOB_ID, AVG(SALARY) 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 ...
What are the name and phone of the customer with the most ordered product quantity?
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE contacts ( contact_id number, customer_id number, gender text, first_name text, last_name text, contact_phone te...
SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY SUM(T3.order_quantity) 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: What are the name and phone of the customer with the most ordered product quantity? ### Input: CREATE TABLE addresses ( ...
What was the A Score when the B Score was 9.05, and position was larger than 6?
CREATE TABLE table_65548 ( "Position" real, "Gymnast" text, "A Score" real, "B Score" real, "Total" real )
SELECT AVG("A Score") FROM table_65548 WHERE "B Score" = '9.05' AND "Position" > '6'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the A Score when the B Score was 9.05, and position was larger than 6? ### Input: CREATE TABLE table_65548 ( "P...
What home team has june 22 as the date?
CREATE TABLE table_name_87 ( home_team VARCHAR, date VARCHAR )
SELECT home_team FROM table_name_87 WHERE date = "june 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 home team has june 22 as the date? ### Input: CREATE TABLE table_name_87 ( home_team VARCHAR, date VARCHAR ) ##...
what is the price of a diagnosis for uterine leiomyoma nos?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'uterine leiomyoma nos'))
Below are sql tables 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 price of a diagnosis for uterine leiomyoma nos? ### Input: CREATE TABLE diagnoses_icd ( row_id number, s...
when has patient 007-11182 had the first intake on 08/29/2100?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182')) AND intakeoutput.cellpath LIKE '%intake%...
Below are sql tables 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 has patient 007-11182 had the first intake on 08/29/2100? ### Input: CREATE TABLE lab ( labid number, patientun...
what is the number of sites when the number of screens is 687 and rank is more than 7?
CREATE TABLE table_70060 ( "Rank" real, "Circuit" text, "Headquarters" text, "Screens" real, "Sites" real )
SELECT AVG("Sites") FROM table_70060 WHERE "Screens" = '687' AND "Rank" > '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: what is the number of sites when the number of screens is 687 and rank is more than 7? ### Input: CREATE TABLE table_70060 (...
At what times will Lean Manufacturing and Services be offered ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
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 semester INNER JOIN course_offering ON semester.semester_id = course_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: At what times will Lean Manufacturing and Services be offered ? ### Input: CREATE TABLE instructor ( instructor_id int, ...
Bin the claim date into the Year interval and count them for visualizing a bar chart, and show in desc by the y-axis.
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Cu...
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made) 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 the claim date into the Year interval and count them for visualizing a bar chart, and show in desc by the y-axis. ### In...
Name the film title that is spanish from peru
CREATE TABLE table_71431 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original title" text, "Director" text )
SELECT "Film title used in nomination" FROM table_71431 WHERE "Language" = 'spanish' AND "Country" = 'peru'
Below are sql tables 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 film title that is spanish from peru ### Input: CREATE TABLE table_71431 ( "Country" text, "Film title used...
Draw a bar chart about the distribution of Nationality and the average of ID , and group by attribute Nationality, and I want to show by the x-axis in descending.
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 swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality 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 Nationality and the average of ID , and group by attribute Nationality, and I wan...
Show me mean rating by languages in a histogram, order by the mean rating in ascending please.
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE genre ( g...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY AVG(rating)
Below are sql tables 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 mean rating by languages in a histogram, order by the mean rating in ascending please. ### Input: CREATE TABLE artis...
PHIL 433 has been available for how long ?
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHIL' AND course.number = 433 AND semester.semester_id = course_offering.semester ORDER BY semester.year 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: PHIL 433 has been available for how long ? ### Input: CREATE TABLE area ( course_id int, area varchar ) CREATE TABL...
Show all sport name and the number of students Show bar chart, could you sort by the Y-axis in ascending please?
CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all sport name and the number of students Show bar chart, could you sort by the Y-axis in ascending please? ### Input: ...
Please give me a pie chart to show the number of home cities of all drivers, show by the x axis from low to high.
CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time...
SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY Home_city
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please give me a pie chart to show the number of home cities of all drivers, show by the x axis from low to high. ### Input:...
What date did Footscray play and Away game?
CREATE TABLE table_name_24 ( date VARCHAR, away_team VARCHAR )
SELECT date FROM table_name_24 WHERE away_team = "footscray"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date did Footscray play and Away game? ### Input: CREATE TABLE table_name_24 ( date VARCHAR, away_team VARCHAR ...
what's the difference between the total output and the amount of input for patient 017-20711 on last month/16?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-20711')) AND intakeoutput.cellpath L...
Below are sql tables 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 difference between the total output and the amount of input for patient 017-20711 on last month/16? ### Input: CR...
Visualize a bar chart for what are the names and the total prices of all products in the store?, and could you list from high to low by the X-axis?
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT Name, SUM(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: Visualize a bar chart for what are the names and the total prices of all products in the store?, and could you list from hig...
what flights from PITTSBURGH to NEWARK on monday
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, ...
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 = 'NEWARK' AND date_day.day_number = 21 AND date_day.month_number = 2 AND da...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights from PITTSBURGH to NEWARK on monday ### Input: CREATE TABLE code_description ( code varchar, descriptio...
who has the most goals plus caps ?
CREATE TABLE table_203_121 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
SELECT "name" FROM table_203_121 ORDER BY "goals" + "caps" DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who has the most goals plus caps ? ### Input: CREATE TABLE table_203_121 ( id number, "name" text, "pos." text, ...
What was the venue where goal #2 occured?
CREATE TABLE table_76294 ( "Goal #" real, "Date" text, "Venue" text, "Score" text, "Result" text )
SELECT "Venue" FROM table_76294 WHERE "Goal #" = '2'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the venue where goal #2 occured? ### Input: CREATE TABLE table_76294 ( "Goal #" real, "Date" text, "Ven...
i want a one way ticket from DALLAS to BALTIMORE
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND fare.round_trip_required = 'NO' AND flight_fare.fare_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: i want a one way ticket from DALLAS to BALTIMORE ### Input: CREATE TABLE equipment_sequence ( aircraft_code_sequence var...
Give me the comparison about Team_ID over the All_Neutral .
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, Team_ID FROM basketball_match
Below are sql tables 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 Team_ID over the All_Neutral . ### Input: CREATE TABLE basketball_match ( Team_ID int, ...
What are the original air date(s) for episodes with production code ipea345a?
CREATE TABLE table_27281 ( "Episode #" real, "Production Count" real, "Original Airdate" text, "Prod. Code" text, "Title" text, "Viewing Figures Millions" text )
SELECT "Original Airdate" FROM table_27281 WHERE "Prod. Code" = 'IPEA345A'
Below are sql tables 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 original air date(s) for episodes with production code ipea345a? ### Input: CREATE TABLE table_27281 ( "Epi...
show me all the flights from PHILADELPHIA to CINCINNATI
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departu...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'C...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all the flights from PHILADELPHIA to CINCINNATI ### Input: CREATE TABLE dual_carrier ( main_airline varchar, ...
what is the five most often ordered drugs until 4 years ago for patients of 40s?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate tim...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY pres...
Below are sql tables 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 five most often ordered drugs until 4 years ago for patients of 40s? ### Input: CREATE TABLE d_icd_diagnoses ( ...
what the age of patient 022-130563 was when they came to the hospital last time?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT patient.age FROM patient WHERE patient.uniquepid = '022-130563' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime 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: what the age of patient 022-130563 was when they came to the hospital last time? ### Input: CREATE TABLE microlab ( micr...
how many patients have received a opn lft hemicolectmy nec procedure two times until 1 year ago?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id num...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'opn lft hemicolectmy ...
Below are sql tables 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 received a opn lft hemicolectmy nec procedure two times until 1 year ago? ### Input: CREATE TABLE d_i...
Create a bar chart showing the total number across team, show X-axis from high to low order please.
CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE T...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY 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: Create a bar chart showing the total number across team, show X-axis from high to low order please. ### Input: CREATE TABLE ...
What is the lowest wins the club with a position of 4 and less than 4 losses has?
CREATE TABLE table_39945 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real )
SELECT MIN("Wins") FROM table_39945 WHERE "Position" = '4' AND "Loses" < '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 lowest wins the club with a position of 4 and less than 4 losses has? ### Input: CREATE TABLE table_39945 ( ...
A bar chart that computes the total number of wines with a price is bigger than 100 Next, Bin the year into the weekday interval, rank y-axis from low to high order.
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Year, COUNT(Year) FROM wine WHERE Price > 100 ORDER BY COUNT(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: A bar chart that computes the total number of wines with a price is bigger than 100 Next, Bin the year into the weekday inte...
how many patients born before 1879 were ordered calculated hematocrit lab test?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1879" AND lab.label = "Hematocrit, Calculated"
Below are sql tables 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 born before 1879 were ordered calculated hematocrit lab test? ### Input: CREATE TABLE demographic ( su...
Which Home has a Score of 0:2?
CREATE TABLE table_47730 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
SELECT "Home" FROM table_47730 WHERE "Score" = '0: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: Which Home has a Score of 0:2? ### Input: CREATE TABLE table_47730 ( "Date" text, "Home" text, "Score" text, ...
give me the number of patients whose ethnicity is black/cape verdean and procedure icd9 code is 8674?
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.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "8674"
Below are sql tables 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 ethnicity is black/cape verdean and procedure icd9 code is 8674? ### Input: CREATE TABL...
What average game has January 30 as the date?
CREATE TABLE table_name_45 ( game INTEGER, date VARCHAR )
SELECT AVG(game) FROM table_name_45 WHERE date = "january 30"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What average game has January 30 as the date? ### Input: CREATE TABLE table_name_45 ( game INTEGER, date VARCHAR ) #...
Who was the opponent at the game later than game 22 when the record was 17-10-4?
CREATE TABLE table_name_56 ( opponent VARCHAR, game VARCHAR, record VARCHAR )
SELECT opponent FROM table_name_56 WHERE game > 22 AND record = "17-10-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 was the opponent at the game later than game 22 when the record was 17-10-4? ### Input: CREATE TABLE table_name_56 ( ...
I want the driver for grid of 9
CREATE TABLE table_78537 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Driver" FROM table_78537 WHERE "Grid" = '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: I want the driver for grid of 9 ### Input: CREATE TABLE table_78537 ( "Driver" text, "Constructor" text, "Laps" ...
What are the first name and last name of all the instructors?
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE studen...
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: What are the first name and last name of all the instructors? ### Input: CREATE TABLE activity ( actid number, activ...
show me all flights from BALTIMORE to PHILADELPHIA
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all flights from BALTIMORE to PHILADELPHIA ### Input: CREATE TABLE state ( state_code text, state_name text,...
get the number of patients less than 50 years of age who have chemistry lab test category.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "50" AND lab."CATEGORY" = "Chemistry"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get the number of patients less than 50 years of age who have chemistry lab test category. ### Input: CREATE TABLE demograph...
What was the score of the match played against away team Arsenal?
CREATE TABLE table_45693 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Score" FROM table_45693 WHERE "Away team" = 'arsenal'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the score of the match played against away team Arsenal? ### Input: CREATE TABLE table_45693 ( "Tie no" text, ...
Visualize a bar chart about the distribution of Days and the average of Credits , and group by attribute Days.
CREATE TABLE Enrolled_in ( StuID INTEGER, CID VARCHAR(7), Grade VARCHAR(2) ) 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 Course ( CID VARCHAR...
SELECT Days, AVG(Credits) FROM Course GROUP BY Days ORDER BY Credits
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of Days and the average of Credits , and group by attribute Days. ### Input: CR...
Who is the opponent from September 28?
CREATE TABLE table_6600 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Opponent" FROM table_6600 WHERE "Date" = 'september 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: Who is the opponent from September 28? ### Input: CREATE TABLE table_6600 ( "Date" text, "Opponent" text, "Score...
Name the record for april 6
CREATE TABLE table_14516 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Record" FROM table_14516 WHERE "Date" = 'april 6'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the record for april 6 ### Input: CREATE TABLE table_14516 ( "Date" text, "Opponent" text, "Score" text, ...
What is the lowest crowd at corio oval?
CREATE TABLE table_name_20 ( crowd INTEGER, venue VARCHAR )
SELECT MIN(crowd) FROM table_name_20 WHERE venue = "corio oval"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest crowd at corio oval? ### Input: CREATE TABLE table_name_20 ( crowd INTEGER, venue VARCHAR ) ### R...
which games has the largest amount of people attending ?
CREATE TABLE table_204_495 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
SELECT "date" FROM table_204_495 ORDER BY "attendance" 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 games has the largest amount of people attending ? ### Input: CREATE TABLE table_204_495 ( id number, "date" t...
what is the number of patients whose days of hospital stay is greater than 16 and lab test name is globulin?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.label = "Globulin"
Below are sql tables 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 days of hospital stay is greater than 16 and lab test name is globulin? ### Input: CREA...
how many patients whose admission type is urgent and procedure short title is hemodialysis?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Hemodialysis"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is urgent and procedure short title is hemodialysis? ### Input: CREATE TABLE lab ( ...
count the number of patients who have already received the gastric tube irrigat nec two times in 2102.
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'gastric tube irrigat ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who have already received the gastric tube irrigat nec two times in 2102. ### Input: CREATE TAB...
Who was the Republican in the district more than 4?
CREATE TABLE table_63478 ( "District" real, "Incumbent" text, "2008 Status" text, "Democratic" text, "Republican" text, "Green" text )
SELECT "Republican" FROM table_63478 WHERE "District" > '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 was the Republican in the district more than 4? ### Input: CREATE TABLE table_63478 ( "District" real, "Incumben...
For all employees who have the letters D or S in their first name, give me the comparison about the amount of hire_date over the hire_date bin hire_date by time by a bar chart, and list Y in asc order 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 HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, give me the comparison about the amount of hire_date over...
For CS majors what are the upper level electives offered ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_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 CS majors what are the upper level electives offered ? ### Input: CREATE TABLE instructor ( instructor_id int, n...
on 04/28/2100 what was the maximum value of sao2 of patient 010-19726?
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 MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-19726')) AND NOT vitalperiodic.sao2 IS NULL AND STRFT...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on 04/28/2100 what was the maximum value of sao2 of patient 010-19726? ### Input: CREATE TABLE medication ( medicationid...
What are the nationalities and their average ages of journalists. Show me a bar chart.
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality
Below are sql tables 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 nationalities and their average ages of journalists. Show me a bar chart. ### Input: CREATE TABLE event ( E...
Show me about the distribution of All_Neutral and ACC_Percent in a bar chart, rank by the total number in desc.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Neutral and ACC_Percent in a bar chart, rank by the total number in desc. ### Input: C...
What is the number of bronze medals when the total medals were 78 and there were less than 12 golds?
CREATE TABLE table_76042 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT SUM("Bronze") FROM table_76042 WHERE "Total" = '78' AND "Gold" < '12'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of bronze medals when the total medals were 78 and there were less than 12 golds? ### Input: CREATE TABLE...
What is the crowd with an Away team score of 8.11 (59)?
CREATE TABLE table_32680 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT AVG("Crowd") FROM table_32680 WHERE "Away team score" = '8.11 (59)'
Below are sql tables 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 crowd with an Away team score of 8.11 (59)? ### Input: CREATE TABLE table_32680 ( "Home team" text, "Hom...
when patient 028-43966 heartrate first measured until 02/05/2105?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
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 = '028-43966')) AND NOT vitalperiodic.heartrate IS NUL...
Below are sql tables 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 patient 028-43966 heartrate first measured until 02/05/2105? ### Input: CREATE TABLE intakeoutput ( intakeoutputid ...
Which opponent had a time of 0:29?
CREATE TABLE table_name_71 ( opponent VARCHAR, time VARCHAR )
SELECT opponent FROM table_name_71 WHERE time = "0:29"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which opponent had a time of 0:29? ### Input: CREATE TABLE table_name_71 ( opponent VARCHAR, time VARCHAR ) ### Resp...
Which Position has a Pick of 174?
CREATE TABLE table_name_66 ( position VARCHAR, pick VARCHAR )
SELECT position FROM table_name_66 WHERE pick = 174
Below are sql tables 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 Position has a Pick of 174? ### Input: CREATE TABLE table_name_66 ( position VARCHAR, pick VARCHAR ) ### Respo...
which language does patient with patient id 3343 prefer?
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 demographic.language FROM demographic WHERE demographic.subject_id = "3343"
Below are sql tables 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 language does patient with patient id 3343 prefer? ### Input: CREATE TABLE procedures ( subject_id text, hadm_...
are there any flights from DENVER to PITTSBURGH with stops in ATLANTA
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_s...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND CITY_2...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: are there any flights from DENVER to PITTSBURGH with stops in ATLANTA ### Input: CREATE TABLE time_interval ( period tex...
For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the headquarter , and group by attribute headquarter, and display X 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 Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about the average of revenue ove...
count the number of patients that received a vaccination nec procedure within 2 months after having received a packed cell transfusion procedure.
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'packed cell...
Below are sql tables 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 that received a vaccination nec procedure within 2 months after having received a packed cell t...
What is the last match with a vacancy date of round 2 and Ney Franco as outgoing manager?
CREATE TABLE table_name_26 ( last_match VARCHAR, date_of_vacancy VARCHAR, outgoing_manager VARCHAR )
SELECT last_match FROM table_name_26 WHERE date_of_vacancy = "round 2" AND outgoing_manager = "ney franco"
Below are sql tables 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 last match with a vacancy date of round 2 and Ney Franco as outgoing manager? ### Input: CREATE TABLE table_name...
What is the System with a freeware License?
CREATE TABLE table_55982 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
SELECT "System" FROM table_55982 WHERE "License" = 'freeware'
Below are sql tables 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 System with a freeware License? ### Input: CREATE TABLE table_55982 ( "Name" text, "Current version" tex...
Show the home city with the most number of drivers.
CREATE TABLE school ( school_id number, grade text, school text, location text, type text ) CREATE TABLE driver ( driver_id number, name text, party text, home_city text, age number ) CREATE TABLE school_bus ( school_id number, driver_id number, years_working number...
SELECT home_city FROM driver GROUP BY home_city 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: Show the home city with the most number of drivers. ### Input: CREATE TABLE school ( school_id number, grade text, ...
tell me the name of the medication patient 27467 was prescribed within 2 days after being diagnosed with iron defic anemia nos in 08/2105?
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 t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 27467 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'iron d...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the name of the medication patient 27467 was prescribed within 2 days after being diagnosed with iron defic anemia n...
What is Region, when Date is 2004?
CREATE TABLE table_42772 ( "Region" text, "Date" real, "Label" text, "Format" text, "Catalog" text )
SELECT "Region" FROM table_42772 WHERE "Date" = '2004'
Below are sql tables 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 Region, when Date is 2004? ### Input: CREATE TABLE table_42772 ( "Region" text, "Date" real, "Label" tex...
Who went to Geelong to play?
CREATE TABLE table_name_61 ( away_team VARCHAR, home_team VARCHAR )
SELECT away_team FROM table_name_61 WHERE home_team = "geelong"
Below are sql tables 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 went to Geelong to play? ### Input: CREATE TABLE table_name_61 ( away_team VARCHAR, home_team VARCHAR ) ### Resp...
how much does a medical diagnosis of poisoning-barbiturates cost?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, s...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'poisoning-barbiturates'))
Below are sql tables 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 a medical diagnosis of poisoning-barbiturates cost? ### Input: CREATE TABLE inputevents_cv ( row_id number...