instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
What Population has a Median family income of $38,044?
CREATE TABLE table_13555 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
SELECT "Population" FROM table_13555 WHERE "Median family income" = '$38,044'
Below are sql tables 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 Population has a Median family income of $38,044? ### Input: CREATE TABLE table_13555 ( "County" text, "Per cap...
What are the nationalities and the taotal ages of journalists Visualize by a bar chart, I want to show by the total number of age in desc.
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY SUM(Age) 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 nationalities and the taotal ages of journalists Visualize by a bar chart, I want to show by the total number o...
how many hours has it been since patient 14467 last received an intake of d5w on the current intensive care unit visit?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND icustays.outtime 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: how many hours has it been since patient 14467 last received an intake of d5w on the current intensive care unit visit? ### ...
For those dates with a max temperature greater than or equal to 80, I would like a line chart to show the tendency, I want to list x axis from high to low order.
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those dates with a max temperature greater than or equal to 80, I would like a line chart to show the tendency, I want t...
What is the title when u.s. viewers (millions) is 3.97?
CREATE TABLE table_22363 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
SELECT "Title" FROM table_22363 WHERE "U.S. viewers (in millions)" = '3.97'
Below are sql tables 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 title when u.s. viewers (millions) is 3.97? ### Input: CREATE TABLE table_22363 ( "No. in series" real, ...
What country was the player with the score line 69-71-72-69=281 from?
CREATE TABLE table_name_6 ( country VARCHAR, score VARCHAR )
SELECT country FROM table_name_6 WHERE score = 69 - 71 - 72 - 69 = 281
Below are sql tables 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 country was the player with the score line 69-71-72-69=281 from? ### Input: CREATE TABLE table_name_6 ( country VAR...
calculate the average age of unmarried patients admitted to trsf within this facility
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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the average age of unmarried patients admitted to trsf within this facility ### Input: CREATE TABLE diagnoses ( ...
Is SOCADMIN 995 available to take every semester ?
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 COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'SOCADMIN' AND COURSEalias0.numb...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Is SOCADMIN 995 available to take every semester ? ### Input: CREATE TABLE course_offering ( offering_id int, course...
Can 182 be taken by undergrads ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 182
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can 182 be taken by undergrads ? ### Input: CREATE TABLE semester ( semester_id int, semester varchar, year int ...
What are the titles of all movies that have between 3 and 5 stars, and count them by a bar chart, and display X-axis in ascending order.
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY title
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the titles of all movies that have between 3 and 5 stars, and count them by a bar chart, and display X-axis in asce...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, rank in ascending by the Y.
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 JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(SALARY)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of sa...
Find the number of different products that are produced by companies at different headquarter cities Plot them as bar chart, and show X in asc 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, COUNT(DISTINCT T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code ORDER BY Headquarter
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of different products that are produced by companies at different headquarter cities Plot them as bar chart,...
What is the Call sign for the ERP W 19?
CREATE TABLE table_name_75 ( call_sign VARCHAR, erp_w VARCHAR )
SELECT call_sign FROM table_name_75 WHERE erp_w = 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 Call sign for the ERP W 19? ### Input: CREATE TABLE table_name_75 ( call_sign VARCHAR, erp_w VARCHAR ) #...
What was the score for the away team when the home team was Fitzroy?
CREATE TABLE table_74686 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_74686 WHERE "Home team" = 'fitzroy'
Below are sql tables 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 away team when the home team was Fitzroy? ### Input: CREATE TABLE table_74686 ( "Home team" t...
how many patients born before 2090 have ih route of drug administration?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2090" AND prescriptions.route = "IH"
Below are sql tables 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 2090 have ih route of drug administration? ### Input: CREATE TABLE prescriptions ( subject...
Name for me the total number in attendance for week before 2 and result of t 24-24
CREATE TABLE table_52184 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT COUNT("Attendance") FROM table_52184 WHERE "Result" = 't 24-24' AND "Week" < '2'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name for me the total number in attendance for week before 2 and result of t 24-24 ### Input: CREATE TABLE table_52184 ( ...
What's the total grid for a Time/Retired of +1:03.741, and Laps larger than 44?
CREATE TABLE table_51532 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT COUNT("Grid") FROM table_51532 WHERE "Time/Retired" = '+1:03.741' AND "Laps" > '44'
Below are sql tables 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 total grid for a Time/Retired of +1:03.741, and Laps larger than 44? ### Input: CREATE TABLE table_51532 ( "D...
what was the total number of members in all the districts ?
CREATE TABLE table_204_699 ( id number, "district" text, "name" text, "party" text, "residence" text, "first served" number )
SELECT COUNT(*) FROM table_204_699
Below are sql tables 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 total number of members in all the districts ? ### Input: CREATE TABLE table_204_699 ( id number, "dist...
The teacher for PATH 643 is whom ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PATH' AND course.number = 643 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: The teacher for PATH 643 is whom ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar, description var...
when patient 006-71495 first got an operation until 3 years 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 patient ( uniquepid text, patientheal...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-71495')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CU...
Below are sql tables 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 006-71495 first got an operation until 3 years ago? ### Input: CREATE TABLE lab ( labid number, patient...
Name the Record of Visitor of toronto st. pats with a Score of 5 4 and a Home of ottawa senators? Question 5
CREATE TABLE table_8378 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
SELECT "Record" FROM table_8378 WHERE "Visitor" = 'toronto st. pats' AND "Score" = '5–4' AND "Home" = 'ottawa senators'
Below are sql tables 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 of Visitor of toronto st. pats with a Score of 5 4 and a Home of ottawa senators? Question 5 ### Input: CREA...
What is the average number of points for a team that played 17 games and had more than 15 losses?
CREATE TABLE table_15737 ( "Season" text, "Team Name" text, "Games" real, "Losses" real, "Points" real )
SELECT AVG("Points") FROM table_15737 WHERE "Games" = '17' AND "Losses" > '15'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of points for a team that played 17 games and had more than 15 losses? ### Input: CREATE TABLE ta...
what are the maximum total hospital costs involving a procedure called a tiss adj to valv ops nec?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid nu...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tiss adj to valv ops nec')) GROUP BY cost.hadm_id) AS t1
Below are sql tables 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 maximum total hospital costs involving a procedure called a tiss adj to valv ops nec? ### Input: CREATE TABLE o...
What is the date of the post-week 2 game with a result of l 16 10?
CREATE TABLE table_59375 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Date" FROM table_59375 WHERE "Week" > '2' AND "Result" = 'l 16–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 is the date of the post-week 2 game with a result of l 16 10? ### Input: CREATE TABLE table_59375 ( "Week" real, ...
among the patients of the 50s , what was the top four most frequent diagnoses?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among the patients of the 50s , what was the top four most frequent diagnoses? ### Input: CREATE TABLE inputevents_cv ( ...
how many asian patients had liver transplant as their primary disease?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "LIVER TRANSPLANT"
Below are sql tables 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 asian patients had liver transplant as their primary disease? ### Input: CREATE TABLE procedures ( subject_id t...
Return a bar chart about the distribution of password and gender_mf .
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Subject...
SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_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: Return a bar chart about the distribution of password and gender_mf . ### Input: CREATE TABLE Course_Authors_and_Tutors ( ...
give the number of patients whose diagnosis long title is intestinal infection due to clostridium difficile and lab test category is blood gas.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Intestinal infection due to Clostridium difficile" AND lab."CATEGORY" = "Blood Gas"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the number of patients whose diagnosis long title is intestinal infection due to clostridium difficile and lab test cat...
give me patient 94316's hospial admission time in 2103.
CREATE TABLE labevents ( row_id number, subject_id number, hadm_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 TABLE d_labitems ( row_id...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 94316 AND STRFTIME('%y', admissions.admittime) = '2103'
Below are sql tables 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 patient 94316's hospial admission time in 2103. ### Input: CREATE TABLE labevents ( row_id number, subject_i...
what is the average age of male patients who are 30 years or above?
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 AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.age >= "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 is the average age of male patients who are 30 years or above? ### Input: CREATE TABLE prescriptions ( subject_id t...
How big was the crowd of away team Richmond?
CREATE TABLE table_55612 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Crowd" FROM table_55612 WHERE "Away team" = 'richmond'
Below are sql tables 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 big was the crowd of away team Richmond? ### Input: CREATE TABLE table_55612 ( "Home team" text, "Home team scor...
Draw a bar chart of publisher versus the total number, and list in descending by the the total number .
CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text ) CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real )
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of publisher versus the total number, and list in descending by the the total number . ### Input: CREATE TA...
Show me a bar chart for what are the department names and how many employees work in each of them?
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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),...
SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_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: Show me a bar chart for what are the department names and how many employees work in each of them? ### Input: CREATE TABLE c...
count how many times patient 030-49739 came to the intensive care unit in this year.
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, ...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-49739') AND DATETIME(patient.unitadmittime, '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: count how many times patient 030-49739 came to the intensive care unit in this year. ### Input: CREATE TABLE allergy ( a...
when did patient 19040's last intake since 680 days ago occur?
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, d...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19040)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-680 day') ORDER...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 19040's last intake since 680 days ago occur? ### Input: CREATE TABLE prescriptions ( row_id number, ...
What was the record for the October 16 game?
CREATE TABLE table_29598 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "First Star" text, "Decision" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
SELECT "Record" FROM table_29598 WHERE "Date" = 'October 16'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the record for the October 16 game? ### Input: CREATE TABLE table_29598 ( "Game" real, "Date" text, "Op...
Which venue did Luke Blackwell serve as captain?
CREATE TABLE table_13514348_7 ( venue VARCHAR, captain VARCHAR )
SELECT venue FROM table_13514348_7 WHERE captain = "Luke Blackwell"
Below are sql tables 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 venue did Luke Blackwell serve as captain? ### Input: CREATE TABLE table_13514348_7 ( venue VARCHAR, captain V...
What is the Home team at corio oval?
CREATE TABLE table_name_57 ( home_team VARCHAR, venue VARCHAR )
SELECT home_team FROM table_name_57 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 Home team at corio oval? ### Input: CREATE TABLE table_name_57 ( home_team VARCHAR, venue VARCHAR ) ### ...
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 sum of employee_id bin hire_date by time, and rank y axis from high to low order.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_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 s...
How many members are in each party Show bar chart, and rank in desc by the y-axis.
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Fo...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) 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: How many members are in each party Show bar chart, and rank in desc by the y-axis. ### Input: CREATE TABLE member ( Memb...
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute All_Road.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Road
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the relationship between Team_ID and ACC_Percent , and group by attribute All_Road. ### Input: CREATE TABLE univer...
tell the competitions where the mean is 1
CREATE TABLE table_18807 ( "Rank by average" real, "Competition finish" real, "Couple" text, "Total" real, "Number of dances" real, "Average" text )
SELECT "Average" FROM table_18807 WHERE "Number of dances" = '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: tell the competitions where the mean is 1 ### Input: CREATE TABLE table_18807 ( "Rank by average" real, "Competition...
how many patients whose year of birth is less than 2087 and lab test fluid is joint fluid?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Joint Fluid"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose year of birth is less than 2087 and lab test fluid is joint fluid? ### Input: CREATE TABLE procedure...
Who are the directors of the episode in series # 54?
CREATE TABLE table_29095 ( "Series #" real, "Episode #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text )
SELECT "Director" FROM table_29095 WHERE "Series #" = '54'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who are the directors of the episode in series # 54? ### Input: CREATE TABLE table_29095 ( "Series #" real, "Episode...
Show the album names and ids for albums that contain tracks with unit price bigger than 1 Visualize by bar chart, and I want to list X-axis in descending order.
CREATE TABLE Invoice ( InvoiceId integer, CustomerId integer, InvoiceDate datetime, BillingAddress varchar(70), BillingCity varchar(40), BillingState varchar(40), BillingCountry varchar(40), BillingPostalCode varchar(10), Total decimal(10,2) ) CREATE TABLE PlaylistTrack ( Playli...
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.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: Show the album names and ids for albums that contain tracks with unit price bigger than 1 Visualize by bar chart, and I want...
How many people attended the Cleveland Browns game on November 11, 1979?
CREATE TABLE table_32675 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT MAX("Attendance") FROM table_32675 WHERE "Date" = 'november 11, 1979' AND "Week" > '11'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people attended the Cleveland Browns game on November 11, 1979? ### Input: CREATE TABLE table_32675 ( "Week" re...
what is admission type and death status of subject id 25167?
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 demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "25167"
Below are sql tables 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 admission type and death status of subject id 25167? ### Input: CREATE TABLE diagnoses ( subject_id text, ha...
who was the director of the episode with production code ad1a26?
CREATE TABLE table_54650 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
SELECT "Directed by" FROM table_54650 WHERE "Production code" = 'ad1a26'
Below are sql tables 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 director of the episode with production code ad1a26? ### Input: CREATE TABLE table_54650 ( "Title" text, ...
What is the lowest rank when Jianshu is smaller than 9.66, for Richard Devine ( gbr ), with a total smaller than 19.02?
CREATE TABLE table_12361 ( "Rank" real, "Athlete" text, "Qiangshu" real, "Jianshu" real, "Total" real )
SELECT MIN("Rank") FROM table_12361 WHERE "Jianshu" < '9.66' AND "Athlete" = 'richard devine ( gbr )' AND "Total" < '19.02'
Below are sql tables 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 rank when Jianshu is smaller than 9.66, for Richard Devine ( gbr ), with a total smaller than 19.02? ### ...
What was home team Essendon's opponents score?
CREATE TABLE table_33591 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_33591 WHERE "Home 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: What was home team Essendon's opponents score? ### Input: CREATE TABLE table_33591 ( "Home team" text, "Home team sc...
Show all artist names and ages in a histogram.
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Name, Age FROM artist
Below are sql tables 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 artist names and ages in a histogram. ### Input: CREATE TABLE exhibition ( Exhibition_ID int, Year int, ...
What was the crowd size when Geelong played at home?
CREATE TABLE table_name_58 ( crowd INTEGER, home_team VARCHAR )
SELECT AVG(crowd) FROM table_name_58 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: What was the crowd size when Geelong played at home? ### Input: CREATE TABLE table_name_58 ( crowd INTEGER, home_tea...
Show all artist names and the number of exhibitions for each artist.
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all artist names and the number of exhibitions for each artist. ### Input: CREATE TABLE exhibition_record ( Exhibit...
Which Competition has the Date July 1, 2000?
CREATE TABLE table_66734 ( "Goal" real, "Date" text, "Score" text, "Result" text, "Competition" text )
SELECT "Competition" FROM table_66734 WHERE "Date" = 'july 1, 2000'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Competition has the Date July 1, 2000? ### Input: CREATE TABLE table_66734 ( "Goal" real, "Date" text, "Sc...
What is 1st Leg, when Team 1 is 'Makedonija'?
CREATE TABLE table_7869 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
SELECT "1st leg" FROM table_7869 WHERE "Team 1" = 'makedonija'
Below are sql tables 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 1st Leg, when Team 1 is 'Makedonija'? ### Input: CREATE TABLE table_7869 ( "Team 1" text, "Agg." text, "...
Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, list Y-axis in asc order.
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(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: Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality,...
find how many hispanic or latino patients have been diagnosed under icd9 code v140.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.icd9_code = "V140"
Below are sql tables 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 how many hispanic or latino patients have been diagnosed under icd9 code v140. ### Input: CREATE TABLE diagnoses ( ...
When was the last SURVMETH 745 course offered ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) 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 var...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SURVMETH' AND course.number = 745 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the last SURVMETH 745 course offered ? ### Input: CREATE TABLE comment_instructor ( instructor_id int, stud...
what's the number of games with a Goals Against smaller than 14, and a Wins larger than 1, and a Draws smaller than 2, and a Goals For of 3?
CREATE TABLE table_name_27 ( games INTEGER, goals_for VARCHAR, draws VARCHAR, goals_against VARCHAR, wins VARCHAR )
SELECT MAX(games) FROM table_name_27 WHERE goals_against < 14 AND wins > 1 AND draws < 2 AND goals_for = 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 number of games with a Goals Against smaller than 14, and a Wins larger than 1, and a Draws smaller than 2, and a...
Show average of budget in different year and group by department creation time with a line chart, and order by the X-axis in descending.
CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE head ( head_ID int, name text, born_state tex...
SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation 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 average of budget in different year and group by department creation time with a line chart, and order by the X-axis in...
What is the average number of silvers for teams ranked 5 with 0 bronze?
CREATE TABLE table_name_31 ( silver INTEGER, rank VARCHAR, bronze VARCHAR )
SELECT AVG(silver) FROM table_name_31 WHERE rank = "5" AND bronze < 0
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of silvers for teams ranked 5 with 0 bronze? ### Input: CREATE TABLE table_name_31 ( silver I...
what is admission type of subject name stephanie suchan?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Stephanie Suchan"
Below are sql tables 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 admission type of subject name stephanie suchan? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_i...
What's the smallest season number?
CREATE TABLE table_30597 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
SELECT MIN("No. in season") FROM table_30597
Below are sql tables 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 season number? ### Input: CREATE TABLE table_30597 ( "No. in series" real, "No. in season" real,...
For each city, what is the highest latitude for its stations Visualize by bar chart, show in descending by the names.
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE weather ( date TEX...
SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY city DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each city, what is the highest latitude for its stations Visualize by bar chart, show in descending by the names. ### In...
what 's the number of people who attended the oklahoma game on 11/29/1985 ?
CREATE TABLE table_204_22 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number, "record" text )
SELECT "attendance" FROM table_204_22 WHERE "date" = '11/29/1985'
Below are sql tables 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 number of people who attended the oklahoma game on 11/29/1985 ? ### Input: CREATE TABLE table_204_22 ( id nu...
when was the last time patient 027-14712 had a foley cath output?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
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 = '027-14712')) AND intakeoutput.cellpath LIKE '%output%...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last time patient 027-14712 had a foley cath output? ### Input: CREATE TABLE microlab ( microlabid number, ...
what is the discharge time for the patient id 65759?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "65759"
Below are sql tables 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 discharge time for the patient id 65759? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id te...
tell me the number of male patients who were ordered granular casts 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.gender = "M" AND lab.label = "Granular Casts"
Below are sql tables 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 male patients who were ordered granular casts lab test. ### Input: CREATE TABLE demographic ( subj...
What day is south melbourne the away side?
CREATE TABLE table_33703 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_33703 WHERE "Away team" = 'south 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 day is south melbourne the away side? ### Input: CREATE TABLE table_33703 ( "Home team" text, "Home team score"...
What is the result for game 5?
CREATE TABLE table_name_65 ( result VARCHAR, game VARCHAR )
SELECT result FROM table_name_65 WHERE game = "game 5"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result for game 5? ### Input: CREATE TABLE table_name_65 ( result VARCHAR, game VARCHAR ) ### Response: ...
For each origin, how many flights came from there Show bar chart, I want to show from high to low by the the total number .
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each origin, how many flights came from there Show bar chart, I want to show from high to low by the the total number . ...
i would like to know the daily average amount of mvi that patient 31088 has received this month.
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT AVG(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i would like to know the daily average amount of mvi that patient 31088 has received this month. ### Input: CREATE TABLE inp...
what is the number of patients in careunit csru in the last year?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE chartevents ( row_id number, subject_id number, had...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 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: what is the number of patients in careunit csru in the last year? ### Input: CREATE TABLE icustays ( row_id number, ...
Show me a bar chart with the product name and their frequency, sort in ascending by the names.
CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_nam...
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY product_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart with the product name and their frequency, sort in ascending by the names. ### Input: CREATE TABLE Conta...
what is the sample size when the date(s) administered is march 24, 2010?
CREATE TABLE table_name_4 ( sample_size VARCHAR, date_s__administered VARCHAR )
SELECT sample_size FROM table_name_4 WHERE date_s__administered = "march 24, 2010"
Below are sql tables 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 sample size when the date(s) administered is march 24, 2010? ### Input: CREATE TABLE table_name_4 ( sample_s...
What was the minimum number of the episode that first aired August 11?
CREATE TABLE table_25691838_8 ( episode__number INTEGER, original_airdate VARCHAR )
SELECT MIN(episode__number) FROM table_25691838_8 WHERE original_airdate = "August 11"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the minimum number of the episode that first aired August 11? ### Input: CREATE TABLE table_25691838_8 ( episod...
specify the icu stay of patient id 22377
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 prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "22377"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the icu stay of patient id 22377 ### Input: CREATE TABLE demographic ( subject_id text, hadm_id text, na...
count the number of patients whose diagnoses short title is crbl art ocl nos w infrc and drug route is oral?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Crbl art ocl NOS w infrc" AND prescriptions.route = "ORAL"
Below are sql tables 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 crbl art ocl nos w infrc and drug route is oral? ### Input: CREA...
Which one of the tournaments had a QF in 1996?
CREATE TABLE table_name_42 ( tournament VARCHAR )
SELECT tournament FROM table_name_42 WHERE 1996 = "qf"
Below are sql tables 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 one of the tournaments had a QF in 1996? ### Input: CREATE TABLE table_name_42 ( tournament VARCHAR ) ### Response...
In what year is Zaxxon the Standalone?
CREATE TABLE table_name_88 ( year VARCHAR, standalone VARCHAR )
SELECT year FROM table_name_88 WHERE standalone = "zaxxon"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what year is Zaxxon the Standalone? ### Input: CREATE TABLE table_name_88 ( year VARCHAR, standalone VARCHAR ) ##...
Find All_Road and All_Games_Percent , and visualize them by a bar chart, display bar in asc order 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_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road
Below are sql tables 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 All_Road and All_Games_Percent , and visualize them by a bar chart, display bar in asc order please. ### Input: CREATE ...
A bar chart for what are the number of the first names of all students in Smith Hall?, and rank by the total number in desc.
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( S...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the first names of all students in Smith Hall?, and rank by the total number in desc....
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id.
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP 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 all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id an...
among patients tested for blood gas, how many of them were aged below 59?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab."CATEGORY" = "Blood Gas"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients tested for blood gas, how many of them were aged below 59? ### Input: CREATE TABLE diagnoses ( subject_id...
what is the yearly minimum eosinophils level of patient 50286 since 09/2104?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50286) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'eosinophils') AND STRFTIME('%y-%m', labevents.charttime) >= '2104-09' GROUP...
Below are sql tables 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 yearly minimum eosinophils level of patient 50286 since 09/2104? ### Input: CREATE TABLE inputevents_cv ( ro...
how many hours has it been since the first time in which patient 8888 was prescribed with furosemide on this hospital encounter?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'furosemide' ORDER BY prescriptions.startdate ...
Below are sql tables 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 has it been since the first time in which patient 8888 was prescribed with furosemide on this hospital encoun...
Visualize a bar chart about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, order in desc by the x axis.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home 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 about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, order in desc by the...
what is in 04/2105 average ph value of patient 003-29149?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-29149')) AND lab.labname = 'ph' AND STRFTIME('%y-%m', lab.labresulttime) = '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: what is in 04/2105 average ph value of patient 003-29149? ### Input: CREATE TABLE diagnosis ( diagnosisid number, pa...
What settlement is also called (hungarian: martonos)?
CREATE TABLE table_2562572_33 ( settlement VARCHAR, cyrillic_name_other_names VARCHAR )
SELECT settlement FROM table_2562572_33 WHERE cyrillic_name_other_names = "Мартонош (Hungarian: Martonos)"
Below are sql tables 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 settlement is also called (hungarian: martonos)? ### Input: CREATE TABLE table_2562572_33 ( settlement VARCHAR, ...
What is the lowest enrolled school that was founded in 1992 and joined a conference before 1998?
CREATE TABLE table_name_19 ( enrollment INTEGER, founded VARCHAR, joined_conference VARCHAR )
SELECT MIN(enrollment) FROM table_name_19 WHERE founded = "1992" AND joined_conference < 1998
Below are sql tables 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 enrolled school that was founded in 1992 and joined a conference before 1998? ### Input: CREATE TABLE tab...
Next semester , are there any ELI 320 sections that are not on Monday ?
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'ELI' AND course.number = 320 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.ye...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Next semester , are there any ELI 320 sections that are not on Monday ? ### Input: CREATE TABLE program ( program_id int...
how many days has it elapsed since patient 015-59552 was admitted to the hospital?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '015-59552' 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: how many days has it elapsed since patient 015-59552 was admitted to the hospital? ### Input: CREATE TABLE allergy ( all...
What is the lowest enrolled school that was founded in 1992 and joined a conference before 1998?
CREATE TABLE table_50469 ( "Institution" text, "Location" text, "Founded" text, "Joined Conference" real, "Enrollment" real, "Nickname" text )
SELECT MIN("Enrollment") FROM table_50469 WHERE "Founded" = '1992' AND "Joined Conference" < '1998'
Below are sql tables 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 enrolled school that was founded in 1992 and joined a conference before 1998? ### Input: CREATE TABLE tab...
Which away team had a crowd larger than 22,000 at the Western Oval venue?
CREATE TABLE table_4755 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_4755 WHERE "Crowd" > '22,000' AND "Venue" = 'western 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: Which away team had a crowd larger than 22,000 at the Western Oval venue? ### Input: CREATE TABLE table_4755 ( "Home tea...
find the minimum days for which patients aged 51 years or more stayed in hospital.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "51"
Below are sql tables 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 minimum days for which patients aged 51 years or more stayed in hospital. ### Input: CREATE TABLE diagnoses ( s...
Line chart, let hire data as X and salary as Y, and filter for employees without the letter M in their first name, and list by the X-axis in ascending 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, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY 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: Line chart, let hire data as X and salary as Y, and filter for employees without the letter M in their first name, and list ...
What is the record on December 4?
CREATE TABLE table_77673 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
SELECT "Record" FROM table_77673 WHERE "Date" = 'december 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 record on December 4? ### Input: CREATE TABLE table_77673 ( "Date" text, "Visitor" text, "Score" tex...
What Opponent has an Attendance of 74,246?
CREATE TABLE table_52803 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Opponent" FROM table_52803 WHERE "Attendance" = '74,246'
Below are sql tables 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 Opponent has an Attendance of 74,246? ### Input: CREATE TABLE table_52803 ( "Week" real, "Date" text, "Oppo...
Can I take the course DHYGRACK 682 right now ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
SELECT COUNT(*) > 0 FROM course, course_offering, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'DHYGRACK' AND course.number = 682 AND offering_instructor.offering_id = course_offering.offering_id AND semester.semester = 'WN' AND 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: Can I take the course DHYGRACK 682 right now ? ### Input: CREATE TABLE student_record ( student_id int, course_id in...
What was the award before 2001?
CREATE TABLE table_45343 ( "Year" real, "Nominated Work" text, "Award" text, "Category" text, "Result" text )
SELECT "Award" FROM table_45343 WHERE "Year" < '2001'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the award before 2001? ### Input: CREATE TABLE table_45343 ( "Year" real, "Nominated Work" text, "Award...