instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
How many employees does each role have? List role id and number of employees in a pie chart.
CREATE TABLE Employees ( employee_id INTEGER, role_code CHAR(15), employee_name VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Shipping_Agents ( shipping_agent_code CHAR(15), shipping_agent_name VARCHAR(255), shipping_agent_description VARCHAR(255) ) CREATE TABLE Documents_Mai...
SELECT T1.role_code, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many employees does each role have? List role id and number of employees in a pie chart. ### Input: CREATE TABLE Employe...
what is patient 002-31956's first urinary catheter output: indwelling/continuous ure output time on 03/15/this year?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-31956')) AND intakeoutput.cellpath LIKE '%output%...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is patient 002-31956's first urinary catheter output: indwelling/continuous ure output time on 03/15/this year? ### Inp...
Can you show a bar chart to visualize the number of carriers?, and list x axis from high to low order.
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier ORDER BY Carrier 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: Can you show a bar chart to visualize the number of carriers?, and list x axis from high to low order. ### Input: CREATE TAB...
find the primary disease and lab test fluid of subject id 2560.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the primary disease and lab test fluid of subject id 2560. ### Input: CREATE TABLE demographic ( subject_id text, ...
Which Home captain has a Venue of melbourne cricket ground?
CREATE TABLE table_15457 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
SELECT "Home captain" FROM table_15457 WHERE "Venue" = 'melbourne cricket ground'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Home captain has a Venue of melbourne cricket ground? ### Input: CREATE TABLE table_15457 ( "Date" text, "Home...
how many patients whose admission type is emergency and procedure icd9 code is 66?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "66"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission type is emergency and procedure icd9 code is 66? ### Input: CREATE TABLE lab ( subject...
What the total of Week with attendance of 53,147
CREATE TABLE table_42292 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT SUM("Week") FROM table_42292 WHERE "Attendance" = '53,147'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What the total of Week with attendance of 53,147 ### Input: CREATE TABLE table_42292 ( "Week" real, "Date" text, ...
What si the total sample size at rasmussen reports when the margin of error was bigger than 4.5?
CREATE TABLE table_44626 ( "Poll Source" text, "Sample Size" real, "Margin of Error" real, "Date" text, "Democrat" text, "Republican" text )
SELECT COUNT("Sample Size") FROM table_44626 WHERE "Poll Source" = 'rasmussen reports' AND "Margin of Error" > '4.5'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What si the total sample size at rasmussen reports when the margin of error was bigger than 4.5? ### Input: CREATE TABLE tab...
when was the last time patient 006-80884 measured its respiration less than 15.0 since 8 days ago?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND vitalperiodic.respiration < 15.0 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: when was the last time patient 006-80884 measured its respiration less than 15.0 since 8 days ago? ### Input: CREATE TABLE c...
Which teams used Wally Rogers as their crew chief?
CREATE TABLE table_541 ( "Team" text, "Car(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Owner(s)" text, "Crew Chief" text, "Rounds" real )
SELECT "Team" FROM table_541 WHERE "Crew Chief" = 'Wally Rogers'
Below are sql tables 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 teams used Wally Rogers as their crew chief? ### Input: CREATE TABLE table_541 ( "Team" text, "Car(s)" text, ...
What size was the crowd when Hawthorn was the home team?
CREATE TABLE table_51379 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT COUNT("Crowd") FROM table_51379 WHERE "Home team" = 'hawthorn'
Below are sql tables 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 size was the crowd when Hawthorn was the home team? ### Input: CREATE TABLE table_51379 ( "Home team" text, "Ho...
Are 100 -level classes available in either the Spring or Summer terms ?
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
SELECT 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 = 'EECS' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = 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: Are 100 -level classes available in either the Spring or Summer terms ? ### Input: CREATE TABLE gsi ( course_offering_id...
Show the number of apartment bookings in each weekday and bin booking end date by weekday with a bar chart, sort from low to high by the total number.
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_B...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_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: Show the number of apartment bookings in each weekday and bin booking end date by weekday with a bar chart, sort from low to...
has patient 14054 taken a sc 20 fe po drug on last month/01?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT COUNT(*) > 0 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 = 14054)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sc 20 fe...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 14054 taken a sc 20 fe po drug on last month/01? ### Input: CREATE TABLE outputevents ( row_id number, s...
Visualize a bar chart for what is the number of their teams in elimination?, and rank X-axis in descending order.
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY Team DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart for what is the number of their teams in elimination?, and rank X-axis in descending order. ### Input:...
For those records from the products and each product's manufacturer, find name and the sum of price , and group by attribute name, and visualize them by a bar chart, and list from low to high by the total number of price.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.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: For those records from the products and each product's manufacturer, find name and the sum of price , and group by attribute...
Give me a histogram for what is total number of show times per dat for each cinema?, and sort from high to low by the show times per day.
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY SUM(T1.Show_times_per_day) 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 total number of show times per dat for each cinema?, and sort from high to low by the show t...
what is the number of patients less than 72 years of age?
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 WHERE demographic.age < "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: what is the number of patients less than 72 years of age? ### Input: CREATE TABLE prescriptions ( subject_id text, h...
Draw a bar chart about the distribution of meter_500 and ID , list by the meter_500 in descending.
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_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
SELECT meter_500, ID FROM swimmer ORDER BY meter_500 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 meter_500 and ID , list by the meter_500 in descending. ### Input: CREATE TABLE e...
What series had a high points of Prince (23)?
CREATE TABLE table_58544 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
SELECT "Series" FROM table_58544 WHERE "High points" = 'prince (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 series had a high points of Prince (23)? ### Input: CREATE TABLE table_58544 ( "Game" real, "Date" text, "T...
how many patients whose diagnoses icd9 code is 1120 and drug type is base?
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "1120" AND prescriptions.drug_type = "BASE"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose diagnoses icd9 code is 1120 and drug type is base? ### Input: CREATE TABLE procedures ( subject_...
Show me the total number by country in a histogram, and sort in desc by the X-axis.
CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equity_Shareholding real ) CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE flight ( id int, ...
SELECT Country, COUNT(*) FROM airport GROUP BY Country ORDER BY Country DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me the total number by country in a histogram, and sort in desc by the X-axis. ### Input: CREATE TABLE operate_company ...
show me the length of stay of patient 18877 from the first stay in the icu.
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 STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18877) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the length of stay of patient 18877 from the first stay in the icu. ### Input: CREATE TABLE chartevents ( row_id...
What is the per capita income with more than 2,466 households and a median family income of $53,940?
CREATE TABLE table_12115 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
SELECT "Per capita income" FROM table_12115 WHERE "Number of households" > '2,466' AND "Median family income" = '$53,940'
Below are sql tables 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 per capita income with more than 2,466 households and a median family income of $53,940? ### Input: CREATE TABLE...
What is the round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt?
CREATE TABLE table_name_92 ( round VARCHAR, race VARCHAR )
SELECT round FROM table_name_92 WHERE race = "int. adac-preis der tourenwagen von sachsen-anhalt"
Below are sql tables 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 round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt? ### Input: CREATE TABLE table_name_92 ( ro...
For those employees who did not have any job in the past, a line chart shows the change of department_id over hire_date
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
SELECT HIRE_DATE, DEPARTMENT_ID 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, a line chart shows the change of department_id over hire_date ### ...
what were the three most commonly prescribed drugs for patients who have previously received entral infus nutrit sub within 2 months, since 2105?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id n...
SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ...
Below are sql tables 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 three most commonly prescribed drugs for patients who have previously received entral infus nutrit sub within ...
What is the Song choice with a Theme that is 1960s?
CREATE TABLE table_name_1 ( song_choice VARCHAR, theme VARCHAR )
SELECT song_choice FROM table_name_1 WHERE theme = "1960s"
Below are sql tables 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 Song choice with a Theme that is 1960s? ### Input: CREATE TABLE table_name_1 ( song_choice VARCHAR, them...
Display a pie chart for what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Display a pie chart for what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by ea...
Who scored 69-71=140?
CREATE TABLE table_name_75 ( player VARCHAR, score VARCHAR )
SELECT player FROM table_name_75 WHERE score = 69 - 71 = 140
Below are sql tables 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 scored 69-71=140? ### Input: CREATE TABLE table_name_75 ( player VARCHAR, score VARCHAR ) ### Response: SELECT p...
List the number of the names of patients who have made appointments, and order from low to high by the y axis.
CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT ) CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN ) CREATE TABLE Departme...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(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 number of the names of patients who have made appointments, and order from low to high by the y axis. ### Input: CR...
This Winter , who is teaching EDCURINS 431 ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN 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: This Winter , who is teaching EDCURINS 431 ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar, descr...
Find the number of rooms for each bed type. Show the proportion.
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType
Below are sql tables 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 rooms for each bed type. Show the proportion. ### Input: CREATE TABLE Reservations ( Code INTEGER, ...
when did patient 25523 first undergo a surgery the previous year?
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY procedures_icd.charttime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 25523 first undergo a surgery the previous year? ### Input: CREATE TABLE transfers ( row_id number, ...
On Monday and Wednesday , is 370 available ?
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, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
Below are sql tables 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 Monday and Wednesday , is 370 available ? ### Input: CREATE TABLE course_tags_count ( course_id int, clear_gradin...
When the Gain is 29, and the average per game is 2, and the player lost less than 390 yards, what's the sum of the Long yards?
CREATE TABLE table_76243 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
SELECT SUM("Long") FROM table_76243 WHERE "Loss" < '390' AND "Avg/G" = '2' AND "Gain" > '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: When the Gain is 29, and the average per game is 2, and the player lost less than 390 yards, what's the sum of the Long yard...
count the number of self pay insurance patients who have been admitted for more than 26 days in hospital.
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "26"
Below are sql tables 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 self pay insurance patients who have been admitted for more than 26 days in hospital. ### Input: CREATE ...
What is the lowest Total Medals that has madison independent and Bronze Medals larger than 0
CREATE TABLE table_66926 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
SELECT MIN("Total Medals") FROM table_66926 WHERE "Ensemble" = 'madison independent' AND "Bronze Medals" > '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 lowest Total Medals that has madison independent and Bronze Medals larger than 0 ### Input: CREATE TABLE table_6...
What team was the opponent when there was a score of 5 4 (11)?
CREATE TABLE table_name_38 ( opponent VARCHAR, score VARCHAR )
SELECT opponent FROM table_name_38 WHERE score = "5–4 (11)"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team was the opponent when there was a score of 5 4 (11)? ### Input: CREATE TABLE table_name_38 ( opponent VARCHAR,...
What was the away team score at Windy Hill?
CREATE TABLE table_name_25 ( away_team VARCHAR, venue VARCHAR )
SELECT away_team AS score FROM table_name_25 WHERE venue = "windy hill"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away team score at Windy Hill? ### Input: CREATE TABLE table_name_25 ( away_team VARCHAR, venue VARCHAR...
how many patients had the diagnosis short title as hypoxemia?
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 diagnoses.short_title = "Hypoxemia"
Below are sql tables 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 had the diagnosis short title as hypoxemia? ### Input: CREATE TABLE lab ( subject_id text, hadm_id...
what was the name of the organism found in the microbiology test of the first other of patient 031-3355 on the current hospital visit?
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 microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.cultur...
Below are sql tables 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 name of the organism found in the microbiology test of the first other of patient 031-3355 on the current hospi...
what is days of hospital stay and procedure long title of subject name dona cole?
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 demographic.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Dona Cole"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is days of hospital stay and procedure long title of subject name dona cole? ### Input: CREATE TABLE lab ( subject_...
how many of the female patients were treated with drug d10w?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "D10W"
Below are sql tables 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 of the female patients were treated with drug d10w? ### Input: CREATE TABLE diagnoses ( subject_id text, ha...
What is the # when u.s. viewers (million) is 17.44?
CREATE TABLE table_25539 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Rank (week)" text, "Original air date" text )
SELECT COUNT("#") FROM table_25539 WHERE "U.S. viewers (million)" = '17.44'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the # when u.s. viewers (million) is 17.44? ### Input: CREATE TABLE table_25539 ( "No." real, "#" real, ...
What is the original air date for production code 1ark79?
CREATE TABLE table_73453 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "Viewers (in millions)" text )
SELECT "Original air date" FROM table_73453 WHERE "Production code" = '1ARK79'
Below are sql tables 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 original air date for production code 1ark79? ### Input: CREATE TABLE table_73453 ( "No." real, "Title" ...
Show the average price of each film in a bar chart, show names in descending 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 Title, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title ORDER BY Title DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the average price of each film in a bar chart, show names in descending order. ### Input: CREATE TABLE schedule ( C...
What is the average number of silver medals won among nations that won 9 medals total?
CREATE TABLE table_65714 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT AVG("Silver") FROM table_65714 WHERE "Total" = '9'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of silver medals won among nations that won 9 medals total? ### Input: CREATE TABLE table_65714 (...
Can you tell me the High assists that has the Date of november 25?
CREATE TABLE table_name_44 ( high_assists VARCHAR, date VARCHAR )
SELECT high_assists FROM table_name_44 WHERE date = "november 25"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me the High assists that has the Date of november 25? ### Input: CREATE TABLE table_name_44 ( high_assists ...
find the number of living patients who had procedure icd9 code 3891.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3891"
Below are sql tables 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 living patients who had procedure icd9 code 3891. ### Input: CREATE TABLE diagnoses ( subject_id text...
For those payments processed with Visa, bin the payment day into Year interval and compute the average amount payment as the Y-axis.
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code ...
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
Below are sql tables 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 payments processed with Visa, bin the payment day into Year interval and compute the average amount payment as the...
What are the facility codes of the apartments with more than four bedrooms, and count them by a bar chart
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_dat...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the facility codes of the apartments with more than four bedrooms, and count them by a bar chart ### Input: CREATE ...
Which district is associated with the incumbent Carl Vinson?
CREATE TABLE table_1342233_11 ( candidates VARCHAR, incumbent VARCHAR )
SELECT candidates FROM table_1342233_11 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: Which district is associated with the incumbent Carl Vinson? ### Input: CREATE TABLE table_1342233_11 ( candidates VARCH...
How many games has each stadium held?
CREATE TABLE stadium ( id VARCHAR ) CREATE TABLE game ( stadium_id VARCHAR )
SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.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: How many games has each stadium held? ### Input: CREATE TABLE stadium ( id VARCHAR ) CREATE TABLE game ( stadium_id...
Return a scatter on how many documents correspond with each project id?
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Descript...
SELECT Project_ID, COUNT(*) FROM Documents GROUP BY Project_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: Return a scatter on how many documents correspond with each project id? ### Input: CREATE TABLE Documents_with_Expenses ( ...
when was the last hospital admission that patient 027-130381 was admitted to via the operating room until 4 years ago?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '027-130381' AND patient.hospitaladmitsource = 'operating room' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') 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: when was the last hospital admission that patient 027-130381 was admitted to via the operating room until 4 years ago? ### I...
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 first_name and salary , and I want to show by the bar 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0...
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart ab...
Which nation had 14 goals?
CREATE TABLE table_name_89 ( nationality VARCHAR, goals VARCHAR )
SELECT nationality FROM table_name_89 WHERE goals = 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: Which nation had 14 goals? ### Input: CREATE TABLE table_name_89 ( nationality VARCHAR, goals VARCHAR ) ### Response...
what is the venue when the home team is melbourne?
CREATE TABLE table_name_67 ( venue VARCHAR, home_team VARCHAR )
SELECT venue FROM table_name_67 WHERE home_team = "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 is the venue when the home team is melbourne? ### Input: CREATE TABLE table_name_67 ( venue VARCHAR, home_team ...
Can you tell me the lowest Decile that has the Area of matakohe, and the Roll larger than 86?
CREATE TABLE table_name_52 ( decile INTEGER, area VARCHAR, roll VARCHAR )
SELECT MIN(decile) FROM table_name_52 WHERE area = "matakohe" AND roll > 86
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me the lowest Decile that has the Area of matakohe, and the Roll larger than 86? ### Input: CREATE TABLE table_...
Which major has least number of students? List the major and the number of students.
CREATE TABLE Student ( Major VARCHAR )
SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) 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 major has least number of students? List the major and the number of students. ### Input: CREATE TABLE Student ( M...
give me the number of patients whose year of death is less than or equal to 2122 and drug code is linebase?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "LINEBASE"
Below are sql tables 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 year of death is less than or equal to 2122 and drug code is linebase? ### Input: CREAT...
count the number of patients whose gender is m and diagnoses short title is pseudomonas infect nos?
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.gender = "M" AND diagnoses.short_title = "Pseudomonas infect NOS"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose gender is m and diagnoses short title is pseudomonas infect nos? ### Input: CREATE TABLE ...
For each branch id, what are the names of the branches that were registered after 2015?
CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE member ( member_id number, card_number text,...
SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_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 each branch id, what are the names of the branches that were registered after 2015? ### Input: CREATE TABLE branch ( ...
How many of the other preterm infants weighing 1,750-1,999 grams had a lab test for 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Other preterm infants, 1,750-1,999 grams" 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: How many of the other preterm infants weighing 1,750-1,999 grams had a lab test for hematology? ### Input: CREATE TABLE lab ...
What brakes for the 4-speed automatic gearbox?
CREATE TABLE table_250230_2 ( brakes VARCHAR, gearbox VARCHAR )
SELECT brakes FROM table_250230_2 WHERE gearbox = "4-speed automatic"
Below are sql tables 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 brakes for the 4-speed automatic gearbox? ### Input: CREATE TABLE table_250230_2 ( brakes VARCHAR, gearbox VARC...
What is the title of Episode #2
CREATE TABLE table_165732_2 ( title VARCHAR, episode__number VARCHAR )
SELECT title FROM table_165732_2 WHERE episode__number = 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 title of Episode #2 ### Input: CREATE TABLE table_165732_2 ( title VARCHAR, episode__number VARCHAR ) ##...
A bar chart about what are the ids and names of the medicine that can interact with two or more enzymes?, and show in descending by the y axis please.
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, ...
SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY 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: A bar chart about what are the ids and names of the medicine that can interact with two or more enzymes?, and show in descen...
For those records from the products and each product's manufacturer, give me the comparison about the amount of name over the name , and group by attribute name, rank in desc by the names.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.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, give me the comparison about the amount of name over th...
What is the date of the match when Detroit is the home team and Colorado is the visiting team?
CREATE TABLE table_69019 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
SELECT "Date" FROM table_69019 WHERE "Home" = 'detroit' AND "Visitor" = 'colorado'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date of the match when Detroit is the home team and Colorado is the visiting team? ### Input: CREATE TABLE table...
how many male patients had the diagnosis long title atherosclerosis of native arteries of the extremities, unspecified?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Atherosclerosis of native arteries of the extremities, unspecified"
Below are sql tables 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 male patients had the diagnosis long title atherosclerosis of native arteries of the extremities, unspecified? ### ...
How many patients admitted before the year 2135 had urinary incontinence (unspecified)?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2135" AND diagnoses.long_title = "Urinary incontinence, unspecified"
Below are sql tables 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 admitted before the year 2135 had urinary incontinence (unspecified)? ### Input: CREATE TABLE procedures (...
count the number of patients whose death status is 1 and drug name is hydrocerin?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Hydrocerin"
Below are sql tables 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 death status is 1 and drug name is hydrocerin? ### Input: CREATE TABLE diagnoses ( su...
Which player from the United States is in a place of T2?
CREATE TABLE table_78623 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Player" FROM table_78623 WHERE "Place" = 't2' AND "Country" = 'united states'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player from the United States is in a place of T2? ### Input: CREATE TABLE table_78623 ( "Place" text, "Player...
What day is their record 13-15?
CREATE TABLE table_name_14 ( date VARCHAR, record VARCHAR )
SELECT date FROM table_name_14 WHERE record = "13-15"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What day is their record 13-15? ### Input: CREATE TABLE table_name_14 ( date VARCHAR, record VARCHAR ) ### Response:...
What Player has a Place of 2?
CREATE TABLE table_name_78 ( player VARCHAR, place VARCHAR )
SELECT player FROM table_name_78 WHERE place = "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 Player has a Place of 2? ### Input: CREATE TABLE table_name_78 ( player VARCHAR, place VARCHAR ) ### Response: ...
Name the zodiac for
CREATE TABLE table_23670 ( "Malayalam name" text, "Transliteration" text, "Concurrent Gregorian months" text, "Sanskrit word and meaning" text, "Zodiac sign" text )
SELECT "Zodiac sign" FROM table_23670 WHERE "Malayalam 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: Name the zodiac for ### Input: CREATE TABLE table_23670 ( "Malayalam name" text, "Transliteration" text, "Concur...
Name the record for may 31
CREATE TABLE table_53905 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Record" FROM table_53905 WHERE "Date" = 'may 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: Name the record for may 31 ### Input: CREATE TABLE table_53905 ( "Date" text, "Opponent" text, "Score" text, ...
what is drug type of drug name hydrocerin?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Hydrocerin"
Below are sql tables 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 drug type of drug name hydrocerin? ### Input: CREATE TABLE demographic ( subject_id text, hadm_id text, ...
What was the away team's score in the match at Lake Oval?
CREATE TABLE table_32241 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_32241 WHERE "Venue" = 'lake oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away team's score in the match at Lake Oval? ### Input: CREATE TABLE table_32241 ( "Home team" text, "H...
Find the name and position of physicians who prescribe some medication whose brand is X?
CREATE TABLE prescribes ( physician VARCHAR, medication VARCHAR ) CREATE TABLE medication ( code VARCHAR, Brand VARCHAR ) CREATE TABLE physician ( name VARCHAR, position VARCHAR, employeeid VARCHAR )
SELECT DISTINCT T1.name, T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = "X"
Below are sql tables 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 and position of physicians who prescribe some medication whose brand is X? ### Input: CREATE TABLE prescribes ...
how many patients whose admission location is clinic referral/premature and primary disease is newborn?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "NEWBORN"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose admission location is clinic referral/premature and primary disease is newborn? ### Input: CREATE TA...
For her classes , does Prof. Jason Harris set an exam ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For her classes , does Prof. Jason Harris set an exam ? ### Input: CREATE TABLE jobs ( job_id int, job_title varchar...
Next semester are there any classes taught by Dr. Yashar Afshar ?
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_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Yashar Afshar%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Next semester are there any classes taught by Dr. Yashar Afshar ? ### Input: CREATE TABLE student ( student_id int, ...
A bar chart for what are the number of the names of all the Japanese constructors that have earned more than 5 points?, rank in desc by the Y-axis.
CREATE TABLE constructorStandings ( constructorStandingsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL, position INTEGER, positionText TEXT, wins INTEGER ) CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT, forename TEXT, ...
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY COUNT(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: A bar chart for what are the number of the names of all the Japanese constructors that have earned more than 5 points?, rank...
what is average age of patients whose death status is 0 and admission year is greater than or equal to 2120?
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 AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear >= "2120"
Below are sql tables 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 average age of patients whose death status is 0 and admission year is greater than or equal to 2120? ### Input: CREA...
Bar chart of sum crs credit from each dept code, list from high to low by the X.
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_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: Bar chart of sum crs credit from each dept code, list from high to low by the X. ### Input: CREATE TABLE COURSE ( CRS_CO...
A bar chart for what are the number of the dates in which the mean sea level pressure was between 303 and 31?, and show Y-axis in descending order please.
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, d...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the dates in which the mean sea level pressure was between 303 and 31?, and show Y-ax...
A bar chart shows the distribution of meter_700 and ID , I want to sort in ascending by the bar.
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_700, ID FROM swimmer ORDER BY meter_700
Below are sql tables 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 meter_700 and ID , I want to sort in ascending by the bar. ### Input: CREATE TABLE swi...
What is top speed of a petrol engine at ps (kw; bhp)@5250-6250?
CREATE TABLE table_21154679_1 ( top_speed VARCHAR, max_power VARCHAR )
SELECT top_speed FROM table_21154679_1 WHERE max_power = "PS (kW; bhp)@5250-6250"
Below are sql tables 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 top speed of a petrol engine at ps (kw; bhp)@5250-6250? ### Input: CREATE TABLE table_21154679_1 ( top_speed VAR...
how many times is nitroglycerin prescribed to patient 54825 since 3 years ago?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND prescriptions.drug = 'nitroglycerin' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-3 year')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times is nitroglycerin prescribed to patient 54825 since 3 years ago? ### Input: CREATE TABLE inputevents_cv ( ...
tell me when was the first time that patient 20603 measured arterial bp mean?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
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 = 20603)) 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: tell me when was the first time that patient 20603 measured arterial bp mean? ### Input: CREATE TABLE d_labitems ( row_i...
For 867 , what times of the week will it be offered ?
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABL...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For 867 , what times of the week will it be offered ? ### Input: CREATE TABLE gsi ( course_offering_id int, student_...
count the number of times that patient 031-22988 in their first hospital encounter had a gastric (ng) output.
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
Below are sql tables 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 times that patient 031-22988 in their first hospital encounter had a gastric (ng) output. ### Input: CRE...
What was the tie number with the away team of Sheffield Wednesday?
CREATE TABLE table_name_63 ( tie_no VARCHAR, away_team VARCHAR )
SELECT tie_no FROM table_name_63 WHERE away_team = "sheffield wednesday"
Below are sql tables 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 tie number with the away team of Sheffield Wednesday? ### Input: CREATE TABLE table_name_63 ( tie_no VARCHA...
What is every entry for passed when NO votes is 312187?
CREATE TABLE table_256286_43 ( passed VARCHAR, no_votes VARCHAR )
SELECT passed FROM table_256286_43 WHERE no_votes = 312187
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every entry for passed when NO votes is 312187? ### Input: CREATE TABLE table_256286_43 ( passed VARCHAR, no...
what were the top four most frequent procedures that patients took within 2 months after receiving prone position in 2105?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'prone position' AND STRFTIME('%y', treat...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top four most frequent procedures that patients took within 2 months after receiving prone position in 2105? #...
Specify the birthdate and insurance of patient id 2560
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT demographic.dob, demographic.insurance FROM demographic WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Specify the birthdate and insurance of patient id 2560 ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id ...
When the Crowd was larger than 25,000. what was the Home Team score?
CREATE TABLE table_name_44 ( home_team VARCHAR, crowd INTEGER )
SELECT home_team AS score FROM table_name_44 WHERE crowd > 25 OFFSET 000
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the Crowd was larger than 25,000. what was the Home Team score? ### Input: CREATE TABLE table_name_44 ( home_team V...
What is the 2007/08number when the 2010/11 is 1,633.6?
CREATE TABLE table_30613 ( "IME Exchange (Including spot, credit and forward transactions)" text, "2007/08" text, "2008/09" text, "2009/10" text, "2010/11" text )
SELECT "2007/08" FROM table_30613 WHERE "2010/11" = '1,633.6'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 2007/08number when the 2010/11 is 1,633.6? ### Input: CREATE TABLE table_30613 ( "IME Exchange (Including sp...