instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, rank x-axis in asc order.
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and t...
What is the population per km in Smoky Lake County?
CREATE TABLE table_73713 ( "Name" text, "Municipal district" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Land area (km\u00b2)" text, "Population density (per km 2 )" text )
SELECT "Population density (per km 2 )" FROM table_73713 WHERE "Municipal district" = 'Smoky Lake 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 population per km in Smoky Lake County? ### Input: CREATE TABLE table_73713 ( "Name" text, "Municipal di...
When did the length of 60 minutes air?
CREATE TABLE table_name_46 ( airdate VARCHAR, length VARCHAR )
SELECT airdate FROM table_name_46 WHERE length = "60 minutes"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the length of 60 minutes air? ### Input: CREATE TABLE table_name_46 ( airdate VARCHAR, length VARCHAR ) ###...
how many hours have elapsed since patient 017-88691 had his first procedure during this hospital visit?
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691...
Below are sql tables 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 elapsed since patient 017-88691 had his first procedure during this hospital visit? ### Input: CREATE TA...
give me the number of patients whose year of death is less than or equal to 2133 and procedure icd9 code is 3142?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2133.0" 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: give me the number of patients whose year of death is less than or equal to 2133 and procedure icd9 code is 3142? ### Input:...
what is admission type and procedure long title of subject id 52012?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "52012"
Below are sql tables 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 procedure long title of subject id 52012? ### Input: CREATE TABLE demographic ( subject_id te...
What was released on 1936-08-29?
CREATE TABLE table_63755 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text )
SELECT "Title" FROM table_63755 WHERE "Release date" = '1936-08-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: What was released on 1936-08-29? ### Input: CREATE TABLE table_63755 ( "Title" text, "Series" text, "Director" t...
Which College/Junior/Club Team (League) has a Position of right wing, and a Round smaller than 3?
CREATE TABLE table_38103 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
SELECT "College/Junior/Club Team (League)" FROM table_38103 WHERE "Position" = 'right wing' AND "Round" < '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 College/Junior/Club Team (League) has a Position of right wing, and a Round smaller than 3? ### Input: CREATE TABLE ta...
is the arterial bp mean value of patient 26817 last measured on the last icu visit less than second to last measured on the last icu visit?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26817) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the arterial bp mean value of patient 26817 last measured on the last icu visit less than second to last measured on the ...
What is the title of the episode with production code 406?
CREATE TABLE table_2453243_5 ( title VARCHAR, production_code VARCHAR )
SELECT title FROM table_2453243_5 WHERE production_code = "406"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the title of the episode with production code 406? ### Input: CREATE TABLE table_2453243_5 ( title VARCHAR, ...
What is the aircraft name for the flight with number 99
CREATE TABLE Flight ( aid VARCHAR, flno VARCHAR ) CREATE TABLE Aircraft ( name VARCHAR, aid VARCHAR )
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
Below are sql tables 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 aircraft name for the flight with number 99 ### Input: CREATE TABLE Flight ( aid VARCHAR, flno VARCHAR )...
Visualize the name and their component amounts with a bar chart for all furnitures that have more than 10 components, order by the X in desc please.
CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furnit...
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 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: Visualize the name and their component amounts with a bar chart for all furnitures that have more than 10 components, order ...
Count the number of programs broadcast for each time section of a day Show bar chart, display X in descending order.
CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day ORDER BY Time_of_day DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of programs broadcast for each time section of a day Show bar chart, display X in descending order. ### Inp...
has patient 010-37499's sao2 been normal since 182 days ago?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-37499')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe...
Below are sql tables 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 010-37499's sao2 been normal since 182 days ago? ### Input: CREATE TABLE microlab ( microlabid number, p...
how many jewish patients were admitted to the hospital before year 2148?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "JEWISH" AND demographic.admityear < "2148"
Below are sql tables 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 jewish patients were admitted to the hospital before year 2148? ### Input: CREATE TABLE demographic ( subject_i...
What computing infrastructure courses are offered in Spring or Summer 2012 ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%compu...
Below are sql tables 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 computing infrastructure courses are offered in Spring or Summer 2012 ? ### Input: CREATE TABLE instructor ( instru...
Which Number of electorates (2009) has a Constituency number of 46?
CREATE TABLE table_78969 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
SELECT AVG("Number of electorates (2009)") FROM table_78969 WHERE "Constituency number" = '46'
Below are sql tables 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 Number of electorates (2009) has a Constituency number of 46? ### Input: CREATE TABLE table_78969 ( "Constituency ...
i would like a flight from DENVER to PITTSBURGH
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 flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
Below are sql tables 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 would like a flight from DENVER to PITTSBURGH ### Input: CREATE TABLE flight ( aircraft_code_sequence text, airlin...
had there been any organism found in patient 15821's last sputum microbiology test?
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 microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15821) AND microbiologyevents.spec_type_desc = 'sputum' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiologyevents.charttime 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: had there been any organism found in patient 15821's last sputum microbiology test? ### Input: CREATE TABLE admissions ( ...
Which Score has an Opponent of @ la lakers, and a Record of 8-6?
CREATE TABLE table_name_84 ( score VARCHAR, opponent VARCHAR, record VARCHAR )
SELECT score FROM table_name_84 WHERE opponent = "@ la lakers" AND record = "8-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: Which Score has an Opponent of @ la lakers, and a Record of 8-6? ### Input: CREATE TABLE table_name_84 ( score VARCHAR, ...
What is the fewest draws for teams having under 2 losses, more than 4 wins, and a position under 4?
CREATE TABLE table_14060 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
SELECT MIN("Draws") FROM table_14060 WHERE "Losses" < '2' AND "Position" < '4' AND "Wins" > '4'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the fewest draws for teams having under 2 losses, more than 4 wins, and a position under 4? ### Input: CREATE TABLE ...
Show budget type codes and the number of documents in each budget type with a bar chart, could you sort by the the total number from low to high?
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*)
Below are sql tables 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 budget type codes and the number of documents in each budget type with a bar chart, could you sort by the the total num...
I want to know the proportion of how many hours do the students spend studying for each dept code.
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_J...
SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_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: I want to know the proportion of how many hours do the students spend studying for each dept code. ### Input: CREATE TABLE D...
What was the lowest attendance at a game against the St. Louis Cardinals?
CREATE TABLE table_name_91 ( attendance INTEGER, opponent VARCHAR )
SELECT MIN(attendance) FROM table_name_91 WHERE opponent = "st. louis cardinals"
Below are sql tables 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 lowest attendance at a game against the St. Louis Cardinals? ### Input: CREATE TABLE table_name_91 ( attend...
What is the score for the Tournament of Cordenons?
CREATE TABLE table_name_12 ( score VARCHAR, tournament VARCHAR )
SELECT score FROM table_name_12 WHERE tournament = "cordenons"
Below are sql tables 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 for the Tournament of Cordenons? ### Input: CREATE TABLE table_name_12 ( score VARCHAR, tournament...
For each file format, return the number of artists who released songs in that format.
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating nu...
SELECT formats, COUNT(*) FROM files GROUP 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: For each file format, return the number of artists who released songs in that format. ### Input: CREATE TABLE files ( f_...
give me the number of patients whose year of birth is less than 2129 and lab test name is albumin?
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.dob_year < "2129" AND lab.label = "Albumin"
Below are sql tables 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 birth is less than 2129 and lab test name is albumin? ### Input: CREATE TABLE d...
Top 5 StackOverflowers in Coimbatore.
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%singapore%' OR UPPER(Location) LIKE '%SINGAPORE%' OR Location LIKE '%singapore%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 25
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 5 StackOverflowers in Coimbatore. ### Input: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name ...
What is Pittodrie Stadium's maximum capacity?
CREATE TABLE table_156 ( "Team" text, "Stadium" text, "Capacity" real, "Lowest" real, "Highest" real, "Average" real )
SELECT MAX("Capacity") FROM table_156 WHERE "Stadium" = 'Pittodrie'
Below are sql tables 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 Pittodrie Stadium's maximum capacity? ### Input: CREATE TABLE table_156 ( "Team" text, "Stadium" text, "...
Find meter_400 and meter_100 , and visualize them by a bar chart.
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT meter_400, meter_100 FROM swimmer
Below are sql tables 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 meter_400 and meter_100 , and visualize them by a bar chart. ### Input: CREATE TABLE record ( ID int, Result te...
count the number of patients whose primary disease is celo-vessicle fistula and year of death is less than or equal to 2179?
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 WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA" AND demographic.dod_year <= "2179.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: count the number of patients whose primary disease is celo-vessicle fistula and year of death is less than or equal to 2179?...
In what lane did the swimmer get a time of 1:59.42?
CREATE TABLE table_14270 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
SELECT SUM("Lane") FROM table_14270 WHERE "Time" = '1:59.42'
Below are sql tables 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 what lane did the swimmer get a time of 1:59.42? ### Input: CREATE TABLE table_14270 ( "Rank" real, "Lane" real, ...
Show the number of courses for each instructor in a stacked bar chart The x-axis is instructor's first name and group by course description, sort in descending by the EMP_FNAME please.
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, EMP_FNAME ORDER BY EMP_FNAME DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of courses for each instructor in a stacked bar chart The x-axis is instructor's first name and group by cou...
give me the number of patients whose discharge location is snf and procedure short title is incision of aorta?
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.short_title = "Incision of aorta"
Below are sql tables 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 discharge location is snf and procedure short title is incision of aorta? ### Input: CR...
Return a bar chart showing the total number of ships' nationalities, and list in desc by the total number.
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 Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart showing the total number of ships' nationalities, and list in desc by the total number. ### Input: CREATE...
what are the five most frequent drugs prescribed within the same month to the hypertension female patients of age 30s after having been diagnosed with hypertension until 2102?
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypertension' AND STRFTIME('%y', diagnosis.diagnos...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequent drugs prescribed within the same month to the hypertension female patients of age 30s after ...
Return a bar chart about the distribution of meter_200 and the average of ID , and group by attribute meter_200, and I want to order y-axis in desc order.
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 stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(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: Return a bar chart about the distribution of meter_200 and the average of ID , and group by attribute meter_200, and I want ...
Bar chart x axis country y axis the total number
CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text )
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country
Below are sql tables 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 country y axis the total number ### Input: CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID...
Which club has 101 tries for?
CREATE TABLE table_name_79 ( club VARCHAR, tries_for VARCHAR )
SELECT club FROM table_name_79 WHERE tries_for = "101"
Below are sql tables 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 club has 101 tries for? ### Input: CREATE TABLE table_name_79 ( club VARCHAR, tries_for VARCHAR ) ### Response...
For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of code , and group by attribute headquarter, and rank in ascending by the total number.
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.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: For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and t...
which country is listed last on the chart ?
CREATE TABLE table_203_803 ( id number, "draw" number, "country" text, "language" text, "artist" text, "song" text, "english translation" text, "place" number, "points" number )
SELECT "country" FROM table_203_803 ORDER BY id 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 country is listed last on the chart ? ### Input: CREATE TABLE table_203_803 ( id number, "draw" number, "c...
who made high assists on february 4
CREATE TABLE table_17311759_7 ( high_assists VARCHAR, date VARCHAR )
SELECT high_assists FROM table_17311759_7 WHERE date = "February 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: who made high assists on february 4 ### Input: CREATE TABLE table_17311759_7 ( high_assists VARCHAR, date VARCHAR ) ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a scatter chart about the correlation between employee_id and commission_pct .
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 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 those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
Please return me a histogram to show the friends, and ages of all people who are older than the average age of a person?, list in desc by the x-axis.
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
SELECT friend, age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY friend 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: Please return me a histogram to show the friends, and ages of all people who are older than the average age of a person?, li...
what number of patients came in for routine infant or child health check and their lab tests were abnormal.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Routine infant or child health check" AND lab.flag = "abnormal"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what number of patients came in for routine infant or child health check and their lab tests were abnormal. ### Input: CREAT...
For the Fall or Winter term , can I take 400 -level classes ?
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( studen...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((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: For the Fall or Winter term , can I take 400 -level classes ? ### Input: CREATE TABLE instructor ( instructor_id int, ...
In the Spring , who teaches CDB 683 ?
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 instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In the Spring , who teaches CDB 683 ? ### Input: CREATE TABLE course_offering ( offering_id int, course_id int, ...
has patient 54894 received any diagnoses since 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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54894) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-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: has patient 54894 received any diagnoses since 1 year ago? ### Input: CREATE TABLE outputevents ( row_id number, sub...
does patient 004-28929 have a normal respiration on the last intensive care unit visit?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-28929') AND NOT patient.unitdischargetime IS NULL ORDER BY patie...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does patient 004-28929 have a normal respiration on the last intensive care unit visit? ### Input: CREATE TABLE vitalperiodi...
is the bicarbonate level of patient 029-16431 last measured on the first hospital visit less than it was second to last measured on the first hospital visit?
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 treatment ( treat...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16431' AND NOT patient.hospitaldischargetime IS NULL ORDER BY 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: is the bicarbonate level of patient 029-16431 last measured on the first hospital visit less than it was second to last meas...
What is the opponent in a week larger than 1, with a result of l 21-20?
CREATE TABLE table_name_31 ( opponent VARCHAR, week VARCHAR, result VARCHAR )
SELECT opponent FROM table_name_31 WHERE week > 1 AND result = "l 21-20"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the opponent in a week larger than 1, with a result of l 21-20? ### Input: CREATE TABLE table_name_31 ( opponent...
What is the number of types of competition?, order in asc by the names.
CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Cl...
SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type ORDER BY Competition_type
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of types of competition?, order in asc by the names. ### Input: CREATE TABLE club_rank ( Rank real, ...
What is the away side score when footscray is the home side?
CREATE TABLE table_32191 ( "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_32191 WHERE "Home team" = 'footscray'
Below are sql tables 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 away side score when footscray is the home side? ### Input: CREATE TABLE table_32191 ( "Home team" text, ...
Find the number of records of each policy type and its type code Visualize by bar chart, and could you rank bar in ascending order?
CREATE TABLE Staff ( Staff_ID INTEGER, Staff_Details VARCHAR(255) ) CREATE TABLE Claims_Processing_Stages ( Claim_Stage_ID INTEGER, Next_Claim_Stage_ID INTEGER, Claim_Status_Name VARCHAR(255), Claim_Status_Description VARCHAR(255) ) CREATE TABLE Claims_Processing ( Claim_Processing_ID INTE...
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY Policy_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: Find the number of records of each policy type and its type code Visualize by bar chart, and could you rank bar in ascending...
Which location includes Sakakita BS?
CREATE TABLE table_39596 ( "Name" text, "Dist. from Origin" text, "Dist. from Terminus" text, "Speed Limit" text, "Location (all in Nagano )" text )
SELECT "Location (all in Nagano )" FROM table_39596 WHERE "Name" = 'sakakita bs'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which location includes Sakakita BS? ### Input: CREATE TABLE table_39596 ( "Name" text, "Dist. from Origin" text, ...
had patient 8016 been tested on total protein, pleural since 14 months ago?
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 admissions ( row_id number, subject_id number, hadm...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, pleural') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016) AND DATETIME(labevents.charttime) >= 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: had patient 8016 been tested on total protein, pleural since 14 months ago? ### Input: CREATE TABLE icustays ( row_id nu...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday by a bar 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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 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 those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
give me the number of patients whose admission year is less than 2110 and lab test fluid is joint fluid?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2110" AND lab.fluid = "Joint Fluid"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission year is less than 2110 and lab test fluid is joint fluid? ### Input: CREATE T...
compared to last measured on the first hospital visit patient 015-57922's hct is less than the value first measured on the first hospital visit?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-57922' AND NOT patient.hospitaldischargetime IS NULL ORDER BY 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: compared to last measured on the first hospital visit patient 015-57922's hct is less than the value first measured on the f...
how many patients whose gender is f and age is less than 31?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "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: how many patients whose gender is f and age is less than 31? ### Input: CREATE TABLE demographic ( subject_id text, ...
How many golds for the nation ranked below 5 and over 1 bronze medals?
CREATE TABLE table_name_80 ( gold INTEGER, rank VARCHAR, bronze VARCHAR )
SELECT MAX(gold) FROM table_name_80 WHERE rank > 5 AND bronze < 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 many golds for the nation ranked below 5 and over 1 bronze medals? ### Input: CREATE TABLE table_name_80 ( gold INTE...
In Spring-Summer 2001 how many professors teach LING 446 ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LING' AND course.number = 446 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer...
Below are sql tables 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 Spring-Summer 2001 how many professors teach LING 446 ? ### Input: CREATE TABLE student_record ( student_id int, ...
Find the names of the customers who have an deputy policy.
CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TABLE claims_documents ( claim_id number, document_type_code text, created_by_staff_id number, created_date number ) CREATE TABLE c...
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the names of the customers who have an deputy policy. ### Input: CREATE TABLE claims_processing ( claim_processing_...
Who is the home team when Preston North End is the away team?
CREATE TABLE table_name_89 ( home_team VARCHAR, away_team VARCHAR )
SELECT home_team FROM table_name_89 WHERE away_team = "preston north end"
Below are sql tables 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 home team when Preston North End is the away team? ### Input: CREATE TABLE table_name_89 ( home_team VARCHAR,...
what is the number of patients whose admission type is emergency and procedure long title is hemodialysis?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Hemodialysis"
Below are sql tables 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 type is emergency and procedure long title is hemodialysis? ### Input: CREATE...
What is the Place of the Player with a Score of 73-68-71=212?
CREATE TABLE table_47798 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Place" FROM table_47798 WHERE "Score" = '73-68-71=212'
Below are sql tables 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 Place of the Player with a Score of 73-68-71=212? ### Input: CREATE TABLE table_47798 ( "Place" text, "P...
When is Home of chicago black hawks has a Record of 0 1?
CREATE TABLE table_69742 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
SELECT "Date" FROM table_69742 WHERE "Home" = 'chicago black hawks' AND "Record" = '0–1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When is Home of chicago black hawks has a Record of 0 1? ### Input: CREATE TABLE table_69742 ( "Date" text, "Visitor...
When did the away team score 7.16 (58)?
CREATE TABLE table_58463 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_58463 WHERE "Away team score" = '7.16 (58)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the away team score 7.16 (58)? ### Input: CREATE TABLE table_58463 ( "Home team" text, "Home team score" te...
What is the type of the organization with the most research staff?
CREATE TABLE project_staff ( staff_id number, project_id number, role_code text, date_from time, date_to time, other_details text ) CREATE TABLE project_outcomes ( project_id number, outcome_code text, outcome_details text ) CREATE TABLE tasks ( task_id number, project_id n...
SELECT T1.organisation_type FROM organisations AS T1 JOIN research_staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_type ORDER BY COUNT(*) 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 is the type of the organization with the most research staff? ### Input: CREATE TABLE project_staff ( staff_id numb...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, show by the Y-axis from low to high.
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), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about...
has patient 022-151182 ever had a sao2 of greater than 97.0 on the first icu visit?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-151182') AND NOT patient.unitdischargetime IS NULL ORDER BY pati...
Below are sql tables 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-151182 ever had a sao2 of greater than 97.0 on the first icu visit? ### Input: CREATE TABLE vitalperiodic ( ...
how many hours have passed since the last procedure of patient 017-16041 in their current hospital encounter?
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-16041...
Below are sql tables 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 procedure of patient 017-16041 in their current hospital encounter? ### Input: CRE...
When (v kha) is the belarusian how many slovaks are there?
CREATE TABLE table_26757_4 ( slovak VARCHAR, belarusian VARCHAR )
SELECT COUNT(slovak) FROM table_26757_4 WHERE belarusian = "вуха (vúkha)"
Below are sql tables 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 (v kha) is the belarusian how many slovaks are there? ### Input: CREATE TABLE table_26757_4 ( slovak VARCHAR, b...
What is the chassis for a 1952 officine alfieri maserati with an entrant?
CREATE TABLE table_70203 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
SELECT "Chassis" FROM table_70203 WHERE "Entrant" = 'officine alfieri maserati' AND "Year" = '1952'
Below are sql tables 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 chassis for a 1952 officine alfieri maserati with an entrant? ### Input: CREATE TABLE table_70203 ( "Year" r...
Which label's year is 1993?
CREATE TABLE table_42519 ( "Year" text, "Title" text, "Genre" text, "Label" text, "Result" text )
SELECT "Label" FROM table_42519 WHERE "Year" = '1993'
Below are sql tables 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 label's year is 1993? ### Input: CREATE TABLE table_42519 ( "Year" text, "Title" text, "Genre" text, "...
what did patient 031-11804 last have as an intake on 09/17/this year?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-11804')) AND intakeoutput.cellpath LIKE '%intake%' AND 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 did patient 031-11804 last have as an intake on 09/17/this year? ### Input: CREATE TABLE intakeoutput ( intakeoutpu...
How many goals did a player active since 2006 have?
CREATE TABLE table_name_4 ( goals VARCHAR, years_active VARCHAR )
SELECT goals FROM table_name_4 WHERE years_active = "2006"
Below are sql tables 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 goals did a player active since 2006 have? ### Input: CREATE TABLE table_name_4 ( goals VARCHAR, years_acti...
during this year, what were the top five most frequent procedures that patients received during the same month after receiving a antibacterials - linezolid (zyvox)?
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 t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacterials - linezolid (zyvox)' AND ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: during this year, what were the top five most frequent procedures that patients received during the same month after receivi...
What's the record when the attendance was 41,573?
CREATE TABLE table_77731 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
SELECT "Record" FROM table_77731 WHERE "Attendance" = '41,573'
Below are sql tables 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 record when the attendance was 41,573? ### Input: CREATE TABLE table_77731 ( "Date" text, "Opponent" text...
What is the Money ($) of the game with a score of 69-74-70-73=286?
CREATE TABLE table_name_57 ( money___ INTEGER, score VARCHAR )
SELECT MAX(money___) AS $__ FROM table_name_57 WHERE score = 69 - 74 - 70 - 73 = 286
Below are sql tables 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 Money ($) of the game with a score of 69-74-70-73=286? ### Input: CREATE TABLE table_name_57 ( money___ INTE...
IS ASTRO 255 offered in any section between the hours of 9:00 and 1:00 ?
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 course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '9:00' AND course.course_id = course_offering.course_id AND course.department = 'ASTRO' AND course.number...
Below are sql tables 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 ASTRO 255 offered in any section between the hours of 9:00 and 1:00 ? ### Input: CREATE TABLE course_offering ( offer...
did patient 011-5503 receive the hct lab test in their last hospital encounter?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-5503' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmitti...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 011-5503 receive the hct lab test in their last hospital encounter? ### Input: CREATE TABLE diagnosis ( diag...
Who was the visitor when the lakers were at home with a Score of 85 106?
CREATE TABLE table_name_39 ( visitor VARCHAR, home VARCHAR, score VARCHAR )
SELECT visitor FROM table_name_39 WHERE home = "lakers" AND score = "85–106"
Below are sql tables 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 visitor when the lakers were at home with a Score of 85 106? ### Input: CREATE TABLE table_name_39 ( visitor...
find the number of patients who follow the religion jehovah's witness.
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.religion = "JEHOVAH'S WITNESS"
Below are sql tables 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 follow the religion jehovah's witness. ### Input: CREATE TABLE procedures ( subject_id t...
what is the round trip fare on CO 1291 from DENVER to SAN FRANCISCO and return
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_...
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, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the round trip fare on CO 1291 from DENVER to SAN FRANCISCO and return ### Input: CREATE TABLE airport_service ( ...
Return a bar chart about the distribution of date_address_from and the amount of date_address_from , and group by attribute other_details and bin date_address_from by weekday.
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 Ref_Address_Types ( a...
SELECT date_address_from, COUNT(date_address_from) 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: Return a bar chart about the distribution of date_address_from and the amount of date_address_from , and group by attribute ...
Which is the number of the episode 'rook gave' 'r ku d o' ( ) which aired on July 14, 2003
CREATE TABLE table_1704 ( "Episode #" real, "Title" text, "Director" text, "Screenwriter" text, "Original airdate" text, "English airdate" text )
SELECT MIN("Episode #") FROM table_1704 WHERE "Original airdate" = 'July 14, 2003'
Below are sql tables 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 is the number of the episode 'rook gave' 'r ku d o' ( ) which aired on July 14, 2003 ### Input: CREATE TABLE table_170...
What is the qual 1 with a 1:09.567 best?
CREATE TABLE table_name_70 ( qual_1 VARCHAR, best VARCHAR )
SELECT qual_1 FROM table_name_70 WHERE best = "1:09.567"
Below are sql tables 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 qual 1 with a 1:09.567 best? ### Input: CREATE TABLE table_name_70 ( qual_1 VARCHAR, best VARCHAR ) ### ...
On what date did Fitzroy play as the home team?
CREATE TABLE table_name_74 ( date VARCHAR, home_team VARCHAR )
SELECT date FROM table_name_74 WHERE home_team = "fitzroy"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On what date did Fitzroy play as the home team? ### Input: CREATE TABLE table_name_74 ( date VARCHAR, home_team VARC...
What is the highest attendance of the game on week 9?
CREATE TABLE table_35648 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT MAX("Attendance") FROM table_35648 WHERE "Week" = '9'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest attendance of the game on week 9? ### Input: CREATE TABLE table_35648 ( "Week" real, "Date" text...
What was Olazabal's winning score in the German Masters?
CREATE TABLE table_name_62 ( winning_score VARCHAR, tournament VARCHAR )
SELECT winning_score FROM table_name_62 WHERE tournament = "german masters"
Below are sql tables 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 Olazabal's winning score in the German Masters? ### Input: CREATE TABLE table_name_62 ( winning_score VARCHAR, ...
Damani Ralph is associated with which lowest pick #?
CREATE TABLE table_31916 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text )
SELECT MIN("Pick #") FROM table_31916 WHERE "Player" = 'damani ralph'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Damani Ralph is associated with which lowest pick #? ### Input: CREATE TABLE table_31916 ( "Pick #" real, "MLS team"...
What is Partner Tomas Behrend's Score in the final?
CREATE TABLE table_name_48 ( score_in_the_final VARCHAR, partner VARCHAR )
SELECT score_in_the_final FROM table_name_48 WHERE partner = "tomas behrend"
Below are sql tables 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 Partner Tomas Behrend's Score in the final? ### Input: CREATE TABLE table_name_48 ( score_in_the_final VARCHAR, ...
Show the total number from each flag
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 Flag, COUNT(*) FROM Ship GROUP BY Flag
Below are sql tables 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 total number from each flag ### Input: CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built...
count the number of patients who were diagnosed with chronic kidney disease but did not come back to hospital within 2 months until 1 year ago.
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 = 'chronic kidney disease' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-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: count the number of patients who were diagnosed with chronic kidney disease but did not come back to hospital within 2 month...
Stacked bar chart of how many nationality for with each Type in each nationality, and could you show by the names in desc?
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY Nationality 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: Stacked bar chart of how many nationality for with each Type in each nationality, and could you show by the names in desc? #...
provide the number of patients whose diagnoses icd9 code is 34291 and lab test fluid is ascites?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "34291" AND lab.fluid = "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 diagnoses icd9 code is 34291 and lab test fluid is ascites? ### Input: CREATE TABLE dia...
how many prescribed drugs were prescribed to patient 32160 in 2105?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 prescriptions ( row_id numbe...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32160) AND STRFTIME('%y', prescriptions.startdate) = '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: how many prescribed drugs were prescribed to patient 32160 in 2105? ### Input: CREATE TABLE d_labitems ( row_id number, ...
Who was in the three darts challenge that aired on 10 may 2010?
CREATE TABLE table_26733129_1 ( three_darts_challenge VARCHAR, air_date VARCHAR )
SELECT three_darts_challenge FROM table_26733129_1 WHERE air_date = "10 May 2010"
Below are sql tables 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 in the three darts challenge that aired on 10 may 2010? ### Input: CREATE TABLE table_26733129_1 ( three_darts_c...
calculate the number of patients taking drug via sl route who were born before 2041.
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.route = "SL"
Below are sql tables 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 taking drug via sl route who were born before 2041. ### Input: CREATE TABLE prescriptions (...