instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
when was patient 15968 first measured a arterial bp [diastolic]?
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 chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15968)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
Below are sql tables 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 patient 15968 first measured a arterial bp [diastolic]? ### Input: CREATE TABLE prescriptions ( row_id number, ...
what is the number of patients whose death status is 0 and procedure icd9 code is 331?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "331"
Below are sql tables 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 death status is 0 and procedure icd9 code is 331? ### Input: CREATE TABLE prescriptions...
how many patients with primary disease mesenteric ischemia are age less than 51 years?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND 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: how many patients with primary disease mesenteric ischemia are age less than 51 years? ### Input: CREATE TABLE procedures ( ...
Return a histogram on what are the names and budgets of departments with budgets greater than the average?, and sort in ascending by the Y please.
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min...
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget
Below are sql tables 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 histogram on what are the names and budgets of departments with budgets greater than the average?, and sort in asce...
For those employees whose first name is ending with the letter m, sum their salary for visualizing a bar chart, could you sort by the total number in ascending please?
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME 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 whose first name is ending with the letter m, sum their salary for visualizing a bar chart, could you so...
how many patients whose gender is m and lab test name is ferritin?
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 = "Ferritin"
Below are sql tables 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 gender is m and lab test name is ferritin? ### Input: CREATE TABLE demographic ( subject_id text...
what are the original air dates with a production code of 2394087
CREATE TABLE table_16365 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text )
SELECT "Original air date" FROM table_16365 WHERE "Production code" = '2394087'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the original air dates with a production code of 2394087 ### Input: CREATE TABLE table_16365 ( "No. in series" ...
For events that have more than one participant, count the event details for a bar chart, and list in ascending by the bars please.
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID...
SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details ORDER BY Event_Details
Below are sql tables 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 events that have more than one participant, count the event details for a bar chart, and list in ascending by the bars p...
Who played River Plate?
CREATE TABLE table_17282875_3 ( team__number2 VARCHAR, team__number1 VARCHAR )
SELECT team__number2 FROM table_17282875_3 WHERE team__number1 = "River Plate"
Below are sql tables 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 played River Plate? ### Input: CREATE TABLE table_17282875_3 ( team__number2 VARCHAR, team__number1 VARCHAR ) ##...
what is lab test category 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id 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 lab test category of subject name stephanie suchan? ### Input: CREATE TABLE diagnoses ( subject_id text, had...
Name the candidates where incumbent Carl Vinson is?
CREATE TABLE table_1341884_12 ( candidates VARCHAR, incumbent VARCHAR )
SELECT candidates FROM table_1341884_12 WHERE incumbent = "Carl Vinson"
Below are sql tables 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 candidates where incumbent Carl Vinson is? ### Input: CREATE TABLE table_1341884_12 ( candidates VARCHAR, i...
Name the total number of attendance for october 8
CREATE TABLE table_68733 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Series" text )
SELECT COUNT("Attendance") FROM table_68733 WHERE "Date" = 'october 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: Name the total number of attendance for october 8 ### Input: CREATE TABLE table_68733 ( "Date" text, "Opponent" text...
Find the number of the enrollment date for all the tests that have 'Pass' result, and could you order by the Y-axis in desc?
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATE...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of the enrollment date for all the tests that have 'Pass' result, and could you order by the Y-axis in desc?...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the amount of job_id , and group by attribute job_id, and show Y-axis in descending order.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the amount of job_id ,...
How many episodes in the series are also episode 18 in the season?
CREATE TABLE table_26112 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
SELECT COUNT("No. in series") FROM table_26112 WHERE "No. in season" = '18'
Below are sql tables 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 in the series are also episode 18 in the season? ### Input: CREATE TABLE table_26112 ( "No. in series"...
who is the the incumbent with opponent being peter king (r) 56.0% david mejias (d) 44.0%
CREATE TABLE table_13833770_3 ( incumbent VARCHAR, opponent VARCHAR )
SELECT incumbent FROM table_13833770_3 WHERE opponent = "Peter King (R) 56.0% David Mejias (D) 44.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: who is the the incumbent with opponent being peter king (r) 56.0% david mejias (d) 44.0% ### Input: CREATE TABLE table_13833...
show me BOSTON to OAKLAND flights
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, ...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND...
Below are sql tables 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 BOSTON to OAKLAND flights ### Input: CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight...
what is the total number of patients with icd9 code 2875 who were aged below 71?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "71" AND diagnoses.icd9_code = "2875"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of patients with icd9 code 2875 who were aged below 71? ### Input: CREATE TABLE lab ( subject_i...
Which position was picked before 63, for Oklahoma College?
CREATE TABLE table_name_46 ( position VARCHAR, pick VARCHAR, college VARCHAR )
SELECT position FROM table_name_46 WHERE pick < 63 AND college = "oklahoma"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which position was picked before 63, for Oklahoma College? ### Input: CREATE TABLE table_name_46 ( position VARCHAR, ...
Give me a histogram for how many students play each sport?, sort from high to low by the Y.
CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) 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 how many students play each sport?, sort from high to low by the Y. ### Input: CREATE TABLE SportsIn...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, and sort by the y axis from low to high please.
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_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, draw a bar chart about the distribution of hire_date and ...
List all upper-level class that are 1 credits .
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 area ( course_id int, area varchar ) CREATE TABLE gsi ( course_offeri...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS'
Below are sql tables 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 upper-level class that are 1 credits . ### Input: CREATE TABLE student_record ( student_id int, course_id i...
Who did they play when there were only 751 in attendance?
CREATE TABLE table_name_78 ( opponent VARCHAR, attendance INTEGER )
SELECT opponent FROM table_name_78 WHERE attendance < 751
Below are sql tables 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 did they play when there were only 751 in attendance? ### Input: CREATE TABLE table_name_78 ( opponent VARCHAR, ...
how did patient 27242 first come to the hospital.
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, s...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 27242 ORDER BY admissions.admittime 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: how did patient 27242 first come to the hospital. ### Input: CREATE TABLE inputevents_cv ( row_id number, subject_id...
Which player was from Fermanagh and had an average score of 22?
CREATE TABLE table_63036 ( "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real )
SELECT AVG("Average") FROM table_63036 WHERE "Total" = '22' AND "County" = 'fermanagh'
Below are sql tables 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 was from Fermanagh and had an average score of 22? ### Input: CREATE TABLE table_63036 ( "Player" text, ...
What is the attendance at the game where San Jose was the visitor on May 4?
CREATE TABLE table_55876 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real )
SELECT "Attendance" FROM table_55876 WHERE "Visitor" = 'san jose' AND "Date" = 'may 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 attendance at the game where San Jose was the visitor on May 4? ### Input: CREATE TABLE table_55876 ( "Date"...
how far is the airport from downtown PITTSBURGH
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE c...
SELECT DISTINCT airport_service.miles_distant FROM airport_service, city WHERE city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH'
Below are sql tables 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 far is the airport from downtown PITTSBURGH ### Input: CREATE TABLE dual_carrier ( main_airline varchar, low_fli...
Compute the total sum team id across all home as a pie chart.
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, SUM(Team_ID) FROM basketball_match GROUP BY All_Home
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Compute the total sum team id across all home as a pie chart. ### Input: CREATE TABLE university ( School_ID int, Sc...
Find all the songs performed by artist with last name 'Heilo
CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE vocals ( songid number, bandmate number, ...
SELECT T3.title FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T2.lastname = "Heilo"
Below are sql tables 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 the songs performed by artist with last name 'Heilo ### Input: CREATE TABLE performance ( songid number, ba...
What is the name of the home team on April 13, 2008 when Itabuna was the away team?
CREATE TABLE table_75944 ( "Round" text, "Date" text, "Home team" text, "Score" text, "Away team" text )
SELECT "Home team" FROM table_75944 WHERE "Date" = 'april 13, 2008' AND "Away team" = 'itabuna'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the home team on April 13, 2008 when Itabuna was the away team? ### Input: CREATE TABLE table_75944 ( ...
For those employees whose first name does not contain the letter M, give me a line chart to show the hire date and the corresponding salaries, and sort x-axis in asc order.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, 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: For those employees whose first name does not contain the letter M, give me a line chart to show the hire date and the corre...
WHAT WAS THE SCORE FOR GAME 31?
CREATE TABLE table_15869204_6 ( score VARCHAR, game VARCHAR )
SELECT score FROM table_15869204_6 WHERE game = 31
Below are sql tables 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 GAME 31? ### Input: CREATE TABLE table_15869204_6 ( score VARCHAR, game VARCHAR ) ### Respons...
What amount of 100 -level courses are going to be open this Fall and Winter semester ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
SELECT COUNT(DISTINCT course.department, course.name, course.number, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_...
Below are sql tables 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 amount of 100 -level courses are going to be open this Fall and Winter semester ? ### Input: CREATE TABLE requirement (...
What team had a qual 1 of 59.895?
CREATE TABLE table_32367 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
SELECT "Team" FROM table_32367 WHERE "Qual 1" = '59.895'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team had a qual 1 of 59.895? ### Input: CREATE TABLE table_32367 ( "Name" text, "Team" text, "Qual 1" text,...
hemoglobin a1c greater than or equal to 7 % and less than or equal to 10 % within 3 months prior to visit 1
CREATE TABLE table_train_231 ( "id" int, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "stroke" bool, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "allergy_to_milk" bool, "NOUSE" float )
SELECT * FROM table_train_231 WHERE hemoglobin_a1c_hba1c >= 7 AND hemoglobin_a1c_hba1c <= 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: hemoglobin a1c greater than or equal to 7 % and less than or equal to 10 % within 3 months prior to visit 1 ### Input: CREAT...
What is the lowest number of series?
CREATE TABLE table_15824796_4 ( series__number INTEGER )
SELECT MIN(series__number) FROM table_15824796_4
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest number of series? ### Input: CREATE TABLE table_15824796_4 ( series__number INTEGER ) ### Response: S...
Who were all the writers whose episodes had 0.97 million viewers?
CREATE TABLE table_23918997_1 ( written_by VARCHAR, us_viewers__million_ VARCHAR )
SELECT written_by FROM table_23918997_1 WHERE us_viewers__million_ = "0.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: Who were all the writers whose episodes had 0.97 million viewers? ### Input: CREATE TABLE table_23918997_1 ( written_by ...
During which loss was the record 48-50?
CREATE TABLE table_69983 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Loss" FROM table_69983 WHERE "Record" = '48-50'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: During which loss was the record 48-50? ### Input: CREATE TABLE table_69983 ( "Date" text, "Opponent" text, "Sco...
List the genre name and genre id using a bar chart, and show from low to high by the bar please.
CREATE TABLE staff ( staff_id TINYINT UNSIGNED, first_name VARCHAR(45), last_name VARCHAR(45), address_id SMALLINT UNSIGNED, picture BLOB, email VARCHAR(50), store_id TINYINT UNSIGNED, active BOOLEAN, username VARCHAR(16), password VARCHAR(40), last_update TIMESTAMP ) CREATE...
SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id ORDER BY T2.name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List the genre name and genre id using a bar chart, and show from low to high by the bar please. ### Input: CREATE TABLE sta...
What was the overall record in the season where average attendance was 16720?
CREATE TABLE table_3839 ( "Season" text, "Overall Record" text, "SEC Record" text, "Overall Attendance" real, "Average Attendance" real, "Rank Nationally" text )
SELECT "Overall Record" FROM table_3839 WHERE "Average Attendance" = '16720'
Below are sql tables 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 overall record in the season where average attendance was 16720? ### Input: CREATE TABLE table_3839 ( "Seas...
In 1961, what was the Chassis when the points were lower than 6?
CREATE TABLE table_name_51 ( chassis VARCHAR, points VARCHAR, year VARCHAR )
SELECT chassis FROM table_name_51 WHERE points < 6 AND year = 1961
Below are sql tables 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 1961, what was the Chassis when the points were lower than 6? ### Input: CREATE TABLE table_name_51 ( chassis VARCHAR...
give the number of patients whose lab test name is lactate and religion is jehovah's witness.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEHOVAH'S WITNESS" AND lab.label = "Lactate"
Below are sql tables 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 name is lactate and religion is jehovah's witness. ### Input: CREATE TABLE proced...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and order by the bars in ascending.
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average ...
what is the number of the wc matches if the matches were 79
CREATE TABLE table_30085411_1 ( WC INTEGER, matches VARCHAR )
SELECT MAX(WC) AS matches FROM table_30085411_1 WHERE matches = 79
Below are sql tables 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 the wc matches if the matches were 79 ### Input: CREATE TABLE table_30085411_1 ( WC INTEGER, m...
provide the number of patients whose diagnoses icd9 code is 53390 and lab test abnormal status is delta?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "53390" 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: provide the number of patients whose diagnoses icd9 code is 53390 and lab test abnormal status is delta? ### Input: CREATE T...
what flights are available from DALLAS FORT WORTH to ATLANTA
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
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 = 'DALLAS FORT WORTH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights are available from DALLAS FORT WORTH to ATLANTA ### Input: CREATE TABLE flight_fare ( flight_id int, fa...
show me all flights that go from NEW YORK to MIAMI on tuesday and go from MIAMI to NEW YORK on sunday
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code va...
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 = 'MIAMI' AND date_day.day_number = 22 AND date_day.month_number = 3 AND da...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all flights that go from NEW YORK to MIAMI on tuesday and go from MIAMI to NEW YORK on sunday ### Input: CREATE TABL...
since 12/2105, patient 006-80884 has had any levo intake?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutpu...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 12/2105, patient 006-80884 has had any levo intake? ### Input: CREATE TABLE lab ( labid number, patientunitsta...
What is Term Start, when Born-Died is Prime Ministers 1939 - 1943?
CREATE TABLE table_name_53 ( term_start VARCHAR, born_died VARCHAR )
SELECT term_start FROM table_name_53 WHERE born_died = "prime ministers 1939 - 1943"
Below are sql tables 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 Term Start, when Born-Died is Prime Ministers 1939 - 1943? ### Input: CREATE TABLE table_name_53 ( term_start VA...
Show the proportion of the total enrollment in each county with a pie chart.
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREAT...
SELECT County, SUM(Enrollment) FROM School GROUP BY County
Below are sql tables 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 proportion of the total enrollment in each county with a pie chart. ### Input: CREATE TABLE endowment ( endowme...
how many patients whose year of death is less than or equal to 2111 and lab test fluid is cerebrospinal fluid (csf)?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
Below are sql tables 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 death is less than or equal to 2111 and lab test fluid is cerebrospinal fluid (csf)? ### Inp...
Show me distance by name in a histogram
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE...
SELECT name, distance FROM aircraft
Below are sql tables 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 distance by name in a histogram ### Input: CREATE TABLE flight ( flno number(4,0), origin varchar2(20), ...
Who was the partner for the match with a score in the final of 4 6, 6 7?
CREATE TABLE table_name_31 ( partner VARCHAR, score_in_the_final VARCHAR )
SELECT partner FROM table_name_31 WHERE score_in_the_final = "4–6, 6–7"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the partner for the match with a score in the final of 4 6, 6 7? ### Input: CREATE TABLE table_name_31 ( partner...
Users in intervals under 100 rep.
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) ...
SELECT COUNT(*) AS "Count", COUNT(*) * 100.0 / SUM(COUNT(*)) OVER () AS "Percentage", MIN(Reputation) AS "Rep" FROM Users WHERE Reputation < 100 GROUP BY 'reputation' / '##INTERVAL##' ORDER BY MIN(Reputation)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Users in intervals under 100 rep. ### Input: CREATE TABLE Comments ( Id number, PostId number, Score number, ...
what are the three most frequent medicines that were prescribed within 2 months to the female patients of age 60 or above after they have been diagnosed with ch obst asth w (ac) exac in 2100?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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 ...
Below are sql tables 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 three most frequent medicines that were prescribed within 2 months to the female patients of age 60 or above af...
On January 15, what was the most in attendance?
CREATE TABLE table_name_42 ( attendance INTEGER, date VARCHAR )
SELECT MAX(attendance) FROM table_name_42 WHERE date = "january 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: On January 15, what was the most in attendance? ### Input: CREATE TABLE table_name_42 ( attendance INTEGER, date VAR...
Most popular GIS tags 2017.
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE...
SELECT rate.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, rate.Rate AS Questions FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < '2017-06-01' AND Posts.CreationDate > '2017-01-01' GROUP BY TagName...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Most popular GIS tags 2017. ### Input: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean...
Top 20 user from Italy by reputation.
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%ital%' ORDER BY Reputation DESC LIMIT 20
Below are sql tables 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 20 user from Italy by reputation. ### Input: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal bo...
How many patients with hypoxia are younger than 54 year of age?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age < "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: How many patients with hypoxia are younger than 54 year of age? ### Input: CREATE TABLE demographic ( subject_id text, ...
tell me the average total cost of a hospital that contains wound infection since 2105?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'wound infection')) AND STRFTIME('%y', cost.c...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the average total cost of a hospital that contains wound infection since 2105? ### Input: CREATE TABLE diagnosis ( ...
what is the 1st round when team 2 is olympique lyonnais (d2)?
CREATE TABLE table_name_67 ( team_2 VARCHAR )
SELECT 1 AS st_round FROM table_name_67 WHERE team_2 = "olympique lyonnais (d2)"
Below are sql tables 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 1st round when team 2 is olympique lyonnais (d2)? ### Input: CREATE TABLE table_name_67 ( team_2 VARCHAR ) #...
what flights are provided by AA
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zo...
SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'AA'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights are provided by AA ### Input: CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, ...
Return the average price of products that have each category code in a bar chart, and list y axis from low to high order.
CREATE TABLE Customers ( customer_id INTEGER, customer_type_code VARCHAR(20), address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Staff ( staff_id INTEGER, gender VA...
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price)
Below are sql tables 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 average price of products that have each category code in a bar chart, and list y axis from low to high order. ##...
What is the total PL G of player pennant, who has less than 7 CL G, less than 7 CL apps, and a FA YC of 0?
CREATE TABLE table_name_74 ( pl_g VARCHAR, player VARCHAR, fa_yc VARCHAR, cl_g VARCHAR, cl_apps VARCHAR )
SELECT COUNT(pl_g) FROM table_name_74 WHERE cl_g < 7 AND cl_apps < 7 AND fa_yc = 0 AND player = "pennant"
Below are sql tables 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 PL G of player pennant, who has less than 7 CL G, less than 7 CL apps, and a FA YC of 0? ### Input: CREATE...
Tell me the week for result of l 31-27, and an Attendance smaller than 85,865
CREATE TABLE table_name_99 ( week INTEGER, result VARCHAR, attendance VARCHAR )
SELECT AVG(week) FROM table_name_99 WHERE result = "l 31-27" AND attendance < 85 OFFSET 865
Below are sql tables 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 week for result of l 31-27, and an Attendance smaller than 85,865 ### Input: CREATE TABLE table_name_99 ( we...
Give me a bar chart for total number of school id of each all home, and rank by the y axis from high to low.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_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: Give me a bar chart for total number of school id of each all home, and rank by the y axis from high to low. ### Input: CREA...
on the last intensive care unit visit, when did patient 3277 receive an intake for the last time?
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 number, subject_id number, hadm_id number, icd9_code text, charttime ti...
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 = 3277) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) ORDER BY input...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on the last intensive care unit visit, when did patient 3277 receive an intake for the last time? ### Input: CREATE TABLE ch...
What is the most effortless class I can take to satisfy the MDE ?
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
Below are sql tables 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 most effortless class I can take to satisfy the MDE ? ### Input: CREATE TABLE area ( course_id int, area...
What Winter term classes are there that are GTBOOKS ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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_...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'GTBOOKS' AND semester.semester = 'Winter'
Below are sql tables 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 Winter term classes are there that are GTBOOKS ? ### Input: CREATE TABLE semester ( semester_id int, semester v...
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Road, and show from high to low by the x axis.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_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: Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Road, and show from high to low by the x...
Which Average has Yards larger than 167, and a Team of at tb, and a Week larger than 7?
CREATE TABLE table_78817 ( "Week" real, "Team" text, "Carries" real, "Yards" real, "Average" real )
SELECT MIN("Average") FROM table_78817 WHERE "Yards" > '167' AND "Team" = 'at tb' AND "Week" > '7'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Average has Yards larger than 167, and a Team of at tb, and a Week larger than 7? ### Input: CREATE TABLE table_78817 ...
For those employees who did not have any job in the past, show me the trend about salary over hire_date with a line chart.
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 HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
Below are sql tables 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, show me the trend about salary over hire_date with a line chart. #...
Which school did the player that played 2004-05 attend?
CREATE TABLE table_15862 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
SELECT "School/Club Team" FROM table_15862 WHERE "Years in Toronto" = '2004-05'
Below are sql tables 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 school did the player that played 2004-05 attend? ### Input: CREATE TABLE table_15862 ( "Player" text, "No." r...
how many countries sampled with year of publication being 2007 and ranking l.a. (2) being 7th
CREATE TABLE table_17378 ( "Index (Year)" text, "Author / Editor / Source" text, "Year of publication" text, "Countries sampled" real, "World Ranking (1)" text, "Ranking L.A. (2)" text )
SELECT COUNT("Countries sampled") FROM table_17378 WHERE "Year of publication" = '2007' AND "Ranking L.A. (2)" = '7th'
Below are sql tables 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 countries sampled with year of publication being 2007 and ranking l.a. (2) being 7th ### Input: CREATE TABLE table_...
Visualize a bar chart about the distribution of meter_400 and ID , sort in asc by the y axis.
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 event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT meter_400, ID FROM swimmer ORDER BY 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: Visualize a bar chart about the distribution of meter_400 and ID , sort in asc by the y axis. ### Input: CREATE TABLE swimme...
What is the lowest ranking associated with a total of 23?
CREATE TABLE table_name_51 ( ranking INTEGER, total VARCHAR )
SELECT MIN(ranking) FROM table_name_51 WHERE total = 23
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest ranking associated with a total of 23? ### Input: CREATE TABLE table_name_51 ( ranking INTEGER, t...
How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field goals?
CREATE TABLE table_name_35 ( extra_points INTEGER, field_goals VARCHAR, touchdowns VARCHAR, player VARCHAR )
SELECT AVG(extra_points) FROM table_name_35 WHERE touchdowns < 2 AND player = "herrnstein" AND field_goals < 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: How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field goals? ### Input: CREA...
what was the drug that in 04/this year patient 72198 was prescribed via the ih route for the last time?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72198) AND prescriptions.route = 'ih' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', pres...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the drug that in 04/this year patient 72198 was prescribed via the ih route for the last time? ### Input: CREATE TA...
How many times did Morgan win The Masters Tournament with fewer than 12 appearances?
CREATE TABLE table_name_12 ( wins INTEGER, tournament VARCHAR, events VARCHAR )
SELECT AVG(wins) FROM table_name_12 WHERE tournament = "masters tournament" AND events < 12
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many times did Morgan win The Masters Tournament with fewer than 12 appearances? ### Input: CREATE TABLE table_name_12 (...
which artist earned the least number of points ?
CREATE TABLE table_204_915 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text )
SELECT "artist" FROM table_204_915 ORDER BY "points" LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which artist earned the least number of points ? ### Input: CREATE TABLE table_204_915 ( id number, "draw" number, ...
what is the number of patients whose age is less than 43 and diagnoses long title is other preterm infants, 750-999 grams?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.long_title = "Other preterm infants, 750-999 grams"
Below are sql tables 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 age is less than 43 and diagnoses long title is other preterm infants, 750-999 grams? #...
Find the names of the artists who are from UK and have produced English songs.
CREATE TABLE artist ( artist_name VARCHAR, country VARCHAR, languages VARCHAR ) CREATE TABLE song ( artist_name VARCHAR, country VARCHAR, languages VARCHAR )
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english"
Below are sql tables 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 names of the artists who are from UK and have produced English songs. ### Input: CREATE TABLE artist ( artist_n...
Find Team_Name and All_Games_Percent , and visualize them by a bar chart, and list in descending by the y-axis.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_Name, 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: Find Team_Name and All_Games_Percent , and visualize them by a bar chart, and list in descending by the y-axis. ### Input: C...
how many patients whose primary disease is rash and year of death is less than or equal to 2154?
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 WHERE demographic.diagnosis = "RASH" AND demographic.dod_year <= "2154.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: how many patients whose primary disease is rash and year of death is less than or equal to 2154? ### Input: CREATE TABLE pro...
what were the changes in the value of patient 1561's platelet count last measured on the current hospital visit compared to the second to last value measured on the current hospital visit?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') ORDER BY labevents.char...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the changes in the value of patient 1561's platelet count last measured on the current hospital visit compared to ...
When did Fitzroy play as the away team?
CREATE TABLE table_name_70 ( date VARCHAR, away_team VARCHAR )
SELECT date FROM table_name_70 WHERE away_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: When did Fitzroy play as the away team? ### Input: CREATE TABLE table_name_70 ( date VARCHAR, away_team VARCHAR ) ##...
what is maximum age of patients whose marital status is divorced and gender is f?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "F"
Below are sql tables 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 maximum age of patients whose marital status is divorced and gender is f? ### Input: CREATE TABLE procedures ( s...
Which Laps have a Time/Retired of +23.215, and a Grid larger than 11?
CREATE TABLE table_76655 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT MIN("Laps") FROM table_76655 WHERE "Time/Retired" = '+23.215' AND "Grid" > '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: Which Laps have a Time/Retired of +23.215, and a Grid larger than 11? ### Input: CREATE TABLE table_76655 ( "Rider" text...
what is the political affiliation of the texas 12 district
CREATE TABLE table_1341884_45 ( party VARCHAR, district VARCHAR )
SELECT party FROM table_1341884_45 WHERE district = "Texas 12"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the political affiliation of the texas 12 district ### Input: CREATE TABLE table_1341884_45 ( party VARCHAR, ...
Which Brilliance Grade has a Crown angle of 41.1 ?
CREATE TABLE table_42672 ( "Benchmark" text, "Crown height" text, "Pavilion depth" text, "Table diameter" text, "Girdle thickness" text, "Crown angle" text, "Pavilion angle" text, "Brilliance Grade" text )
SELECT "Brilliance Grade" FROM table_42672 WHERE "Crown angle" = '41.1°'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Brilliance Grade has a Crown angle of 41.1 ? ### Input: CREATE TABLE table_42672 ( "Benchmark" text, "Crown he...
hba1c > 7 % and not to exceed 10.5 % .
CREATE TABLE table_dev_26 ( "id" int, "gender" string, "hemoglobin_a1c_hba1c" float, "dyslipidemia" bool, "body_weight" float, "hba1c" float, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float )
SELECT * FROM table_dev_26 WHERE hba1c > 7 AND hemoglobin_a1c_hba1c < 10.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: hba1c > 7 % and not to exceed 10.5 % . ### Input: CREATE TABLE table_dev_26 ( "id" int, "gender" string, "hemogl...
What is Circuit, when Series is ASTC Round 4?
CREATE TABLE table_name_26 ( circuit VARCHAR, series VARCHAR )
SELECT circuit FROM table_name_26 WHERE series = "astc round 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 Circuit, when Series is ASTC Round 4? ### Input: CREATE TABLE table_name_26 ( circuit VARCHAR, series VARCHA...
Give me a histogram for what are the statuses and average populations of each city?
CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, Hosts text ) CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, ...
SELECT Status, AVG(Population) FROM city GROUP BY Status
Below are sql tables 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 are the statuses and average populations of each city? ### Input: CREATE TABLE farm_competition...
What venue did South Melbourne play as the away team?
CREATE TABLE table_name_61 ( venue VARCHAR, away_team VARCHAR )
SELECT venue FROM table_name_61 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 venue did South Melbourne play as the away team? ### Input: CREATE TABLE table_name_61 ( venue VARCHAR, away_te...
What is the total Cores with a Clock Speed of 1.3ghz?
CREATE TABLE table_62652 ( "Model Number" text, "Clock Speed" text, "L1 Cache" text, "L2 Cache" text, "FSB Speed" text, "Clock Multiplier" text, "Idle Power" text, "Socket" text, "Cores" real, "Release Date" text )
SELECT COUNT("Cores") FROM table_62652 WHERE "Clock Speed" = '1.3ghz'
Below are sql tables 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 Cores with a Clock Speed of 1.3ghz? ### Input: CREATE TABLE table_62652 ( "Model Number" text, "Cl...
in the case of patients who received lmb/lmbsac fus post/post since 2105, what are the four most common diagnoses that followed within 2 months?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
Below are sql tables 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 the case of patients who received lmb/lmbsac fus post/post since 2105, what are the four most common diagnoses that follo...
what is the number of patients whose ethnicity is white - russian and drug name is readi-cat 2 (barium sulfate 2% suspension)?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Readi-Cat 2 (Barium Sulfate 2% Suspension)"
Below are sql tables 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 ethnicity is white - russian and drug name is readi-cat 2 (barium sulfate 2% suspension...
Find the numbers of different majors and cities.
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text )...
SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student
Below are sql tables 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 numbers of different majors and cities. ### Input: CREATE TABLE student ( stuid number, lname text, fna...
A bar chart shows the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road, list Y-axis in asc order.
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, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_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: A bar chart shows the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road, list Y-axis i...
What is the number of patients who have a protestant quaker religious background?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "PROTESTANT QUAKER"
Below are sql tables 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 who have a protestant quaker religious background? ### Input: CREATE TABLE prescriptions ( ...