instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Which away team was at windy hill?
CREATE TABLE table_11384 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_11384 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: Which away team was at windy hill? ### Input: CREATE TABLE table_11384 ( "Home team" text, "Home team score" text, ...
what are the five most frequently ordered microbiology tests for patients who received insulin earlier in the same hospital visit until 2101?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin' ...
Below are sql tables 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 five most frequently ordered microbiology tests for patients who received insulin earlier in the same hospital ...
Find total capacity of dorms for each gender in a bar chart, could you list bar in desc order please?
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dor...
SELECT gender, SUM(student_capacity) FROM Dorm GROUP BY gender ORDER BY gender 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 total capacity of dorms for each gender in a bar chart, could you list bar in desc order please? ### Input: CREATE TABL...
What is the losses for the 5 matches?
CREATE TABLE table_42342 ( "Year" text, "Matches" text, "Wins" text, "Losses" text, "No Result" text, "Success Rate" text )
SELECT "Losses" FROM table_42342 WHERE "Matches" = '5'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the losses for the 5 matches? ### Input: CREATE TABLE table_42342 ( "Year" text, "Matches" text, "Wins" ...
List the courses Prof. Yen Lin teaches .
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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Yen Lin%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = cours...
Below are sql tables 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 courses Prof. Yen Lin teaches . ### Input: CREATE TABLE student_record ( student_id int, course_id int, ...
What are the ids and names of the medicine that can interact with two or more enzymes?
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE medicine ( id number, name text,...
SELECT T1.id, T1.name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 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 are the ids and names of the medicine that can interact with two or more enzymes? ### Input: CREATE TABLE enzyme ( ...
Who has a rank below 125 and time of 00: 56.30?
CREATE TABLE table_name_32 ( name VARCHAR, rank VARCHAR, time VARCHAR )
SELECT name FROM table_name_32 WHERE rank < 125 AND time = "00: 56.30"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who has a rank below 125 and time of 00: 56.30? ### Input: CREATE TABLE table_name_32 ( name VARCHAR, rank VARCHAR, ...
Which surfaces have the final score of 6 1, 6 7 (2 7) , 7 6 (7 5) , 7 6 (10 8)?
CREATE TABLE table_25407 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
SELECT "Surface" FROM table_25407 WHERE "Score in the final" = '6–1, 6–7 (2–7) , 7–6 (7–5) , 7–6 (10–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: Which surfaces have the final score of 6 1, 6 7 (2 7) , 7 6 (7 5) , 7 6 (10 8)? ### Input: CREATE TABLE table_25407 ( "O...
list the id list of patients who have been diagnosed with obst chr bronc w/o exac until 2104.
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'obst chr bronc w/o exac') AND STRFTIME('%y', diagnoses_icd.charttime) <= '...
Below are sql tables 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 id list of patients who have been diagnosed with obst chr bronc w/o exac until 2104. ### Input: CREATE TABLE prescr...
what's the week where attendance is 77,098
CREATE TABLE table_227 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "TV" text, "Attendance" text, "Record" text )
SELECT "Week" FROM table_227 WHERE "Attendance" = '77,098'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the week where attendance is 77,098 ### Input: CREATE TABLE table_227 ( "Week" text, "Date" text, "Oppone...
find the number of patients born before 2087 who were discharged to skilled nursing facility.
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.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2087"
Below are sql tables 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 patients born before 2087 who were discharged to skilled nursing facility. ### Input: CREATE TABLE demogr...
How many instruments does the song 'Le Pop' use?
CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE songs ( songid number, title text ) CREATE...
SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop"
Below are sql tables 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 instruments does the song 'Le Pop' use? ### Input: CREATE TABLE tracklists ( albumid number, position numbe...
For those records from the products and each product's manufacturer, give me the comparison about the average of price over the headquarter , and group by attribute headquarter, and show in asc by the Headquarter.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about the average of price over ...
What are the changes (2010 to 2011) where the International Tourist Arrivals is 1.7 million?
CREATE TABLE table_14752049_2 ( change__2010_to_2011_ VARCHAR, international_tourist_arrivals__2011_ VARCHAR )
SELECT change__2010_to_2011_ FROM table_14752049_2 WHERE international_tourist_arrivals__2011_ = "1.7 million"
Below are sql tables 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 changes (2010 to 2011) where the International Tourist Arrivals is 1.7 million? ### Input: CREATE TABLE table_1...
Show the price of each product supplied by supplier id 3 in a pie chart.
CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), ...
SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the price of each product supplied by supplier id 3 in a pie chart. ### Input: CREATE TABLE Staff ( staff_id INTEGE...
What is the lowest total that has a rank less than 8, a silver greater than 6, and 20 as the bronze?
CREATE TABLE table_name_70 ( total INTEGER, bronze VARCHAR, rank VARCHAR, silver VARCHAR )
SELECT MIN(total) FROM table_name_70 WHERE rank < 8 AND silver > 6 AND bronze = 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: What is the lowest total that has a rank less than 8, a silver greater than 6, and 20 as the bronze? ### Input: CREATE TABLE...
Who has a place of T7 and is from the United States?
CREATE TABLE table_43702 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
SELECT "Player" FROM table_43702 WHERE "Place" = 't7' 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: Who has a place of T7 and is from the United States? ### Input: CREATE TABLE table_43702 ( "Place" text, "Player" te...
What is the name of the place where area is 578.28 square km?
CREATE TABLE table_176529_2 ( official_name VARCHAR, area_km_2 VARCHAR )
SELECT official_name FROM table_176529_2 WHERE area_km_2 = "578.28"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the place where area is 578.28 square km? ### Input: CREATE TABLE table_176529_2 ( official_name VAR...
What is Ground, when Home Team Score is 12.14 (86)?
CREATE TABLE table_44951 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
SELECT "Ground" FROM table_44951 WHERE "Home team score" = '12.14 (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: What is Ground, when Home Team Score is 12.14 (86)? ### Input: CREATE TABLE table_44951 ( "Home team" text, "Home te...
What were the lowest goals with a debut before 1961 in Europe?
CREATE TABLE table_69474 ( "Rank" real, "Player" text, "Goals" real, "Games" real, "Debut in Europe" real )
SELECT MIN("Goals") FROM table_69474 WHERE "Debut in Europe" < '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: What were the lowest goals with a debut before 1961 in Europe? ### Input: CREATE TABLE table_69474 ( "Rank" real, "P...
For those records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute headquarter in a bar chart, and could you sort by the Name from low to high?
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 Headquarter, T1.Name ORDER BY T1.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 records from the products and each product's manufacturer, show me about the distribution of name and price , and ...
what is the average value of reticulocyte count, automated in patient 15794's body during this month?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'reticulocyte count, automated') AND DATETIME(labevents.charttime, 'start of...
Below are sql tables 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 value of reticulocyte count, automated in patient 15794's body during this month? ### Input: CREATE TABL...
With the given loss of 4, what was the number of tries?
CREATE TABLE table_1751 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
SELECT COUNT("Tries for") FROM table_1751 WHERE "Lost" = '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: With the given loss of 4, what was the number of tries? ### Input: CREATE TABLE table_1751 ( "Club" text, "Played" t...
what is minimum age of patients whose gender is m and ethnicity is black/african american?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum age of patients whose gender is m and ethnicity is black/african american? ### Input: CREATE TABLE demograph...
Is AERO 410 always taught by either Prof. Rudolph Ware or Prof. Ryan Baxter ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar...
SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%Rudolph Ware%' AND NOT instructor.name LIKE '%Ryan Baxter%') AND course.course_id = course_offering.course_id AND course.department = 'AERO' AND course.number = 410 AND offering_instructor.instructor_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: Is AERO 410 always taught by either Prof. Rudolph Ware or Prof. Ryan Baxter ? ### Input: CREATE TABLE comment_instructor ( ...
did there exist any organism found in the last wound, decubitus microbiology test of patient 031-16123 until 11/2105?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( me...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'wound, decubitus' AND STRFTIME('%y-%m...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did there exist any organism found in the last wound, decubitus microbiology test of patient 031-16123 until 11/2105? ### In...
Is DENTED 614 always taught by Prof. Virginia Murphy or Prof. James Borders ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student_record ( student_...
SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%Virginia Murphy%' AND NOT instructor.name LIKE '%James Borders%') AND course.course_id = course_offering.course_id AND course.department = 'DENTED' AND course.number = 614 AND offering_instructor.instruct...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Is DENTED 614 always taught by Prof. Virginia Murphy or Prof. James Borders ? ### Input: CREATE TABLE comment_instructor ( ...
What are the different software platforms for devices, and how many devices have each, sort in desc by the total number.
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device...
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform 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: What are the different software platforms for devices, and how many devices have each, sort in desc by the total number. ###...
Calculate the total number of patients who had other endoscopy of the small intestine and died in or before the year 2111
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2111.0" AND procedures.long_title = "Other endoscopy of small intestine"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Calculate the total number of patients who had other endoscopy of the small intestine and died in or before the year 2111 ##...
What was the award before 2001?
CREATE TABLE table_name_32 ( award VARCHAR, year INTEGER )
SELECT award FROM table_name_32 WHERE year < 2001
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the award before 2001? ### Input: CREATE TABLE table_name_32 ( award VARCHAR, year INTEGER ) ### Response: ...
count the number of patients whose insurance is medicaid and diagnoses short title is aortocoronary bypass?
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 WHERE demographic.insurance = "Medicaid" AND diagnoses.short_title = "Aortocoronary bypass"
Below are sql tables 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 insurance is medicaid and diagnoses short title is aortocoronary bypass? ### Input: CREAT...
were there any results of the microbiology tests for patient 031-3355 in this hospital visit?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT COUNT(*) > 0 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))
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: were there any results of the microbiology tests for patient 031-3355 in this hospital visit? ### Input: CREATE TABLE microl...
Which location includes Coast Mountains with a rank less than 18 at Skihist Mountain?
CREATE TABLE table_71990 ( "Rank" real, "Mountain Peak" text, "Province" text, "Mountain Range" text, "Location" text )
SELECT "Location" FROM table_71990 WHERE "Mountain Range" = 'coast mountains' AND "Rank" < '18' AND "Mountain Peak" = 'skihist mountain'
Below are sql tables 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 location includes Coast Mountains with a rank less than 18 at Skihist Mountain? ### Input: CREATE TABLE table_71990 ( ...
until 6 months ago, what was the monthly maximum intake of po cl liqs of patient 008-19005?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-19005')) AND intakeoutput.celllabel = 'po cl...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 6 months ago, what was the monthly maximum intake of po cl liqs of patient 008-19005? ### Input: CREATE TABLE intakeou...
What venue features collingwood as the home side?
CREATE TABLE table_name_4 ( venue VARCHAR, home_team VARCHAR )
SELECT venue FROM table_name_4 WHERE home_team = "collingwood"
Below are sql tables 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 features collingwood as the home side? ### Input: CREATE TABLE table_name_4 ( venue VARCHAR, home_team VA...
how many days have it been since the time patient 68280 was admitted to hospital?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 68280 AND admissions.dischtime IS NULL
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days have it been since the time patient 68280 was admitted to hospital? ### Input: CREATE TABLE d_icd_procedures (...
count the number of patients whose marital status is single and drug route is po?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "PO"
Below are sql tables 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 marital status is single and drug route is po? ### Input: CREATE TABLE procedures ( s...
flights from DENVER to PITTSBURGH on wednesday
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
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 = 'PITTSBURGH' AND date_day.day_number = 23 AND date_day.month_number = 4 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: flights from DENVER to PITTSBURGH on wednesday ### Input: CREATE TABLE time_zone ( time_zone_code text, time_zone_na...
have at least one of the following: egfr < 60 ml / min / 1.73 m2, or serum sodium <= 134 meq / l, or urine output <= 125 ml / hr over anytime frame of at least 2 hours, following administration of iv furosemide of at least 40 mg.
CREATE TABLE table_test_30 ( "id" int, "ejection_fraction_ef" int, "multiple_long_bone_fractures" bool, "extracellular_volume_expansion" bool, "pregnancy_or_lactation" bool, "bleeding" int, "serum_potassium" float, "prosthetic_heart_valve" bool, "hbg" int, "anticoagulation" bool,...
SELECT * FROM table_test_30 WHERE estimated_glomerular_filtration_rate_egfr < 60 OR serum_sodium_concentration <= 134 OR urine_output <= 125 OR iv_furosemide >= 40
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: have at least one of the following: egfr < 60 ml / min / 1.73 m2, or serum sodium <= 134 meq / l, or urine output <= 125 ml ...
when did patient 025-42115 enter the hospital for the last time until 4 years ago?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '025-42115' 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 did patient 025-42115 enter the hospital for the last time until 4 years ago? ### Input: CREATE TABLE cost ( costid...
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of manufacturer , and group by attribute founder, rank by the bars in asc.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
Below are sql tables 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, draw a bar chart about the distribution of founder and ...
What is the Median family income when the Median household income is $38,137?
CREATE TABLE table_75626 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
SELECT "Median family income" FROM table_75626 WHERE "Median household income" = '$38,137'
Below are sql tables 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 Median family income when the Median household income is $38,137? ### Input: CREATE TABLE table_75626 ( "Cou...
what was the difference in the weight of patient 2518 measured at 2105-12-30 09:00:00 compared to the value measured at 2105-12-29 21:00:00.
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ad...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the difference in the weight of patient 2518 measured at 2105-12-30 09:00:00 compared to the value measured at 2105...
Display a bar chart for what are the different card types, and how many cards are there of each?, and I want to list bar from low to high order.
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_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: Display a bar chart for what are the different card types, and how many cards are there of each?, and I want to list bar fro...
what papers did NIPS publish ?
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'NIPS'
Below are sql tables 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 papers did NIPS publish ? ### Input: CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE pa...
What is the highest week of the game on November 9, 1997?
CREATE TABLE table_41798 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Location" text, "Attendance" text )
SELECT MAX("Week") FROM table_41798 WHERE "Date" = 'november 9, 1997'
Below are sql tables 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 highest week of the game on November 9, 1997? ### Input: CREATE TABLE table_41798 ( "Week" real, "Date" ...
during this year, did patient 025-60951 go to an emergency room?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '025-60951' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during this year, did patient 025-60951 go to an emergency room? ### Input: CREATE TABLE diagnosis ( diagnosisid number,...
What is the smallest positioned with more than 9 played?
CREATE TABLE table_5248 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
SELECT MIN("Position") FROM table_5248 WHERE "Played" > '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 smallest positioned with more than 9 played? ### Input: CREATE TABLE table_5248 ( "Position" real, "Team...
show me the flights arriving in BALTIMORE from PHILADELPHIA at about 4 o'clock
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, ...
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 ((flight.arrival_time <= 1630 AND flight.arrival_time >= 1530) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.t...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the flights arriving in BALTIMORE from PHILADELPHIA at about 4 o'clock ### Input: CREATE TABLE equipment_sequence ( ...
Find the max and min grade point for all letter grade.
CREATE TABLE department ( dno number, division text, dname text, room text, building text, dphone number ) CREATE TABLE gradeconversion ( lettergrade text, gradepoint number ) CREATE TABLE minor_in ( stuid number, dno number ) CREATE TABLE course ( cid text, cname text...
SELECT MAX(gradepoint), MIN(gradepoint) FROM gradeconversion
Below are sql tables 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 max and min grade point for all letter grade. ### Input: CREATE TABLE department ( dno number, division tex...
when did patient 028-55503 receive a test in the lab for the first time in the previous month?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55503')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 028-55503 receive a test in the lab for the first time in the previous month? ### Input: CREATE TABLE medic...
Return a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, order in descending by the X please.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, order in descending b...
What home team has a Home team score of 22.12 (144)?
CREATE TABLE table_10278 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_10278 WHERE "Home team score" = '22.12 (144)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What home team has a Home team score of 22.12 (144)? ### Input: CREATE TABLE table_10278 ( "Home team" text, "Home t...
give me the number of patients whose diagnoses icd9 code is 42831 and lab test fluid is other body fluid?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "42831" AND lab.fluid = "Other Body Fluid"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose diagnoses icd9 code is 42831 and lab test fluid is other body fluid? ### Input: CREATE ...
What party did the re-elected incumbent of the Texas 11 district belong to?
CREATE TABLE table_18523 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
SELECT "Party" FROM table_18523 WHERE "Result" = 'Re-elected' AND "District" = 'Texas 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 party did the re-elected incumbent of the Texas 11 district belong to? ### Input: CREATE TABLE table_18523 ( "Distr...
What record has September 21 as the date?
CREATE TABLE table_name_59 ( record VARCHAR, date VARCHAR )
SELECT record FROM table_name_59 WHERE date = "september 21"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What record has September 21 as the date? ### Input: CREATE TABLE table_name_59 ( record VARCHAR, date VARCHAR ) ###...
hematocrit < 36 ( female ) , < 38 ( male )
CREATE TABLE table_dev_53 ( "id" int, "anemia" bool, "gender" string, "hemoglobin_a1c_hba1c" float, "dyslipidemia" bool, "hct" int, "hematocrit_hct" float, "persistent_macroalbuminuria" bool, "urine_albumin" int, "high_density_lipoprotein_cholesterol_hdl_c" int, "coagulopathy...
SELECT * FROM table_dev_53 WHERE (gender = 'female' AND hematocrit_hct < 36) OR (gender = 'male' AND hematocrit_hct < 38)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: hematocrit < 36 ( female ) , < 38 ( male ) ### Input: CREATE TABLE table_dev_53 ( "id" int, "anemia" bool, "gend...
What is the name corresponding to the accoung with the lowest sum of checking and savings balances?
CREATE TABLE savings ( custid number, balance number ) CREATE TABLE checking ( custid number, balance number ) CREATE TABLE accounts ( custid number, name text )
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name corresponding to the accoung with the lowest sum of checking and savings balances? ### Input: CREATE TABLE ...
is the value of mchc of patient 8244 second measured on the first hospital visit less than it was first measured on the first hospital visit?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8244 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label =...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the value of mchc of patient 8244 second measured on the first hospital visit less than it was first measured on the firs...
what is the drug they has prescribed to patient 005-4471 two or more times?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005...
Below are sql tables 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 drug they has prescribed to patient 005-4471 two or more times? ### Input: CREATE TABLE medication ( medicat...
When can I take Applied Russian ?
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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 job...
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: When can I take Applied Russian ? ### Input: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) ...
what are all the result for New York 16 district
CREATE TABLE table_1341395_33 ( result VARCHAR, district VARCHAR )
SELECT result FROM table_1341395_33 WHERE district = "New York 16"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are all the result for New York 16 district ### Input: CREATE TABLE table_1341395_33 ( result VARCHAR, district...
papers by linda shapiro in 2016
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'linda shapiro' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: papers by linda shapiro in 2016 ### Input: CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal (...
After 10:00 , is there a section for PHYSICS 522 ?
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 DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'PHYSICS' AND course.number = 522 AND semester.semester = 'WN' 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: After 10:00 , is there a section for PHYSICS 522 ? ### Input: CREATE TABLE requirement ( requirement_id int, require...
flights from NEWARK to CLEVELAND DAILY 1700 o'clock pm
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight.departure_time = 1700 AND flight.to_airport = AIRPORT_SERVICE_1.ai...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from NEWARK to CLEVELAND DAILY 1700 o'clock pm ### Input: CREATE TABLE city ( city_code varchar, city_name v...
For those records from the products and each product's manufacturer, give me the comparison about revenue over the name , and group by attribute founder by a bar chart, could you show Y from high to low order?
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue 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 revenue over the name , an...
get me patient 002-39753's total input until 09/29/2102.
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-39753')) AND intakeoutput.cellpath LIKE '%in...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me patient 002-39753's total input until 09/29/2102. ### Input: CREATE TABLE allergy ( allergyid number, patient...
when was the last lab test patient 006-168146 has received in 10/last year?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-168146')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_T...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the last lab test patient 006-168146 has received in 10/last year? ### Input: CREATE TABLE medication ( medicat...
what is the mchc change/difference of patient 99018's last measured on the last hospital visit compared to the first value measured on the last hospital visit?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime t...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99018 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the mchc change/difference of patient 99018's last measured on the last hospital visit compared to the first value m...
what procedure did patient 70709 receive the first time since 1 year ago.
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70709) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TI...
Below are sql tables 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 procedure did patient 70709 receive the first time since 1 year ago. ### Input: CREATE TABLE patients ( row_id numb...
What's the change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of scheduled time (over three months)?
CREATE TABLE table_171748_3 ( change_over_same_quarter_the_previous_year VARCHAR, _percentage_trains_arriving_within_5_mins_of_scheduled_time__over_three_months_ VARCHAR )
SELECT change_over_same_quarter_the_previous_year FROM table_171748_3 WHERE _percentage_trains_arriving_within_5_mins_of_scheduled_time__over_three_months_ = "89.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's the change over same quarter the previous year in the period when the 89.6% of the trains arrive within 5 minutes of ...
what are the five most frequently given diagnoses for the patients who had previously received other brain incision within 2 months, during the last year?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, even...
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: what are the five most frequently given diagnoses for the patients who had previously received other brain incision within 2...
Return a bar chart about the distribution of Sex and the amount of Sex , and group by attribute Sex, could you order by the Y-axis in asc?
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY COUNT(Sex)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of Sex and the amount of Sex , and group by attribute Sex, could you order by the ...
what is minimum days of hospital stay of patients whose primary disease is rash?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "RASH"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is minimum days of hospital stay of patients whose primary disease is rash? ### Input: CREATE TABLE demographic ( s...
type i diabetes
CREATE TABLE table_train_207 ( "id" int, "anemia" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
SELECT * FROM table_train_207 WHERE diabetic = 'i'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: type i diabetes ### Input: CREATE TABLE table_train_207 ( "id" int, "anemia" bool, "hemoglobin_a1c_hba1c" float,...
What company made the chassis when Ferrari made the engine and there were 25 points?
CREATE TABLE table_name_73 ( chassis VARCHAR, engine VARCHAR, points VARCHAR )
SELECT chassis FROM table_name_73 WHERE engine = "ferrari" AND points = 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: What company made the chassis when Ferrari made the engine and there were 25 points? ### Input: CREATE TABLE table_name_73 (...
What is the Result of the game with 72,949 in attendance?
CREATE TABLE table_75934 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Result" FROM table_75934 WHERE "Attendance" = '72,949'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Result of the game with 72,949 in attendance? ### Input: CREATE TABLE table_75934 ( "Week" real, "Date" ...
get me the number of male patients diagnosed with continuous opioid type dependence.
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Opioid dependence-contin"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the number of male patients diagnosed with continuous opioid type dependence. ### Input: CREATE TABLE diagnoses ( ...
Show order ids and the number of products in each order by a scatter chart.
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,...
SELECT order_id, COUNT(DISTINCT product_id) FROM Order_Items
Below are sql tables 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 order ids and the number of products in each order by a scatter chart. ### Input: CREATE TABLE Invoices ( invoice_n...
What is the Dismissals with a Player with source: cricinfo.com?
CREATE TABLE table_54347 ( "Dismissals" text, "Player" text, "Versus" text, "Venue" text, "Date" text )
SELECT "Dismissals" FROM table_54347 WHERE "Player" = 'source: cricinfo.com'
Below are sql tables 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 Dismissals with a Player with source: cricinfo.com? ### Input: CREATE TABLE table_54347 ( "Dismissals" text,...
which team scored the most points ?
CREATE TABLE table_203_67 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number )
SELECT "team" FROM table_203_67 ORDER BY "points" DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which team scored the most points ? ### Input: CREATE TABLE table_203_67 ( id number, "place" number, "team" tex...
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 commission_pct , and list by the Y in ascending.
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 FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT
Below are sql tables 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...
For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the name , and group by attribute name by a bar chart, display in ascending by the bar.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.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 records from the products and each product's manufacturer, give me the comparison about the sum of code over the n...
For each faculty rank, show the number of faculty members who have it Show bar chart, and could you order from low to high by the bar?
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( Fac...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY Rank
Below are sql tables 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 faculty rank, show the number of faculty members who have it Show bar chart, and could you order from low to high b...
how many patients born before the year 2170 suffered from left internal jugular vein thrombosis;left arm edema?
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 WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.dob_year < "2170"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients born before the year 2170 suffered from left internal jugular vein thrombosis;left arm edema? ### Input: C...
Who are all the major users of the Gordon Close-Support Weapon System?
CREATE TABLE table_31149 ( "Name/ designation" text, "Year of intro" real, "Country of origin" text, "Primary cartridge" text, "Major users" text )
SELECT "Major users" FROM table_31149 WHERE "Name/ designation" = 'Gordon Close-Support Weapon System'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who are all the major users of the Gordon Close-Support Weapon System? ### Input: CREATE TABLE table_31149 ( "Name/ desi...
how many days has it passed since patient 006-172277 was admitted to the hospital?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days has it passed since patient 006-172277 was admitted to the hospital? ### Input: CREATE TABLE treatment ( t...
what kind of airplane is flight UA 270 from DENVER to PHILADELPHIA
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight ( aircraft_code_sequence text, air...
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.cit...
Below are sql tables 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 kind of airplane is flight UA 270 from DENVER to PHILADELPHIA ### Input: CREATE TABLE time_interval ( period text, ...
Name the engine with chassis of maserati 250f and entrant of luigi piotti with year less than 1957
CREATE TABLE table_69620 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
SELECT "Engine" FROM table_69620 WHERE "Chassis" = 'maserati 250f' AND "Entrant" = 'luigi piotti' AND "Year" < '1957'
Below are sql tables 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 engine with chassis of maserati 250f and entrant of luigi piotti with year less than 1957 ### Input: CREATE TABLE t...
What was the Attendance of the game against the Los Angeles Raiders?
CREATE TABLE table_9879 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
SELECT "Attendance" FROM table_9879 WHERE "Opponent" = 'los angeles raiders'
Below are sql tables 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 Attendance of the game against the Los Angeles Raiders? ### Input: CREATE TABLE table_9879 ( "Week" real, ...
On what date did the Brisbane Lions (1) win?
CREATE TABLE table_56418 ( "Season" text, "Cup FinalDate" text, "WinningTeam" text, "Score" text, "LosingTeam" text, "Cup Final Attendance" text )
SELECT "Cup FinalDate" FROM table_56418 WHERE "WinningTeam" = 'brisbane lions (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: On what date did the Brisbane Lions (1) win? ### Input: CREATE TABLE table_56418 ( "Season" text, "Cup FinalDate" te...
Please show different types of artworks with the corresponding number of artworks of each type.
CREATE TABLE artwork ( TYPE VARCHAR )
SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Please show different types of artworks with the corresponding number of artworks of each type. ### Input: CREATE TABLE artw...
mention the discharge time and diagnosis icd9 code of subject id 42820.
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 demographic.dischtime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42820"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: mention the discharge time and diagnosis icd9 code of subject id 42820. ### Input: CREATE TABLE diagnoses ( subject_id t...
When 21' 10.25 106.930mph is Tuesday August 24th what is Saturday August 29th?
CREATE TABLE table_26986076_5 ( sat_29_aug VARCHAR, tues_24_aug VARCHAR )
SELECT sat_29_aug FROM table_26986076_5 WHERE tues_24_aug = "21' 10.25 106.930mph"
Below are sql tables 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 21' 10.25 106.930mph is Tuesday August 24th what is Saturday August 29th? ### Input: CREATE TABLE table_26986076_5 ( ...
For each aircraft that has won an award, what is its name and how many time has it won. Show the proportion.
CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying t...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_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: For each aircraft that has won an award, what is its name and how many time has it won. Show the proportion. ### Input: CREA...
has there been any blood culture microbiology test done for patient 56490 in 09/last 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56490) AND microbiologyevents.spec_type_desc = 'blood culture' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of 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: has there been any blood culture microbiology test done for patient 56490 in 09/last year? ### Input: CREATE TABLE transfers...
what was patient 011-35642 diagnosed with the first time until 4 years ago?
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 microlab ( microl...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-35642')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CU...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 011-35642 diagnosed with the first time until 4 years ago? ### Input: CREATE TABLE vitalperiodic ( vita...
how many patients whose diagnoses short title is fetal/neonatal jaund nos and lab test abnormal status is abnormal?
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Fetal/neonatal jaund NOS" AND lab.flag = "abnormal"
Below are sql tables 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 short title is fetal/neonatal jaund nos and lab test abnormal status is abnormal? ### Inpu...
provide the number of patients whose ethnicity is white and year of birth is less than 2103?
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.ethnicity = "WHITE" AND demographic.dob_year < "2103"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose ethnicity is white and year of birth is less than 2103? ### Input: CREATE TABLE prescri...
Bar chart of how many headquarters from each headquarters, order from high to low by the bars.
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank i...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters 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 how many headquarters from each headquarters, order from high to low by the bars. ### Input: CREATE TABLE gas_s...