instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Show the name and age for all male people who don't have a wedding with a bar chart.
CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding)
Below are sql tables 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 name and age for all male people who don't have a wedding with a bar chart. ### Input: CREATE TABLE church ( Ch...
whem was illinois ' highest scoring game ?
CREATE TABLE table_204_22 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number, "record" text )
SELECT "date" FROM table_204_22 ORDER BY "result" 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: whem was illinois ' highest scoring game ? ### Input: CREATE TABLE table_204_22 ( id number, "date" text, "oppon...
A pie chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?
CREATE TABLE Characteristics ( characteristic_id INTEGER, characteristic_type_code VARCHAR(15), characteristic_data_type VARCHAR(10), characteristic_name VARCHAR(80), other_characteristic_details VARCHAR(255) ) CREATE TABLE Ref_Product_Categories ( product_category_code VARCHAR(15), product...
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description
Below are sql tables 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 pie chart for what are the number of the descriptions of the categories that products with product descriptions that conta...
list the number of patients who are male and admission type is newborn.
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 WHERE demographic.gender = "M" AND demographic.admission_type = "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: list the number of patients who are male and admission type is newborn. ### Input: CREATE TABLE prescriptions ( subject_...
What is the IcAO of Frankfurt?
CREATE TABLE table_name_91 ( icao VARCHAR, city VARCHAR )
SELECT icao FROM table_name_91 WHERE city = "frankfurt"
Below are sql tables 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 IcAO of Frankfurt? ### Input: CREATE TABLE table_name_91 ( icao VARCHAR, city VARCHAR ) ### Response: SE...
Show the number of customers for each gender. Show scatter chart.
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Or...
SELECT gender, COUNT(*) FROM Customers GROUP BY gender
Below are sql tables 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 customers for each gender. Show scatter chart. ### Input: CREATE TABLE Financial_Transactions ( trans...
how many patients of hispanic/latino and use the base drug type?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" 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 of hispanic/latino and use the base drug type? ### Input: CREATE TABLE lab ( subject_id text, hadm...
What is the county with an AA IHSAA class in ferdinand?
CREATE TABLE table_14235 ( "School" text, "Mascot" text, "Location" text, "Size" real, "IHSAA Class" text, "County" text )
SELECT "County" FROM table_14235 WHERE "IHSAA Class" = 'aa' AND "Location" = 'ferdinand'
Below are sql tables 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 county with an AA IHSAA class in ferdinand? ### Input: CREATE TABLE table_14235 ( "School" text, "Mascot...
until 2102, what was the three most frequently ordered procedure for patients 30s?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_ca...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
Below are sql tables 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 2102, what was the three most frequently ordered procedure for patients 30s? ### Input: CREATE TABLE inputevents_cv ( ...
count the number of patients who had undergone hypothermia two or more times until 4 years ago.
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 WHERE d_icd_procedures.short_title = 'hypothermia') AND DAT...
Below are sql tables 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 who had undergone hypothermia two or more times until 4 years ago. ### Input: CREATE TABLE char...
Which college with a position of rb had a pick larger than 6 in round 28?
CREATE TABLE table_9606 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT "College" FROM table_9606 WHERE "Pick" > '6' AND "Position" = 'rb' AND "Round" = '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: Which college with a position of rb had a pick larger than 6 in round 28? ### Input: CREATE TABLE table_9606 ( "Round" r...
provide the number of patients whose ethnicity is black/cape verdean and age is less than 68?
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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "68"
Below are sql tables 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 black/cape verdean and age is less than 68? ### Input: CREATE TABLE lab ( ...
How many totals have golds of 3, silvers of 3, and bronzes under 3?
CREATE TABLE table_9500 ( "Rank" text, "Nation" text, "Gold" text, "Silver" text, "Bronze" real, "Total" real )
SELECT SUM("Total") FROM table_9500 WHERE "Gold" = '3' AND "Bronze" < '3' AND "Silver" = '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: How many totals have golds of 3, silvers of 3, and bronzes under 3? ### Input: CREATE TABLE table_9500 ( "Rank" text, ...
which college had a running back player
CREATE TABLE table_23993 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "Height" text, "Weight" text, "College" text, "Status" text )
SELECT "College" FROM table_23993 WHERE "Position" = 'Running back'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which college had a running back player ### Input: CREATE TABLE table_23993 ( "Round" real, "Pick #" real, "Play...
provide the number of patients whose admission location is clinic referral/premature and year of birth is less than 2117?
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.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2117"
Below are sql tables 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 admission location is clinic referral/premature and year of birth is less than 2117? ##...
Show me the total number by grape in a histogram, and display by the X-axis in asc.
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape
Below are sql tables 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 grape in a histogram, and display by the X-axis in asc. ### Input: CREATE TABLE grapes ( ID ...
What was the team's record at the game attended by 30,452?
CREATE TABLE table_name_22 ( record VARCHAR, attendance VARCHAR )
SELECT record FROM table_name_22 WHERE attendance = "30,452"
Below are sql tables 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 team's record at the game attended by 30,452? ### Input: CREATE TABLE table_name_22 ( record VARCHAR, a...
What was the title of the episode with production code 2J5515?
CREATE TABLE table_28582091_2 ( title VARCHAR, production_code VARCHAR )
SELECT title FROM table_28582091_2 WHERE production_code = "2J5515"
Below are sql tables 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 title of the episode with production code 2J5515? ### Input: CREATE TABLE table_28582091_2 ( title VARCHAR,...
Which tournament was played on clay and there was a score of 4 6, 6 1, 6 4?
CREATE TABLE table_name_52 ( tournament VARCHAR, surface VARCHAR, score VARCHAR )
SELECT tournament FROM table_name_52 WHERE surface = "clay" AND score = "4–6, 6–1, 6–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: Which tournament was played on clay and there was a score of 4 6, 6 1, 6 4? ### Input: CREATE TABLE table_name_52 ( tour...
The score in the final is 2 6, 6 2, 6 0, on what surface?
CREATE TABLE table_73921 ( "Outcome" text, "No." text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
SELECT "Surface" FROM table_73921 WHERE "Score in the final" = '2–6, 6–2, 6–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: The score in the final is 2 6, 6 2, 6 0, on what surface? ### Input: CREATE TABLE table_73921 ( "Outcome" text, "No....
What is the name of each aircraft and how many flights does each one complete?
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, name text, di...
SELECT T2.name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
Below are sql tables 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 each aircraft and how many flights does each one complete? ### Input: CREATE TABLE flight ( flno num...
At what point will Practicum Kines be offered ?
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT semester.semester, semester.year FROM semester INNER JOIN course_offering ON semester.semester_id = course_offering.semester INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name LIKE '%Practicum Kines%' AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM sem...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: At what point will Practicum Kines be offered ? ### Input: CREATE TABLE course_offering ( offering_id int, course_id...
how many patients received a impacted feces removal within 2 months after the diagnosis of dmii wo cmp nt st uncntr, until 1 year ago?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE c...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dmii wo cmp nt st ...
Below are sql tables 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 received a impacted feces removal within 2 months after the diagnosis of dmii wo cmp nt st uncntr, until 1...
Who were the opponents when there was an attendance of 48,165?
CREATE TABLE table_61240 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text )
SELECT "Opponent#" FROM table_61240 WHERE "Attendance" = '48,165'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who were the opponents when there was an attendance of 48,165? ### Input: CREATE TABLE table_61240 ( "Date" text, "O...
Return a bar chart about the distribution of All_Games and School_ID , and rank total number from low to high order.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Games, School_ID FROM basketball_match ORDER BY School_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of All_Games and School_ID , and rank total number from low to high order. ### Inp...
how many days have passed from the first time patient 25733 stayed in ward 52 during their current hospital visit?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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_care...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733 AND admissions.dischtime IS NULL)) AND transfers....
Below are sql tables 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 passed from the first time patient 25733 stayed in ward 52 during their current hospital visit? ### Input...
Who had the most high points and rebounds than charles oakley (9)?
CREATE TABLE table_887 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "High points" FROM table_887 WHERE "High rebounds" = 'Charles Oakley (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: Who had the most high points and rebounds than charles oakley (9)? ### Input: CREATE TABLE table_887 ( "Game" real, ...
Show each apartment type code, and the maximum and minimum number of rooms for each type.
CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CREATE TABLE guests ( guest_id number, ge...
SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM apartments GROUP BY apt_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: Show each apartment type code, and the maximum and minimum number of rooms for each type. ### Input: CREATE TABLE apartment_...
How many different software platforms are there for devices?
CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT COUNT(DISTINCT software_platform) FROM device
Below are sql tables 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 different software platforms are there for devices? ### Input: CREATE TABLE stock ( shop_id number, device_...
Return a bar chart on what are the names of the different bank branches, and what are their total loan amounts?, and rank x axis from low to high order please.
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3)...
SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY bname
Below are sql tables 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 on what are the names of the different bank branches, and what are their total loan amounts?, and rank x ...
Who was the opponent at the game when the record was 4-5?
CREATE TABLE table_name_69 ( opponent VARCHAR, record VARCHAR )
SELECT opponent FROM table_name_69 WHERE record = "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: Who was the opponent at the game when the record was 4-5? ### Input: CREATE TABLE table_name_69 ( opponent VARCHAR, ...
Draw a line chart about the change of the sum of monthly_rental over date_address_to , and group by attribute other_details.
CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Teachers ( teacher_id...
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental 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 line chart about the change of the sum of monthly_rental over date_address_to , and group by attribute other_details....
What is Score, when Country is 'United States', and when Player is 'Bob Tway'?
CREATE TABLE table_60082 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Score" FROM table_60082 WHERE "Country" = 'united states' AND "Player" = 'bob tway'
Below are sql tables 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 Score, when Country is 'United States', and when Player is 'Bob Tway'? ### Input: CREATE TABLE table_60082 ( "Pl...
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, sort by the Y-axis in desc.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the avera...
until 3 years ago, what were the top five most common intakes?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) CR...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 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: until 3 years ago, what were the top five most common intakes? ### Input: CREATE TABLE patients ( row_id number, sub...
what did patient 004-65311 receive for his or her last procedure?
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 treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-65311')) ORDER BY treatment.treatmenttime DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what did patient 004-65311 receive for his or her last procedure? ### Input: CREATE TABLE medication ( medicationid numb...
provide the number of patients whose marital status is single and who have got amylase, ascites lab test done.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Amylase, Ascites"
Below are sql tables 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 marital status is single and who have got amylase, ascites lab test done. ### Input: CR...
Which Record has a Score of w 107 102 (ot)?
CREATE TABLE table_48736 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Record" FROM table_48736 WHERE "Score" = 'w 107–102 (ot)'
Below are sql tables 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 Record has a Score of w 107 102 (ot)? ### Input: CREATE TABLE table_48736 ( "Game" real, "Date" text, "Tea...
What's the average Grid with Laps of 88?
CREATE TABLE table_name_66 ( grid INTEGER, laps VARCHAR )
SELECT AVG(grid) FROM table_name_66 WHERE laps = 88
Below are sql tables 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 average Grid with Laps of 88? ### Input: CREATE TABLE table_name_66 ( grid INTEGER, laps VARCHAR ) ### Re...
has patient 015-60616 been prescribed any medications in the first hospital encounter.
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-60616' 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: has patient 015-60616 been prescribed any medications in the first hospital encounter. ### Input: CREATE TABLE patient ( ...
tell me the length of stay of patient 006-50099's last stay in the icu.
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 cost ( costid num...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-50099') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime 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: tell me the length of stay of patient 006-50099's last stay in the icu. ### Input: CREATE TABLE vitalperiodic ( vitalper...
Name the archive for run time of 23:55
CREATE TABLE table_24055 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
SELECT "Archive" FROM table_24055 WHERE "Run time" = '23:55'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the archive for run time of 23:55 ### Input: CREATE TABLE table_24055 ( "Episode" text, "Broadcast date" text, ...
I want to know the proportion of the average age for each class.
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
SELECT Class, AVG(age) FROM captain GROUP BY Class
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to know the proportion of the average age for each class. ### Input: CREATE TABLE Ship ( Ship_ID int, Name te...
which title has the longest name ?
CREATE TABLE table_204_906 ( id number, "#" number, "title" text, "songwriters" text, "producer(s)" text, "performer" text )
SELECT "title" FROM table_204_906 ORDER BY LENGTH("title") 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 title has the longest name ? ### Input: CREATE TABLE table_204_906 ( id number, "#" number, "title" text, ...
How many were first elected in California 7?
CREATE TABLE table_23280 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "First elected" FROM table_23280 WHERE "District" = 'California 7'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many were first elected in California 7? ### Input: CREATE TABLE table_23280 ( "District" text, "Incumbent" text...
Which venue did Luke Blackwell serve as captain?
CREATE TABLE table_18796 ( "Season" real, "Premiers" text, "Runners Up" text, "Score" text, "Captain" text, "Coach" text, "Simpson Medal" text, "Venue" text, "Attendance" real, "Umpires" text )
SELECT "Venue" FROM table_18796 WHERE "Captain" = 'Luke Blackwell'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue did Luke Blackwell serve as captain? ### Input: CREATE TABLE table_18796 ( "Season" real, "Premiers" tex...
Who is the player with a 68-67-75=210 score?
CREATE TABLE table_name_29 ( player VARCHAR, score VARCHAR )
SELECT player FROM table_name_29 WHERE score = 68 - 67 - 75 = 210
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the player with a 68-67-75=210 score? ### Input: CREATE TABLE table_name_29 ( player VARCHAR, score VARCHAR )...
Bar chart x axis date of birth y axis height, and list by the bar in ascending.
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth
Below are sql tables 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 x axis date of birth y axis height, and list by the bar in ascending. ### Input: CREATE TABLE people ( People_...
What position does the College of Louisiana State have?
CREATE TABLE table_5835 ( "Round" real, "Selection" text, "Name" text, "Position" text, "College" text, "Contract" text )
SELECT "Position" FROM table_5835 WHERE "College" = 'louisiana state'
Below are sql tables 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 position does the College of Louisiana State have? ### Input: CREATE TABLE table_5835 ( "Round" real, "Selectio...
find the number of patients who died in or before the year 2186 and their drug code was mom301.
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2186.0" AND prescriptions.formulary_drug_cd = "MOM30L"
Below are sql tables 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 who died in or before the year 2186 and their drug code was mom301. ### Input: CREATE TABLE pres...
Top Reputation in the Netherlands.
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuest...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Netherlands%' ORDER BY Reputation 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: Top Reputation in the Netherlands. ### Input: CREATE TABLE Tags ( Id number, TagName text, Count number, Exc...
what is the number of patients whose admission location is phys referral/normal deli and procedure icd9 code is 9955?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "9955"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission location is phys referral/normal deli and procedure icd9 code is 9955? ### In...
What is the date of week 8?
CREATE TABLE table_name_23 ( date VARCHAR, week VARCHAR )
SELECT date FROM table_name_23 WHERE week = 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: What is the date of week 8? ### Input: CREATE TABLE table_name_23 ( date VARCHAR, week VARCHAR ) ### Response: SELEC...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and employee_id , and sort bars from high to low order please.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_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 employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the di...
Which opponent was present on March 28?
CREATE TABLE table_38850 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
SELECT "Opponent" FROM table_38850 WHERE "March" = '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: Which opponent was present on March 28? ### Input: CREATE TABLE table_38850 ( "Game" real, "March" real, "Oppone...
Give me a stacked bar chart for showing the total number of each ship type and categorize it by ship nationality, and order by the Y-axis in desc.
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY COUNT(Type) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a stacked bar chart for showing the total number of each ship type and categorize it by ship nationality, and order ...
give me the number of patients whose procedure short title is endosc remove bile stone?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Endosc remove bile stone"
Below are sql tables 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 procedure short title is endosc remove bile stone? ### Input: CREATE TABLE lab ( su...
what is the top five most common intake since 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 t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) >= '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 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 top five most common intake since 2102? ### Input: CREATE TABLE allergy ( allergyid number, patientunits...
What team was the home team against Melbourne?
CREATE TABLE table_58256 ( "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_58256 WHERE "Away 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 team was the home team against Melbourne? ### Input: CREATE TABLE table_58256 ( "Home team" text, "Home team sc...
what is admission type and death status of subject id 10317?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "10317"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is admission type and death status of subject id 10317? ### Input: CREATE TABLE diagnoses ( subject_id text, ha...
calculate the number of patients staying in the id micu careunit the last year.
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid nu...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the number of patients staying in the id micu careunit the last year. ### Input: CREATE TABLE outputevents ( r...
has patient 022-142620 received any medication until 08/2105?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-142620')) AND STRFTIME('%y-%m', medication.drugstarttime) <= '2105-08'
Below are sql tables 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 022-142620 received any medication until 08/2105? ### Input: CREATE TABLE medication ( medicationid number, ...
Which tournament has a 2007 of 2r, and a 2011 of 2r?
CREATE TABLE table_69607 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "Tournament" FROM table_69607 WHERE "2007" = '2r' AND "2011" = '2r'
Below are sql tables 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 tournament has a 2007 of 2r, and a 2011 of 2r? ### Input: CREATE TABLE table_69607 ( "Tournament" text, "2006"...
What is the constructor of the driver Heinz-Harald Frentzen?
CREATE TABLE table_57600 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
SELECT "Constructor" FROM table_57600 WHERE "Driver" = 'heinz-harald frentzen'
Below are sql tables 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 constructor of the driver Heinz-Harald Frentzen? ### Input: CREATE TABLE table_57600 ( "Driver" text, "C...
What is the name of episode number 77 in the series?
CREATE TABLE table_26548 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
SELECT "Title" FROM table_26548 WHERE "No. in series" = '77'
Below are sql tables 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 episode number 77 in the series? ### Input: CREATE TABLE table_26548 ( "No. in series" real, "No...
find the number of emergency hospital admission patients who were less than 68 years of age.
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.age < "68"
Below are sql tables 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 emergency hospital admission patients who were less than 68 years of age. ### Input: CREATE TABLE diagnos...
What is the customer id, first and last name with least number of accounts.
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE customers_cards ( card_id number, customer_id number, card_type_code text, ...
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM customers_cards AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) 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 customer id, first and last name with least number of accounts. ### Input: CREATE TABLE customers ( customer...
When is the Monsters of Rock show with 12 bands?
CREATE TABLE table_31803 ( "Year" real, "Date" text, "Event" text, "Days" text, "Stages" text, "Acts" text )
SELECT "Date" FROM table_31803 WHERE "Event" = 'monsters of rock' AND "Acts" = '12 bands'
Below are sql tables 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 is the Monsters of Rock show with 12 bands? ### Input: CREATE TABLE table_31803 ( "Year" real, "Date" text, ...
list the three earliest flights from ATLANTA to PHILADELPHIA on wednesday
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, descript...
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 = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = 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: list the three earliest flights from ATLANTA to PHILADELPHIA on wednesday ### Input: CREATE TABLE date_day ( month_numbe...
What is the smallest gold value that has a total over 15 and bronze values under 31?
CREATE TABLE table_36792 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Gold") FROM table_36792 WHERE "Total" > '15' AND "Bronze" < '31'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the smallest gold value that has a total over 15 and bronze values under 31? ### Input: CREATE TABLE table_36792 ( ...
report the number of patients on tp route of drug administration who are younger than 36 years of age.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "36" AND prescriptions.route = "TP"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: report the number of patients on tp route of drug administration who are younger than 36 years of age. ### Input: CREATE TAB...
provide the number of patients taking drug via ih route who were diagnosed with other cardiac dysrhythmias.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cardiac dysrhythmias NEC" AND prescriptions.route = "IH"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients taking drug via ih route who were diagnosed with other cardiac dysrhythmias. ### Input: CREAT...
Plot the total number by grouped by booking status code as a bar graph
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartments ( apt_id INTEGER, ...
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_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: Plot the total number by grouped by booking status code as a bar graph ### Input: CREATE TABLE Apartment_Buildings ( bui...
what drug was prescribed to patient 013-27480 in the same day after the antibiotics - macrolide procedure when they came to the hospital first time?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480' AND NOT patient.hospit...
Below are sql tables 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 drug was prescribed to patient 013-27480 in the same day after the antibiotics - macrolide procedure when they came to ...
Can you draw the trend of the number of actual delivery date over the actual delivery date?, and order X-axis in descending order.
CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CRE...
SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY Actual_Delivery_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: Can you draw the trend of the number of actual delivery date over the actual delivery date?, and order X-axis in descending ...
Where was Collingwood's away game played?
CREATE TABLE table_52079 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_52079 WHERE "Away 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: Where was Collingwood's away game played? ### Input: CREATE TABLE table_52079 ( "Home team" text, "Home team score" ...
Name the max top 5 for 5.0 avg finish
CREATE TABLE table_1671401_2 ( top_5 INTEGER, avg_finish VARCHAR )
SELECT MAX(top_5) FROM table_1671401_2 WHERE avg_finish = "5.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: Name the max top 5 for 5.0 avg finish ### Input: CREATE TABLE table_1671401_2 ( top_5 INTEGER, avg_finish VARCHAR ) ...
Who were the partners in games where the score was 7-5, 2-6, [6-10]?
CREATE TABLE table_2648 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
SELECT "Partner" FROM table_2648 WHERE "Score" = '7-5, 2-6, [6-10]'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who were the partners in games where the score was 7-5, 2-6, [6-10]? ### Input: CREATE TABLE table_2648 ( "Outcome" text...
Show me about the distribution of Nationality and the sum of ID , and group by attribute Nationality in a bar chart.
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 Nationality, SUM(ID) FROM swimmer GROUP BY Nationality
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of Nationality and the sum of ID , and group by attribute Nationality in a bar chart. ### Inp...
Name the settlement for
CREATE TABLE table_27868 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
SELECT "Settlement" FROM table_27868 WHERE "Cyrillic Name Other Names" = 'Александрово'
Below are sql tables 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 settlement for ### Input: CREATE TABLE table_27868 ( "Settlement" text, "Cyrillic Name Other Names" text, ...
What years did Dwane Morrison had a pct less than 0.389 and losses less than 12?
CREATE TABLE table_34062 ( "Name" text, "Years" text, "Seasons" real, "Lost" real, "Pct." real )
SELECT "Years" FROM table_34062 WHERE "Pct." < '0.389' AND "Lost" < '12' AND "Name" = 'dwane morrison'
Below are sql tables 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 years did Dwane Morrison had a pct less than 0.389 and losses less than 12? ### Input: CREATE TABLE table_34062 ( "...
what were the number of games scheduled in november ?
CREATE TABLE table_203_691 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
SELECT COUNT(*) FROM table_203_691 WHERE "date" = 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 were the number of games scheduled in november ? ### Input: CREATE TABLE table_203_691 ( id number, "week" numb...
had there been some organisms in patient 031-3355's first blood, venipuncture microbiology test on their current hospital encounter?
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 intakeoutput ( in...
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)) AND microlab.culturesite...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had there been some organisms in patient 031-3355's first blood, venipuncture microbiology test on their current hospital en...
For the game played on November 29, who had the highest rebounds?
CREATE TABLE table_name_73 ( high_rebounds VARCHAR, date VARCHAR )
SELECT high_rebounds FROM table_name_73 WHERE date = "november 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: For the game played on November 29, who had the highest rebounds? ### Input: CREATE TABLE table_name_73 ( high_rebounds ...
What was the away team at mcg?
CREATE TABLE table_55284 ( "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_55284 WHERE "Venue" = 'mcg'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away team at mcg? ### Input: CREATE TABLE table_55284 ( "Home team" text, "Home team score" text, "...
What is the Song choice with a Theme that is 1960s?
CREATE TABLE table_7323 ( "Week #" text, "Theme" text, "Song choice" text, "Order #" text, "Result" text )
SELECT "Song choice" FROM table_7323 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_7323 ( "Week #" text, "Theme" text...
For those products with a price between 60 and 120, visualize a pie chart about the proportion of name and price.
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 Name, Price FROM Products WHERE Price BETWEEN 60 AND 120
Below are sql tables 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 products with a price between 60 and 120, visualize a pie chart about the proportion of name and price. ### Input:...
Return a histogram on what are the names and prices of all products in the store?, show bars in desc order please.
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 Name, AVG(Price) FROM Products GROUP BY Name ORDER BY 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: Return a histogram on what are the names and prices of all products in the store?, show bars in desc order please. ### Input...
What year was incumbent mark w. hannaford elected?
CREATE TABLE table_1341672_6 ( first_elected INTEGER, incumbent VARCHAR )
SELECT MIN(first_elected) FROM table_1341672_6 WHERE incumbent = "Mark W. Hannaford"
Below are sql tables 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 year was incumbent mark w. hannaford elected? ### Input: CREATE TABLE table_1341672_6 ( first_elected INTEGER, ...
Name the total number of swimsuits for evening gowns less than 8.21 and average of 8.453 with interview less than 9.09
CREATE TABLE table_78217 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
SELECT COUNT("Swimsuit") FROM table_78217 WHERE "Interview" < '9.09' AND "Evening Gown" < '8.21' AND "Average" = '8.453'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of swimsuits for evening gowns less than 8.21 and average of 8.453 with interview less than 9.09 ### I...
Which students live in the city with code 'NYC' and have class senator votes in the spring election cycle? Count the numbers.
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
SELECT COUNT(*) FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = class_senator_vote WHERE T1.city_code = "NYC" AND T2.election_cycle = "Spring"
Below are sql tables 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 students live in the city with code 'NYC' and have class senator votes in the spring election cycle? Count the numbers...
What was South Melbourne's away team score?
CREATE TABLE table_52932 ( "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_52932 WHERE "Away team" = 'south melbourne'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was South Melbourne's away team score? ### Input: CREATE TABLE table_52932 ( "Home team" text, "Home team score...
What past classes has Dr. Nicole Appleberry taught ?
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 WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = 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: What past classes has Dr. Nicole Appleberry taught ? ### Input: CREATE TABLE student ( student_id int, lastname varc...
What golfer has 281 as their total?
CREATE TABLE table_name_52 ( player VARCHAR, total VARCHAR )
SELECT player FROM table_name_52 WHERE total = 281
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What golfer has 281 as their total? ### Input: CREATE TABLE table_name_52 ( player VARCHAR, total VARCHAR ) ### Resp...
give me the number of patients whose year of death is less than or equal to 2126 and procedure icd9 code is 3964?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.icd9_code = "3964"
Below are sql tables 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 2126 and procedure icd9 code is 3964? ### Input:...
indicate the yearly minimum dose of tpn d11.0 that patient 4684 has received until 06/14/2104.
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid ...
SELECT MIN(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4684)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the yearly minimum dose of tpn d11.0 that patient 4684 has received until 06/14/2104. ### Input: CREATE TABLE proce...
What player has a total of 158/
CREATE TABLE table_name_54 ( player VARCHAR, total VARCHAR )
SELECT player FROM table_name_54 WHERE total = "158"
Below are sql tables 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 total of 158/ ### Input: CREATE TABLE table_name_54 ( player VARCHAR, total VARCHAR ) ### Response...
what is the minimum total cost of the hospital, which includes the procedure under the name of glucocorticoid administration in 2104?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid n...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'glucocorticoid administration')) AND STRFTIM...
Below are sql tables 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 minimum total cost of the hospital, which includes the procedure under the name of glucocorticoid administration...
what was the dosage of ezetimibe that was last prescribed to patient 82159 during their last hospital encounter?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'ezetimibe' ORDER BY prescriptions.startdate DESC LI...
Below are sql tables 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 dosage of ezetimibe that was last prescribed to patient 82159 during their last hospital encounter? ### Input: ...
What is the Original air date for the episode with a Production code of 07-00-107?
CREATE TABLE table_41602 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
SELECT "Original air date" FROM table_41602 WHERE "Production code" = '07-00-107'
Below are sql tables 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 the episode with a Production code of 07-00-107? ### Input: CREATE TABLE table_41602 ( ...