instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
What are all the states (class) when the reason for change was resigned November 26, 1798 and the vacator was John Hunter ( DR )?
CREATE TABLE table_224839_3 ( state__class_ VARCHAR, reason_for_change VARCHAR, vacator VARCHAR )
SELECT state__class_ FROM table_224839_3 WHERE reason_for_change = "Resigned November 26, 1798" AND vacator = "John Hunter ( DR )"
Below are sql tables 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 all the states (class) when the reason for change was resigned November 26, 1798 and the vacator was John Hunter ( ...
What was the loss of the game attended by 29,704?
CREATE TABLE table_name_21 ( loss VARCHAR, attendance VARCHAR )
SELECT loss FROM table_name_21 WHERE attendance = "29,704"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the loss of the game attended by 29,704? ### Input: CREATE TABLE table_name_21 ( loss VARCHAR, attendance V...
with a record of 63-76 what was the attendance?
CREATE TABLE table_11263 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Attendance" FROM table_11263 WHERE "Record" = '63-76'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: with a record of 63-76 what was the attendance? ### Input: CREATE TABLE table_11263 ( "Date" text, "Opponent" text, ...
Round 1 of 71 has how many highest money?
CREATE TABLE table_name_33 ( money__ INTEGER, round_1 VARCHAR )
SELECT MAX(money__) AS $_ FROM table_name_33 WHERE round_1 = "71"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Round 1 of 71 has how many highest money? ### Input: CREATE TABLE table_name_33 ( money__ INTEGER, round_1 VARCHAR )...
Draw a bar chart about the distribution of Time and meter_100 .
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 Time, meter_100 FROM swimmer
Below are sql tables 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 Time and meter_100 . ### Input: CREATE TABLE record ( ID int, Result text...
How many episodes had 11.47 million viewers?
CREATE TABLE table_24689168_5 ( episode VARCHAR, viewers__millions_ VARCHAR )
SELECT COUNT(episode) FROM table_24689168_5 WHERE viewers__millions_ = "11.47"
Below are sql tables 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 episodes had 11.47 million viewers? ### Input: CREATE TABLE table_24689168_5 ( episode VARCHAR, viewers__mi...
find the number of female patients who have long term care hospital discharge.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
Below are sql tables 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 female patients who have long term care hospital discharge. ### Input: CREATE TABLE demographic ( sub...
count the number of patients whose diagnoses icd9 code is e8791?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "E8791"
Below are sql tables 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 icd9 code is e8791? ### Input: CREATE TABLE procedures ( subject_id text, ...
What is the total of crowd at Venue of mcg?
CREATE TABLE table_56917 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT SUM("Crowd") FROM table_56917 WHERE "Venue" = 'mcg'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total of crowd at Venue of mcg? ### Input: CREATE TABLE table_56917 ( "Home team" text, "Home team score...
how many number of patients had the item id 51255?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51255"
Below are sql tables 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 number of patients had the item id 51255? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, ...
What is the average attendance on October 9, 1983?
CREATE TABLE table_55985 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT AVG("Attendance") FROM table_55985 WHERE "Date" = 'october 9, 1983'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average attendance on October 9, 1983? ### Input: CREATE TABLE table_55985 ( "Week" real, "Date" text, ...
Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, and sort from high to low by the dept_name.
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester v...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_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: Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, and s...
How many students are living in a dorm with a TV Lounge? Show a bar chart grouping by first name, and rank by the Y in ascending.
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 Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname ORDER BY COUNT(Fname)
Below are sql tables 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 students are living in a dorm with a TV Lounge? Show a bar chart grouping by first name, and rank by the Y in ascen...
what is minimum age of patients whose admission type is urgent and year of birth is greater than 2090?
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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2090"
Below are sql tables 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 minimum age of patients whose admission type is urgent and year of birth is greater than 2090? ### Input: CREATE TAB...
What is the total when gold is 1, and rank is more than 4, and bronze is 0?
CREATE TABLE table_name_1 ( total VARCHAR, bronze VARCHAR, gold VARCHAR, rank VARCHAR )
SELECT COUNT(total) FROM table_name_1 WHERE gold = 1 AND rank > 4 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 total when gold is 1, and rank is more than 4, and bronze is 0? ### Input: CREATE TABLE table_name_1 ( total...
count the number of patients whose discharge location is disc-tran cancer/chldrn h and procedure short title is temporary colostomy?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Temporary colostomy"
Below are sql tables 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 discharge location is disc-tran cancer/chldrn h and procedure short title is temporary co...
who are the candidates where the district is florida 8?
CREATE TABLE table_18340 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "Candidates" FROM table_18340 WHERE "District" = 'Florida 8'
Below are sql tables 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 candidates where the district is florida 8? ### Input: CREATE TABLE table_18340 ( "District" text, "Incu...
Name the incumbent for alabama 6
CREATE TABLE table_19753079_4 ( incumbent VARCHAR, district VARCHAR )
SELECT incumbent FROM table_19753079_4 WHERE district = "Alabama 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 incumbent for alabama 6 ### Input: CREATE TABLE table_19753079_4 ( incumbent VARCHAR, district VARCHAR ) ##...
Draw a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, and I want to rank by the how many nationality from high to low.
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(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 amount of Nationality , and group by attribute Nationality, a...
what number of patients whose hospital stay is more than 15 days were given the drug named niacin?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "15" AND prescriptions.drug = "Niacin"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of patients whose hospital stay is more than 15 days were given the drug named niacin? ### Input: CREATE TABLE d...
history of any heart disease including coronary artery disease
CREATE TABLE table_dev_8 ( "id" int, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "diastolic_blood_pressure_dbp" int, "coronary_artery_disease_cad" bool, "triglyceride_tg" float, "hypertension" bool, "NOUSE" float )
SELECT * FROM table_dev_8 WHERE heart_disease = 1 OR coronary_artery_disease_cad = 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: history of any heart disease including coronary artery disease ### Input: CREATE TABLE table_dev_8 ( "id" int, "syst...
List all directors along with the number of films directed by each director Plot them as bar chart, I want to show total number in ascending order.
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Directed_by, COUNT(*) FROM film GROUP BY Directed_by 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: List all directors along with the number of films directed by each director Plot them as bar chart, I want to show total num...
How many people attended the Rams game against the Kansas City Chiefs?
CREATE TABLE table_33249 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Attendance" FROM table_33249 WHERE "Opponent" = 'kansas city chiefs'
Below are sql tables 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 Rams game against the Kansas City Chiefs? ### Input: CREATE TABLE table_33249 ( "Week" real...
How many entries have a speed of exactly 2.53 GHz?
CREATE TABLE table_29200 ( "model" text, "Speed (GHz)" text, "L3 Cache (MB)" real, "QPI speed (GT/s)" text, "DDR3 Clock (MHz)" real, "TDP (W)" real, "Cores" real, "Threads" real, "Turbo-Boost" text )
SELECT COUNT("Cores") FROM table_29200 WHERE "Speed (GHz)" = '2.53'
Below are sql tables 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 entries have a speed of exactly 2.53 GHz? ### Input: CREATE TABLE table_29200 ( "model" text, "Speed (GHz)"...
give the number of patients whose lab test item id 51221 and lab test result is delta.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51221" AND lab.flag = "delta"
Below are sql tables 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 lab test item id 51221 and lab test result is delta. ### Input: CREATE TABLE diagnoses ( ...
what is the game on june 29?
CREATE TABLE table_76285 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
SELECT SUM("Game") FROM table_76285 WHERE "Date" = 'june 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: what is the game on june 29? ### Input: CREATE TABLE table_76285 ( "Game" real, "Date" text, "Opponent" text, ...
What rank is Takat riki having less than 30 total?
CREATE TABLE table_name_60 ( highest_rank VARCHAR, total VARCHAR, name VARCHAR )
SELECT highest_rank FROM table_name_60 WHERE total < 30 AND name = "takatōriki"
Below are sql tables 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 rank is Takat riki having less than 30 total? ### Input: CREATE TABLE table_name_60 ( highest_rank VARCHAR, tot...
Which college had a pick in a round under 7, with a pick number 13 and overall was under 186?
CREATE TABLE table_name_6 ( college VARCHAR, pick VARCHAR, round VARCHAR, overall VARCHAR )
SELECT college FROM table_name_6 WHERE round < 7 AND overall < 186 AND pick = 13
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which college had a pick in a round under 7, with a pick number 13 and overall was under 186? ### Input: CREATE TABLE table_...
What is the average last cf of the st. louis blues, who has less than 4 cf appearances and less than 1 cf wins?
CREATE TABLE table_name_44 ( last_cf INTEGER, team VARCHAR, cf_appearances VARCHAR, cf_wins VARCHAR )
SELECT AVG(last_cf) FROM table_name_44 WHERE cf_appearances < 4 AND cf_wins < 1 AND team = "st. louis blues"
Below are sql tables 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 last cf of the st. louis blues, who has less than 4 cf appearances and less than 1 cf wins? ### Input: C...
What is the average played for entries with fewer than 65 goals against, points 1 of 19 2, and a position higher than 15?
CREATE TABLE table_78889 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
SELECT AVG("Played") FROM table_78889 WHERE "Position" < '15' AND "Points 1" = '19 2' AND "Goals Against" < '65'
Below are sql tables 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 played for entries with fewer than 65 goals against, points 1 of 19 2, and a position higher than 15? ##...
did patient 18866 have a respiratory rate that was greater than 12.0 in 12/2105?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(*) > 0 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 = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 18866 have a respiratory rate that was greater than 12.0 in 12/2105? ### Input: CREATE TABLE outputevents ( ...
tell me the number of times patient 2514 had taken lipids 20% on 07/13/this year.
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 diagnoses_icd ( row_id numbe...
SELECT COUNT(*) 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 = 2514)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'lipids 20%' A...
Below are sql tables 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 times patient 2514 had taken lipids 20% on 07/13/this year. ### Input: CREATE TABLE d_labitems ( r...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of phone_number and salary , and display X in ascending order please.
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 PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
Below are sql tables 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, visualize a bar chart ab...
give me the number of patients whose admission year is less than 2172 and procedure long title is aortography?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2172" AND procedures.long_title = "Aortography"
Below are sql tables 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 admission year is less than 2172 and procedure long title is aortography? ### Input: CR...
Show me about the distribution of ACC_Regular_Season and All_Games_Percent in a bar chart, and list Y-axis from high to low order.
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 ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_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 ACC_Regular_Season and All_Games_Percent in a bar chart, and list Y-axis from high to low ...
How many buildings are managed by 'Kyle'? Return a bar chart grouping by apartment type codes, and sort from high to low by the total number.
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartments ( apt_id INTEGER, ...
SELECT apt_type_code, COUNT(apt_type_code) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" GROUP BY apt_type_code ORDER BY COUNT(apt_type_code) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many buildings are managed by 'Kyle'? Return a bar chart grouping by apartment type codes, and sort from high to low by ...
What courses offer 17 credit hours ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
SELECT DISTINCT name, number FROM course WHERE credits = 17 AND department = 'EECS'
Below are sql tables 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 courses offer 17 credit hours ? ### Input: CREATE TABLE requirement ( requirement_id int, requirement varchar, ...
Find the name of the department which has the highest average salary of professors.
CREATE TABLE instructor ( dept_name VARCHAR, salary INTEGER )
SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) 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: Find the name of the department which has the highest average salary of professors. ### Input: CREATE TABLE instructor ( ...
What was the position for 2008, where 2012 was q1, and 2010 was 1r?
CREATE TABLE table_54118 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "2008" FROM table_54118 WHERE "2012" = 'q1' AND "2010" = '1r'
Below are sql tables 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 position for 2008, where 2012 was q1, and 2010 was 1r? ### Input: CREATE TABLE table_54118 ( "Tournament" t...
show me the respiration change in patient 027-136480 second measured on the current icu visit compared to the first value measured on the current icu visit?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480') AND patient.unitdischargetime IS N...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the respiration change in patient 027-136480 second measured on the current icu visit compared to the first value me...
calculate the number of patients on government insurance who had colonoscopy
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Colonoscopy"
Below are sql tables 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 number of patients on government insurance who had colonoscopy ### Input: CREATE TABLE lab ( subject_id te...
What is the nationality for the guard position from Bowling Green?
CREATE TABLE table_name_47 ( nationality VARCHAR, position VARCHAR, school_club_team VARCHAR )
SELECT nationality FROM table_name_47 WHERE position = "guard" AND school_club_team = "bowling green"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the nationality for the guard position from Bowling Green? ### Input: CREATE TABLE table_name_47 ( nationality V...
give the minimum age of patients with rash who stayed in the hospital for 14 days.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.days_stay = "14"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give the minimum age of patients with rash who stayed in the hospital for 14 days. ### Input: CREATE TABLE lab ( subject...
Visualize the relationship between ACC_Percent and All_Games_Percent , and group by attribute All_Neutral.
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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
Below are sql tables 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 ACC_Percent and All_Games_Percent , and group by attribute All_Neutral. ### Input: CREATE...
earliest flight from ATLANTA to PHILADELPHIA
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varch...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILA...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: earliest flight from ATLANTA to PHILADELPHIA ### Input: CREATE TABLE compartment_class ( compartment varchar, class_...
Who was the home team that scored 10.12 (72)?
CREATE TABLE table_33313 ( "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_33313 WHERE "Home team score" = '10.12 (72)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team that scored 10.12 (72)? ### Input: CREATE TABLE table_33313 ( "Home team" text, "Home team sco...
What episode number had 14.41 million viewers?
CREATE TABLE table_29640 ( "Season" text, "Episodes" real, "Timeslot ( EST )" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank" text, "Viewers (in millions)" text )
SELECT MAX("Episodes") FROM table_29640 WHERE "Viewers (in millions)" = '14.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 episode number had 14.41 million viewers? ### Input: CREATE TABLE table_29640 ( "Season" text, "Episodes" real,...
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of revenue , and group by attribute name, and could you show bars in descending order?
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the aver...
how many patients have drug code oxym15?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "OXYM15"
Below are sql tables 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 drug code oxym15? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid tex...
how many patients have undergone a circumcision within the same hospital visit after having been diagnosed with personal history of fall, last year?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_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: how many patients have undergone a circumcision within the same hospital visit after having been diagnosed with personal his...
what was the total amount of i.v. that patient 035-17122 had received until 1621 days ago?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT 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 = '035-17122')) AND intakeoutput.celllabel = 'i.v.'...
Below are sql tables 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 amount of i.v. that patient 035-17122 had received until 1621 days ago? ### Input: CREATE TABLE lab ( ...
Top 200 Users from Romania.
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bihor%' ORDER BY Reputation DESC LIMIT 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: Top 200 Users from Romania. ### Input: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) ...
Tell me the average spectators for 2006-06-21 and time more than 21
CREATE TABLE table_name_56 ( spectators INTEGER, date VARCHAR, time_cet_ VARCHAR )
SELECT AVG(spectators) FROM table_name_56 WHERE date = "2006-06-21" AND time_cet_ > 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: Tell me the average spectators for 2006-06-21 and time more than 21 ### Input: CREATE TABLE table_name_56 ( spectators I...
For those employees who did not have any job in the past, give me the comparison about the sum of salary over the hire_date bin hire_date by time, and could you rank by the y-axis in asc?
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 varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(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 did not have any job in the past, give me the comparison about the sum of salary over the hire_date ...
What was the TO par for the player who scored 68-71=139?
CREATE TABLE table_78698 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "To par" FROM table_78698 WHERE "Score" = '68-71=139'
Below are sql tables 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 TO par for the player who scored 68-71=139? ### Input: CREATE TABLE table_78698 ( "Place" text, "Player...
what is the first year there was a triple crown winner ?
CREATE TABLE table_200_3 ( id number, "year" number, "winner" text, "jockey" text, "trainer" text, "owner" text, "breeder" text )
SELECT MIN("year") FROM table_200_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 is the first year there was a triple crown winner ? ### Input: CREATE TABLE table_200_3 ( id number, "year" num...
what are the top three drug most frequently prescribed in 2101?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom t...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE STRFTIME('%y', prescriptions.startdate) = '2101' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 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 are the top three drug most frequently prescribed in 2101? ### Input: CREATE TABLE procedures_icd ( row_id number, ...
Give me a histogram for how many members are in each party?, display by the Y from low to high.
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name 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 tex...
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(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a histogram for how many members are in each party?, display by the Y from low to high. ### Input: CREATE TABLE part...
find out the time of admission and days for which patient with patient id 66411 stayed in hospital.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "66411"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find out the time of admission and days for which patient with patient id 66411 stayed in hospital. ### Input: CREATE TABLE ...
What is the Score with a Date with may 2?
CREATE TABLE table_57751 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Series" text )
SELECT "Score" FROM table_57751 WHERE "Date" = 'may 2'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Score with a Date with may 2? ### Input: CREATE TABLE table_57751 ( "Date" text, "Visitor" text, "Sc...
when was the first time patient 011-31236's procedure was performed in 2101?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
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 = '011-31236')) AND STRFTIME('%y', treatment.treatmenttime) = '2101'...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time patient 011-31236's procedure was performed in 2101? ### Input: CREATE TABLE intakeoutput ( inta...
What is the record when they play the canucks and have under 98 points?
CREATE TABLE table_name_61 ( record VARCHAR, points VARCHAR, opponent VARCHAR )
SELECT record FROM table_name_61 WHERE points < 98 AND opponent = "canucks"
Below are sql tables 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 when they play the canucks and have under 98 points? ### Input: CREATE TABLE table_name_61 ( record V...
Does 482 contain a lab ?
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, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 482
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Does 482 contain a lab ? ### Input: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz ...
Which awards happened more recently than 2005?
CREATE TABLE table_75779 ( "Year" real, "Film" text, "Awards" text, "Category" text, "Result" text )
SELECT "Awards" FROM table_75779 WHERE "Year" > '2005'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which awards happened more recently than 2005? ### Input: CREATE TABLE table_75779 ( "Year" real, "Film" text, "...
Who is the home captain when the venue is adelaide oval?
CREATE TABLE table_name_81 ( home_captain VARCHAR, venue VARCHAR )
SELECT home_captain FROM table_name_81 WHERE venue = "adelaide 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: Who is the home captain when the venue is adelaide oval? ### Input: CREATE TABLE table_name_81 ( home_captain VARCHAR, ...
Give me the comparison about meter_100 over the meter_700 , and I want to rank y axis from low to high order.
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_100
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the comparison about meter_100 over the meter_700 , and I want to rank y axis from low to high order. ### Input: CRE...
give me the number of patients whose age is less than 61 and lab test category is hematology?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab."CATEGORY" = "Hematology"
Below are sql tables 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 age is less than 61 and lab test category is hematology? ### Input: CREATE TABLE lab ( ...
Calculate the total number of patients on elective admission before the year 2108
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2108"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Calculate the total number of patients on elective admission before the year 2108 ### Input: CREATE TABLE demographic ( ...
How many tries were there for club cwmtwrch rfc?
CREATE TABLE table_61674 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
SELECT "Tries against" FROM table_61674 WHERE "Club" = 'cwmtwrch rfc'
Below are sql tables 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 tries were there for club cwmtwrch rfc? ### Input: CREATE TABLE table_61674 ( "Club" text, "Played" text, ...
what is patient 002-30259's length of stay of the last hospital stay.
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '002-30259' AND NOT patient.hospitaladmittime 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 is patient 002-30259's length of stay of the last hospital stay. ### Input: CREATE TABLE patient ( uniquepid text, ...
provide the number of patients whose diagnosis icd9 code is 56731 and lab test category is blood gas.
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "56731" 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: provide the number of patients whose diagnosis icd9 code is 56731 and lab test category is blood gas. ### Input: CREATE TABL...
Stacked bar chart of team_id for with each All_Home in each acc road, I want to order from high to low by the ACC_Road.
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 ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road 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: Stacked bar chart of team_id for with each All_Home in each acc road, I want to order from high to low by the ACC_Road. ### ...
what is the number of patients whose admission type is urgent and procedure short title is colonoscopy?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Colonoscopy"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is urgent and procedure short title is colonoscopy? ### Input: CREATE TA...
flights from ATLANTA to WASHINGTON on thursday morning
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
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 = 'WASHINGTON' AND date_day.day_number = 24 AND date_day.month_number = 5 A...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from ATLANTA to WASHINGTON on thursday morning ### Input: CREATE TABLE airline ( airline_code varchar, airli...
Get me the number of hispanic or latino-puerto rican patients who have diagnoses icd9 code 69514.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.icd9_code = "69514"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Get me the number of hispanic or latino-puerto rican patients who have diagnoses icd9 code 69514. ### Input: CREATE TABLE pr...
provide the number of patients whose discharge location is long term care hospital and procedure short title is form cutan ileoureterost?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.short_title = "Form cutan ileoureterost"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose discharge location is long term care hospital and procedure short title is form cutan i...
Who was from Great Britain in lanes under number 3?
CREATE TABLE table_name_1 ( name VARCHAR, lane VARCHAR, nationality VARCHAR )
SELECT name FROM table_name_1 WHERE lane < 3 AND nationality = "great britain"
Below are sql tables 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 from Great Britain in lanes under number 3? ### Input: CREATE TABLE table_name_1 ( name VARCHAR, lane VARCHA...
Is MUSICOL 566 offered 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 = 'MUSICOL' AND COURSEalias0.numbe...
Below are sql tables 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 MUSICOL 566 offered every semester ? ### Input: CREATE TABLE course_offering ( offering_id int, course_id int, ...
Show me the total number by studio in a histogram, and rank by the Y in descending please.
CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Mar...
SELECT Studio, COUNT(*) FROM film GROUP BY Studio 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: Show me the total number by studio in a histogram, and rank by the Y in descending please. ### Input: CREATE TABLE film ( ...
What is the average week for the game against baltimore colts with less than 41,062 in attendance?
CREATE TABLE table_name_12 ( week INTEGER, opponent VARCHAR, attendance VARCHAR )
SELECT AVG(week) FROM table_name_12 WHERE opponent = "baltimore colts" AND attendance < 41 OFFSET 062
Below are sql tables 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 week for the game against baltimore colts with less than 41,062 in attendance? ### Input: CREATE TABLE t...
The upper-level classes , are they all worth 1 credits ?
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_gradu...
SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 1 AND course.department = 'EECS' AND 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: The upper-level classes , are they all worth 1 credits ? ### Input: CREATE TABLE course_prerequisite ( pre_course_id int...
flight information on 1 23 from DENVER to SAN FRANCISCO
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
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 = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = 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: flight information on 1 23 from DENVER to SAN FRANCISCO ### Input: CREATE TABLE city ( city_code varchar, city_name ...
during the first hospital encounter, how much did patient 012-169 weigh for the first time?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-169' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY pat...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during the first hospital encounter, how much did patient 012-169 weigh for the first time? ### Input: CREATE TABLE medicati...
the town with at most 1660 total population
CREATE TABLE table_203_459 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text )
SELECT "township" FROM table_203_459 WHERE "population" = 1660
Below are sql tables 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 town with at most 1660 total population ### Input: CREATE TABLE table_203_459 ( id number, "township" text, ...
Which Player has a Round larger than 5, and a Position of (g)?
CREATE TABLE table_48042 ( "Round" real, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Club Team" text )
SELECT "Player" FROM table_48042 WHERE "Round" > '5' AND "Position" = '(g)'
Below are sql tables 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 Player has a Round larger than 5, and a Position of (g)? ### Input: CREATE TABLE table_48042 ( "Round" real, "...
Show the number of different competition types with a bar graph, sort the number of competition type from high to low order.
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) C...
SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type ORDER BY COUNT(Competition_type) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of different competition types with a bar graph, sort the number of competition type from high to low order....
what was the difference between the total input and the total output of patient 19412 in yesterday?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_...
Below are sql tables 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 difference between the total input and the total output of patient 19412 in yesterday? ### Input: CREATE TABLE ...
what is admission type and days of hospital stay of subject id 5027?
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 demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.subject_id = "5027"
Below are sql tables 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 days of hospital stay of subject id 5027? ### Input: CREATE TABLE procedures ( subject_id tex...
large-scale datasets used in image classification
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( pape...
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'image classification' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: large-scale datasets used in image classification ### Input: CREATE TABLE paperfield ( fieldid int, paperid int ) C...
Return the number of the completion date for all the tests that have 'Fail' result, and list Y in asc order.
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_des...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY COUNT(date_of_completion)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the number of the completion date for all the tests that have 'Fail' result, and list Y in asc order. ### Input: CREA...
How many weeks have a Date of december 4, 1976, and an Attendance larger than 57,366?
CREATE TABLE table_9683 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT SUM("Week") FROM table_9683 WHERE "Date" = 'december 4, 1976' AND "Attendance" > '57,366'
Below are sql tables 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 weeks have a Date of december 4, 1976, and an Attendance larger than 57,366? ### Input: CREATE TABLE table_9683 ( ...
Stack bar chart of team_id vs ACC_Home based on all home, and could you display Y 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_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_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: Stack bar chart of team_id vs ACC_Home based on all home, and could you display Y in asc order please? ### Input: CREATE TAB...
list the flights on friday afternoon from PHILADELPHIA to OAKLAND
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time 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 (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the flights on friday afternoon from PHILADELPHIA to OAKLAND ### Input: CREATE TABLE days ( days_code varchar, ...
when did patient 018-81471 first get discharged from the hospital?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '018-81471' ORDER BY patient.hospitaldischargetime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 018-81471 first get discharged from the hospital? ### Input: CREATE TABLE intakeoutput ( intakeoutputid...
Name the archive for run time of 23:55
CREATE TABLE table_2102782_1 ( archive VARCHAR, run_time VARCHAR )
SELECT archive FROM table_2102782_1 WHERE run_time = "23:55"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the archive for run time of 23:55 ### Input: CREATE TABLE table_2102782_1 ( archive VARCHAR, run_time VARCHAR )...
What is the smallest diameter for Eirene Tholus?
CREATE TABLE table_name_97 ( diameter__km_ INTEGER, name VARCHAR )
SELECT MIN(diameter__km_) FROM table_name_97 WHERE name = "eirene tholus"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest diameter for Eirene Tholus? ### Input: CREATE TABLE table_name_97 ( diameter__km_ INTEGER, name...
all flights from WASHINGTON to SAN FRANCISCO leaving after 200
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops 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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 200 AND flight.to_airport = AIRPORT_SERVICE_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: all flights from WASHINGTON to SAN FRANCISCO leaving after 200 ### Input: CREATE TABLE flight ( aircraft_code_sequence t...
What time slots have a 6.3 rating
CREATE TABLE table_11244302_1 ( time_slot__est_ VARCHAR, rating VARCHAR )
SELECT time_slot__est_ FROM table_11244302_1 WHERE rating = "6.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 time slots have a 6.3 rating ### Input: CREATE TABLE table_11244302_1 ( time_slot__est_ VARCHAR, rating VARCHAR...
i need a sunday flight from TAMPA to CHARLOTTE
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
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 = 'CHARLOTTE' AND date_day.day_number = 27 AND date_day.month_number = 8 AND...
Below are sql tables 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 need a sunday flight from TAMPA to CHARLOTTE ### Input: CREATE TABLE time_zone ( time_zone_code text, time_zone_na...
When was the game played at Moorabbin Oval?
CREATE TABLE table_10206 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_10206 WHERE "Venue" = 'moorabbin oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the game played at Moorabbin Oval? ### Input: CREATE TABLE table_10206 ( "Home team" text, "Home team score...