instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
What is the Rank of the swimmer with a Time of 49 in Lane 7 or larger?
CREATE TABLE table_name_41 ( rank VARCHAR, time VARCHAR, lane VARCHAR )
SELECT COUNT(rank) FROM table_name_41 WHERE time = 49 AND lane > 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: What is the Rank of the swimmer with a Time of 49 in Lane 7 or larger? ### Input: CREATE TABLE table_name_41 ( rank VARC...
If collingwood was the Home team, what Date did they play?
CREATE TABLE table_58082 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_58082 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: If collingwood was the Home team, what Date did they play? ### Input: CREATE TABLE table_58082 ( "Home team" text, "...
What ist he Home with a Score that is 42-64?
CREATE TABLE table_39910 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
SELECT "Home" FROM table_39910 WHERE "Score" = '42-64'
Below are sql tables 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 ist he Home with a Score that is 42-64? ### Input: CREATE TABLE table_39910 ( "Date" text, "Time" text, "Ho...
count the number of patients who were admitted for more than 5 days in hospital and had chemistry lab test category.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "5" AND lab."CATEGORY" = "Chemistry"
Below are sql tables 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 were admitted for more than 5 days in hospital and had chemistry lab test category. ### Inp...
Which complaint status has more than 3 records on file?
CREATE TABLE products ( product_id number, parent_product_id number, product_category_code text, date_product_first_available time, date_product_discontinued time, product_name text, product_description text, product_price number ) CREATE TABLE complaints ( complaint_id number, ...
SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 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: Which complaint status has more than 3 records on file? ### Input: CREATE TABLE products ( product_id number, parent...
what was the length of stay in patient 26195's first hospital stay?
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 number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 26195 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the length of stay in patient 26195's first hospital stay? ### Input: CREATE TABLE d_items ( row_id number, ...
What is the Score of the Scarborough Home game?
CREATE TABLE table_62995 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT "Score" FROM table_62995 WHERE "Home team" = 'scarborough'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Score of the Scarborough Home game? ### Input: CREATE TABLE table_62995 ( "Tie no" text, "Home team" tex...
Provide the number of patients whose marital satus is divorced that had a lab test for protein/creatinine ratio.
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Protein/Creatinine Ratio"
Below are sql tables 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 satus is divorced that had a lab test for protein/creatinine ratio. ### Input: ...
What is the smallest number of events with 24 cuts and less than 11 in the top-25?
CREATE TABLE table_name_34 ( events INTEGER, cuts_made VARCHAR, top_25 VARCHAR )
SELECT MIN(events) FROM table_name_34 WHERE cuts_made = 24 AND top_25 < 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 is the smallest number of events with 24 cuts and less than 11 in the top-25? ### Input: CREATE TABLE table_name_34 ( ...
Top SO users from Hong Kong.
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS Link, DisplayName, Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%hong%kong%' OR Location LIKE '% %') ORDER BY Reputation DESC LIMIT 50
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top SO users from Hong Kong. ### Input: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
body mass index between 18.5 and 26.9 kg / m2
CREATE TABLE table_train_237 ( "id" int, "fasting_c_peptide" float, "fasting_plasma_glucose" int, "smoking" bool, "body_mass_index_bmi" float, "serum_25_oh_d_levels" int, "NOUSE" float )
SELECT * FROM table_train_237 WHERE body_mass_index_bmi >= 18.5 AND body_mass_index_bmi <= 26.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: body mass index between 18.5 and 26.9 kg / m2 ### Input: CREATE TABLE table_train_237 ( "id" int, "fasting_c_peptide...
how many days it has been since patient 005-87465 last received a alkaline phos. lab test on this hospital visit?
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '005-87465' AND patient.hospi...
Below are sql tables 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 it has been since patient 005-87465 last received a alkaline phos. lab test on this hospital visit? ### Input:...
provide the number of patients whose age is less than 31 and lab test category is blood gas?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab."CATEGORY" = "Blood Gas"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose age is less than 31 and lab test category is blood gas? ### Input: CREATE TABLE lab ( ...
How many people attended the game that ended 4-6?
CREATE TABLE table_10796 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT COUNT("Attendance") FROM table_10796 WHERE "Score" = '4-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: How many people attended the game that ended 4-6? ### Input: CREATE TABLE table_10796 ( "Date" text, "Opponent" text...
What is run time when there were 7.4 million viewers?
CREATE TABLE table_72856 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
SELECT "Run time" FROM table_72856 WHERE "Viewers (in millions)" = '7.4'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is run time when there were 7.4 million viewers? ### Input: CREATE TABLE table_72856 ( "Episode" text, "Broadca...
Draw a pie chart about the proportion of other_details and the amount of other_details.
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, dat...
SELECT other_details, COUNT(other_details) FROM Student_Addresses GROUP BY other_details 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 pie chart about the proportion of other_details and the amount of other_details. ### Input: CREATE TABLE Student_Addr...
Where did the Jet's play with an attendance of 11,309?
CREATE TABLE table_name_98 ( game_site VARCHAR, attendance VARCHAR )
SELECT game_site FROM table_name_98 WHERE attendance = "11,309"
Below are sql tables 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 did the Jet's play with an attendance of 11,309? ### Input: CREATE TABLE table_name_98 ( game_site VARCHAR, at...
What is Brendan Locke's College/Junior/Club Team (League)?
CREATE TABLE table_38785 ( "Round" text, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
SELECT "College/Junior/Club Team (League)" FROM table_38785 WHERE "Player" = 'brendan locke'
Below are sql tables 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 Brendan Locke's College/Junior/Club Team (League)? ### Input: CREATE TABLE table_38785 ( "Round" text, "Play...
Name the most minutes for morgan jennings
CREATE TABLE table_25694 ( "Player" text, "Games Played" real, "Minutes" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real )
SELECT MAX("Minutes") FROM table_25694 WHERE "Player" = 'Morgan Jennings'
Below are sql tables 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 most minutes for morgan jennings ### Input: CREATE TABLE table_25694 ( "Player" text, "Games Played" real, ...
how many patients whose ethnicity is hispanic/latino - puerto rican and days of hospital stay is greater than 17?
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 = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay > "17"
Below are sql tables 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 ethnicity is hispanic/latino - puerto rican and days of hospital stay is greater than 17? ### Input:...
What is the rank of the cinema when the headquarters are in toronto, ON and the screens is less than 1,438?
CREATE TABLE table_70058 ( "Rank" real, "Circuit" text, "Headquarters" text, "Screens" real, "Sites" real )
SELECT AVG("Rank") FROM table_70058 WHERE "Headquarters" = 'toronto, on' AND "Screens" < '1,438'
Below are sql tables 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 rank of the cinema when the headquarters are in toronto, ON and the screens is less than 1,438? ### Input: CREAT...
provide me with the top five most common intake in 2103?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number,...
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 STRFTIME('%y', inputevents_cv.charttime) = '2103' 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: provide me with the top five most common intake in 2103? ### Input: CREATE TABLE d_icd_diagnoses ( row_id number, ic...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, could you display total number from high to low order?
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) 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, draw a bar chart about t...
What is the current code for the club trophy, in 1867 only?
CREATE TABLE table_59326 ( "Years" text, "Type" text, "Original code" text, "Current code" text, "Location" text )
SELECT "Current code" FROM table_59326 WHERE "Type" = 'club trophy' AND "Years" = '1867 only'
Below are sql tables 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 current code for the club trophy, in 1867 only? ### Input: CREATE TABLE table_59326 ( "Years" text, "Typ...
Draw a bar chart for what are the ids and details for all organizations that have grants of more than 6000 dollars?
CREATE TABLE Research_Outcomes ( outcome_code VARCHAR(10), outcome_description VARCHAR(255) ) CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARCHAR(255) ) CREATE TABLE Project_Outcomes ( project_id INTEGER, outcome_code VARCHAR(10), outcome_details VARC...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart for what are the ids and details for all organizations that have grants of more than 6000 dollars? ### Inpu...
what number of patients admitted in emergency have the procedure icd 9 code 3142?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "3142"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of patients admitted in emergency have the procedure icd 9 code 3142? ### Input: CREATE TABLE diagnoses ( su...
For week number of the top 40, what was the results?
CREATE TABLE table_22736523_1 ( result VARCHAR, week__number VARCHAR )
SELECT result FROM table_22736523_1 WHERE week__number = "Top 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: For week number of the top 40, what was the results? ### Input: CREATE TABLE table_22736523_1 ( result VARCHAR, week...
Find the numbers of different majors and cities.
CREATE TABLE student ( major VARCHAR, city_code VARCHAR )
SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the numbers of different majors and cities. ### Input: CREATE TABLE student ( major VARCHAR, city_code VARCHAR ...
count the number of patients who were diagnosed with acute respiratory failure until 2103 and did not return to the hospital within 2 months.
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2103') AS t1) - (SELECT C...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who were diagnosed with acute respiratory failure until 2103 and did not return to the hospital...
how is patient 655 first admitted to the hospital until 1 year 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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 655 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how is patient 655 first admitted to the hospital until 1 year ago? ### Input: CREATE TABLE chartevents ( row_id number,...
Which Tournament has an Outcome of winner, and a Surface of hard (i)?
CREATE TABLE table_name_4 ( tournament VARCHAR, outcome VARCHAR, surface VARCHAR )
SELECT tournament FROM table_name_4 WHERE outcome = "winner" AND surface = "hard (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: Which Tournament has an Outcome of winner, and a Surface of hard (i)? ### Input: CREATE TABLE table_name_4 ( tournament ...
how many american indian/alaska natives had diagnosis icd9 code 2920?
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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "2920"
Below are sql tables 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 american indian/alaska natives had diagnosis icd9 code 2920? ### Input: CREATE TABLE procedures ( subject_id te...
What is Date From, when Moving To is 'Birmingham City'?
CREATE TABLE table_name_46 ( date_from VARCHAR, moving_to VARCHAR )
SELECT date_from FROM table_name_46 WHERE moving_to = "birmingham city"
Below are sql tables 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 Date From, when Moving To is 'Birmingham City'? ### Input: CREATE TABLE table_name_46 ( date_from VARCHAR, m...
whats the cost for -monos?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = '-monos')
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: whats the cost for -monos? ### Input: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstay...
On what date did the away team have a score of 11.10 (76)?
CREATE TABLE table_58129 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_58129 WHERE "Away team score" = '11.10 (76)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date did the away team have a score of 11.10 (76)? ### Input: CREATE TABLE table_58129 ( "Home team" text, "...
What constructor has a 12 grid?
CREATE TABLE table_52886 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Constructor" FROM table_52886 WHERE "Grid" = '12'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What constructor has a 12 grid? ### Input: CREATE TABLE table_52886 ( "Driver" text, "Constructor" text, "Laps" ...
body mass index above 26 and / or weight > 80 kg;
CREATE TABLE table_train_248 ( "id" int, "anemia" bool, "prostate_specific_antigen_psa" float, "hemoglobin_a1c_hba1c" float, "body_weight" float, "fasting_triglycerides" int, "hyperlipidemia" bool, "hgb" int, "fasting_total_cholesterol" int, "fasting_ldl_cholesterol" int, "bo...
SELECT * FROM table_train_248 WHERE body_mass_index_bmi > 26 OR body_weight > 80
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: body mass index above 26 and / or weight > 80 kg; ### Input: CREATE TABLE table_train_248 ( "id" int, "anemia" bool,...
What are the first names and ids for customers who have two or more accounts. Visualize by pie chart.
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Customers ( customer_...
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_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: What are the first names and ids for customers who have two or more accounts. Visualize by pie chart. ### Input: CREATE TABL...
Name the team #2 for river plate
CREATE TABLE table_23812628_1 ( team__number2 VARCHAR, team__number1 VARCHAR )
SELECT team__number2 FROM table_23812628_1 WHERE team__number1 = "River Plate"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the team #2 for river plate ### Input: CREATE TABLE table_23812628_1 ( team__number2 VARCHAR, team__number1 VAR...
what are the four most commonly conducted specimen tests since 5 years ago?
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 microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most commonly conducted specimen tests since 5 years ago? ### Input: CREATE TABLE transfers ( row_id n...
how many players play a position other than guard ?
CREATE TABLE table_204_526 ( id number, "name" text, "#" number, "position" text, "height" text, "weight" number, "year" text, "home town" text, "high school" text )
SELECT COUNT("name") FROM table_204_526 WHERE "position" <> 'guard'
Below are sql tables 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 players play a position other than guard ? ### Input: CREATE TABLE table_204_526 ( id number, "name" text, ...
on the current icu visit patient 5828's arterial bp [systolic] was greater than 88.0?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_item...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: on the current icu visit patient 5828's arterial bp [systolic] was greater than 88.0? ### Input: CREATE TABLE admissions ( ...
How often does the class YIDDISH 531 meet ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_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: How often does the class YIDDISH 531 meet ? ### Input: CREATE TABLE semester ( semester_id int, semester varchar, ...
tell me the total number of patients who stayed in careunit sicu?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'sicu')
Below are sql tables 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 total number of patients who stayed in careunit sicu? ### Input: CREATE TABLE admissions ( row_id number, ...
Find all the customer information in state NY.
CREATE TABLE CUSTOMER ( State VARCHAR )
SELECT * FROM CUSTOMER WHERE State = "NY"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find all the customer information in state NY. ### Input: CREATE TABLE CUSTOMER ( State VARCHAR ) ### Response: SELECT *...
What is the Pinyin name for Dingyuan County?
CREATE TABLE table_1982739_2 ( pinyin VARCHAR, english_name VARCHAR )
SELECT pinyin FROM table_1982739_2 WHERE english_name = "Dingyuan County"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Pinyin name for Dingyuan County? ### Input: CREATE TABLE table_1982739_2 ( pinyin VARCHAR, english_name ...
what is age and admission type of subject id 93033?
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 demographic.age, demographic.admission_type FROM demographic WHERE demographic.subject_id = "93033"
Below are sql tables 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 age and admission type of subject id 93033? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id...
provide the number of patients admitted before 2145 who had psychiatric facility-partial hospitalization discharge.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2145"
Below are sql tables 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 admitted before 2145 who had psychiatric facility-partial hospitalization discharge. ### Inpu...
show me ground transportation in DALLAS please
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_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 me ground transportation in DALLAS please ### Input: CREATE TABLE flight ( aircraft_code_sequence text, airline...
Who was the home team at the game played on April 14, 2008?
CREATE TABLE table_51553 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
SELECT "Home" FROM table_51553 WHERE "Date" = 'april 14, 2008'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team at the game played on April 14, 2008? ### Input: CREATE TABLE table_51553 ( "Date" text, "Visi...
Name the opponent on april 27
CREATE TABLE table_14512 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Opponent" FROM table_14512 WHERE "Date" = 'april 27'
Below are sql tables 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 opponent on april 27 ### Input: CREATE TABLE table_14512 ( "Date" text, "Opponent" text, "Score" text, ...
how many hours have passed since the last time that patient 3125 had a promote w/fiber intake on the current intensive care unit visit?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3125) AND icustays.outtime 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 hours have passed since the last time that patient 3125 had a promote w/fiber intake on the current intensive care ...
For those records from the products and each product's manufacturer, find name and code , and group by attribute headquarter, and visualize them by a bar chart, order x axis 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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, find name and code , and group by attribute headquarter...
A pie chart for listing the number of the description of the outcomes for all projects.
CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Documents ( d...
SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_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 listing the number of the description of the outcomes for all projects. ### Input: CREATE TABLE Staff_Roles ...
Who is the incumbent in the Virginia 6 district?
CREATE TABLE table_2668329_25 ( incumbent VARCHAR, district VARCHAR )
SELECT incumbent FROM table_2668329_25 WHERE district = "Virginia 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: Who is the incumbent in the Virginia 6 district? ### Input: CREATE TABLE table_2668329_25 ( incumbent VARCHAR, distr...
what is the average number lost when points is 14 and position is more than 1?
CREATE TABLE table_44534 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
SELECT AVG("Lost") FROM table_44534 WHERE "Points" = '14' AND "Position" > '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 average number lost when points is 14 and position is more than 1? ### Input: CREATE TABLE table_44534 ( "Po...
in 2105, patient 015-100195 visited an er?
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 allergy ( allergy...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '015-100195' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) = '2105'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in 2105, patient 015-100195 visited an er? ### Input: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientun...
Name the Round which has a Position of defensive back and a Pick of 226?
CREATE TABLE table_44940 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
SELECT MIN("Round") FROM table_44940 WHERE "Position" = 'defensive back' AND "Pick" = '226'
Below are sql tables 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 Round which has a Position of defensive back and a Pick of 226? ### Input: CREATE TABLE table_44940 ( "Round" r...
How many rooms have a king bed?
CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, baseprice number, decor text ) CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults...
SELECT COUNT(*) FROM rooms WHERE bedtype = "King"
Below are sql tables 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 rooms have a king bed? ### Input: CREATE TABLE rooms ( roomid text, roomname text, beds number, bed...
is there any microbiological test result since 2104 for patient 031-16123's nasopharynx?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
SELECT COUNT(*) 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 = 'nasopharynx' AND STRFTIME('%y', microlab....
Below are sql tables 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 there any microbiological test result since 2104 for patient 031-16123's nasopharynx? ### Input: CREATE TABLE cost ( ...
when was the first time patient 28443's intake time on this month/23?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(), ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time patient 28443's intake time on this month/23? ### Input: CREATE TABLE icustays ( row_id number, ...
On what air date were there 2.15 million u.s. viewers?
CREATE TABLE table_22380270_1 ( original_air_date VARCHAR, us_viewers__millions_ VARCHAR )
SELECT original_air_date FROM table_22380270_1 WHERE us_viewers__millions_ = "2.15"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what air date were there 2.15 million u.s. viewers? ### Input: CREATE TABLE table_22380270_1 ( original_air_date VARC...
What is the average year with 7th (heats) position?
CREATE TABLE table_name_50 ( year INTEGER, position VARCHAR )
SELECT AVG(year) FROM table_name_50 WHERE position = "7th (heats)"
Below are sql tables 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 year with 7th (heats) position? ### Input: CREATE TABLE table_name_50 ( year INTEGER, position V...
How many viewers for the episode with the weekly rank for living of 4?
CREATE TABLE table_name_25 ( viewers VARCHAR, weekly_rank_for_living VARCHAR )
SELECT viewers FROM table_name_25 WHERE weekly_rank_for_living = "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: How many viewers for the episode with the weekly rank for living of 4? ### Input: CREATE TABLE table_name_25 ( viewers V...
how many hours has it passed since patient 7112 was admitted to hospital?
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 7112 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 hours has it passed since patient 7112 was admitted to hospital? ### Input: CREATE TABLE transfers ( row_id num...
give me the number of patients whose procedure icd9 code is 3972 and drug route is inhalation?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "3972" AND prescriptions.route = "INHALATION"
Below are sql tables 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 icd9 code is 3972 and drug route is inhalation? ### Input: CREATE TABLE presc...
What is the highest elevation for the highest point of Schnebelhorn?
CREATE TABLE table_63629 ( "Rank" real, "Canton" text, "Highest point" text, "Highest elevation" text, "Lowest point" text, "Lowest elevation" text )
SELECT "Highest elevation" FROM table_63629 WHERE "Highest point" = 'schnebelhorn'
Below are sql tables 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 elevation for the highest point of Schnebelhorn? ### Input: CREATE TABLE table_63629 ( "Rank" real, ...
What pick number did the linebacker from the denver broncos get?
CREATE TABLE table_65461 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
SELECT "Pick" FROM table_65461 WHERE "Position" = 'linebacker' AND "Team" = 'denver broncos'
Below are sql tables 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 pick number did the linebacker from the denver broncos get? ### Input: CREATE TABLE table_65461 ( "Pick" real, ...
how many songs were released for each format?, order in asc by the x axis.
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(5...
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats
Below are sql tables 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 songs were released for each format?, order in asc by the x axis. ### Input: CREATE TABLE artist ( artist_name ...
major depression in past 12 months ( dsm _ iv criteria ) , major mental illness such as schizophrenia, or recent ( in past 12 months ) alcohol or substance abuse.
CREATE TABLE table_train_123 ( "id" int, "bleeding" int, "systolic_blood_pressure_sbp" int, "anticoagulation" bool, "lumbar_puncture" bool, "blood_pressure_problem" bool, "stroke" bool, "substance_dependence" bool, "schizophrenia" bool, "major_mental_illness" bool, "multiple_...
SELECT * FROM table_train_123 WHERE major_depression = 1 OR (major_mental_illness = 1 OR schizophrenia = 1 OR alcohol_abuse = 1 OR substance_dependence = 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: major depression in past 12 months ( dsm _ iv criteria ) , major mental illness such as schizophrenia, or recent ( in past 1...
what is the number of patients whose marital status is married and admission year is less than 2103?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "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: what is the number of patients whose marital status is married and admission year is less than 2103? ### Input: CREATE TABLE...
what is the daily average white blood cells level of patient 17462 in this month?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, h...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND DATETIME(labevents.charttime, 'start of month') = D...
Below are sql tables 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 daily average white blood cells level of patient 17462 in this month? ### Input: CREATE TABLE diagnoses_icd ( ...
What was the title for episode 2?
CREATE TABLE table_20205538_4 ( title VARCHAR, episode__number VARCHAR )
SELECT title FROM table_20205538_4 WHERE episode__number = 2
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the title for episode 2? ### Input: CREATE TABLE table_20205538_4 ( title VARCHAR, episode__number VARCHAR ...
what is the cost of round trip ticket FIRST class between OAKLAND and ATLANTA
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fligh...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code 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: what is the cost of round trip ticket FIRST class between OAKLAND and ATLANTA ### Input: CREATE TABLE airline ( airline_...
Calculate the number of patients who had coronary artery disease or coronary artery bypass graft sda as their primary disease.
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 WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA"
Below are sql tables 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 who had coronary artery disease or coronary artery bypass graft sda as their primary diseas...
With an aggregate of 0-2, what is listed for home?
CREATE TABLE table_22030 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
SELECT "Home (2nd leg)" FROM table_22030 WHERE "Aggregate" = '0-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: With an aggregate of 0-2, what is listed for home? ### Input: CREATE TABLE table_22030 ( "Home (1st leg)" text, "Hom...
What is the 2009 value with a 2010 A value?
CREATE TABLE table_name_79 ( Id VARCHAR )
SELECT 2009 FROM table_name_79 WHERE 2010 = "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: What is the 2009 value with a 2010 A value? ### Input: CREATE TABLE table_name_79 ( Id VARCHAR ) ### Response: SELECT 20...
Create a pie chart showing acc_percent across acc regular season.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a pie chart showing acc_percent across acc regular season. ### Input: CREATE TABLE basketball_match ( Team_ID int...
what is the number of patients whose admission location is transfer from hosp/extram and procedure long title is closed [needle] biopsy of tongue?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Closed [needle] biopsy of tongue"
Below are sql tables 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 transfer from hosp/extram and procedure long title is closed [nee...
Name the opponent for jul 31 and score of w 5-1
CREATE TABLE table_15641 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Crowd" text, "Record" text )
SELECT "Opponent" FROM table_15641 WHERE "Date" = 'jul 31' AND "Score" = 'w 5-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: Name the opponent for jul 31 and score of w 5-1 ### Input: CREATE TABLE table_15641 ( "Date" text, "Opponent" text, ...
How many movie reviews does each director get. Visualize by pie chart.
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text )
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
Below are sql tables 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 movie reviews does each director get. Visualize by pie chart. ### Input: CREATE TABLE Reviewer ( rID int, n...
Return a pie chart about the proportion of ACC_Road and the amount of ACC_Road.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road
Below are sql tables 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 pie chart about the proportion of ACC_Road and the amount of ACC_Road. ### Input: CREATE TABLE basketball_match ( ...
how many elective hospital admission patients are diagnosed with blood in stool?
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.admission_type = "ELECTIVE" AND diagnoses.long_title = "Blood in stool"
Below are sql tables 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 elective hospital admission patients are diagnosed with blood in stool? ### Input: CREATE TABLE demographic ( s...
Show the average price of the rooms in different decor using a pie chart.
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the average price of the rooms in different decor using a pie chart. ### Input: CREATE TABLE Reservations ( Code IN...
what year is at the very top ?
CREATE TABLE table_204_27 ( id number, "name" text, "position" text, "year" text, "league\napps" number, "league\ngoals" number, "total\napps" number, "total\ngoals" number, "notes" text )
SELECT "year" FROM table_204_27 WHERE id = 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 year is at the very top ? ### Input: CREATE TABLE table_204_27 ( id number, "name" text, "position" text, ...
Which Week has a Result of l 20 13, and an Attendance larger than 49,598?
CREATE TABLE table_name_8 ( week INTEGER, result VARCHAR, attendance VARCHAR )
SELECT MAX(week) FROM table_name_8 WHERE result = "l 20–13" AND attendance > 49 OFFSET 598
Below are sql tables 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 Week has a Result of l 20 13, and an Attendance larger than 49,598? ### Input: CREATE TABLE table_name_8 ( week IN...
when was the first time that patient 016-18575 today had respiration less than 35.0?
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 patient ( uniquep...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575')) AND vitalperiodic.respiration < 35.0 A...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time that patient 016-18575 today had respiration less than 35.0? ### Input: CREATE TABLE vitalperiodic (...
what is the procedure short title and long title of procedure icd9 code 9920?
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 procedures.short_title, procedures.long_title FROM procedures WHERE procedures.icd9_code = "9920"
Below are sql tables 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 procedure short title and long title of procedure icd9 code 9920? ### Input: CREATE TABLE diagnoses ( subjec...
How many characteristics does the product named 'sesame' have?
CREATE TABLE product_characteristics ( product_id VARCHAR ) CREATE TABLE products ( product_id VARCHAR, product_name VARCHAR )
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame"
Below are sql tables 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 characteristics does the product named 'sesame' have? ### Input: CREATE TABLE product_characteristics ( product...
Name the record for april 1
CREATE TABLE table_21290 ( "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_21290 WHERE "Date" = 'April 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: Name the record for april 1 ### Input: CREATE TABLE table_21290 ( "Game" real, "Date" text, "Team" text, "Sc...
What are the numbers of races for each constructor id. Show the correlation.
CREATE TABLE lapTimes ( raceId INTEGER, driverId INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER ) CREATE TABLE races ( raceId INTEGER, year INTEGER, round INTEGER, circuitId INTEGER, name TEXT, date TEXT, time TEXT, url TEXT ) CREATE TAB...
SELECT COUNT(*), constructorId FROM constructorStandings GROUP BY constructorId
Below are sql tables 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 numbers of races for each constructor id. Show the correlation. ### Input: CREATE TABLE lapTimes ( raceId I...
What is the Team with a Lap that is 5?
CREATE TABLE table_42181 ( "Name" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Team" FROM table_42181 WHERE "Laps" = '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 Team with a Lap that is 5? ### Input: CREATE TABLE table_42181 ( "Name" text, "Team" text, "Laps" re...
What are total salaries and department id for each department that has more than 2 employees. Show scatter chart.
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT DEPARTMENT_ID, SUM(SALARY) FROM employees GROUP BY DEPARTMENT_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are total salaries and department id for each department that has more than 2 employees. Show scatter chart. ### Input:...
What is the total of a crowd with an Away team score of 8.17 (65)?
CREATE TABLE table_53007 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT SUM("Crowd") FROM table_53007 WHERE "Away team score" = '8.17 (65)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total of a crowd with an Away team score of 8.17 (65)? ### Input: CREATE TABLE table_53007 ( "Home team" tex...
What home team has had a crowd bigger than 20,000?
CREATE TABLE table_name_95 ( home_team VARCHAR, crowd INTEGER )
SELECT home_team FROM table_name_95 WHERE crowd > 20 OFFSET 000
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What home team has had a crowd bigger than 20,000? ### Input: CREATE TABLE table_name_95 ( home_team VARCHAR, crowd ...
how many of the patients admitted as transfer from hosp/extram had icd9 code 45?
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.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "45"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many of the patients admitted as transfer from hosp/extram had icd9 code 45? ### Input: CREATE TABLE lab ( subject_i...
Which Apogee was on 1959-02-20?
CREATE TABLE table_name_5 ( apogee VARCHAR, date VARCHAR )
SELECT apogee FROM table_name_5 WHERE date = "1959-02-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: Which Apogee was on 1959-02-20? ### Input: CREATE TABLE table_name_5 ( apogee VARCHAR, date VARCHAR ) ### Response: ...
what are the procedures that are the top four most commonly received?
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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the procedures that are the top four most commonly received? ### Input: CREATE TABLE patient ( uniquepid text, ...
What are the headquarters that have both a company in the banking and 'oil and gas' industries?
CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion number, profits_billion number, assets_billion number, market_value number ) CREATE TABLE station_company ( station_id number, company_id number, ran...
SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the headquarters that have both a company in the banking and 'oil and gas' industries? ### Input: CREATE TABLE comp...
Which course is less difficult , EECS 597 or EECS 755 ?
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.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 597 OR course.number = 755) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
Below are sql tables 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 course is less difficult , EECS 597 or EECS 755 ? ### Input: CREATE TABLE student ( student_id int, lastname v...