instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
What was the score in the final on 14 august 1994?
CREATE TABLE table_name_36 ( score_in_the_final VARCHAR, date VARCHAR )
SELECT score_in_the_final FROM table_name_36 WHERE date = "14 august 1994"
Below are sql tables 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 score in the final on 14 august 1994? ### Input: CREATE TABLE table_name_36 ( score_in_the_final VARCHAR, ...
provide the number of patients whose primary disease is ruq pain and year of birth is less than 2112?
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 WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dob_year < "2112"
Below are sql tables 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 primary disease is ruq pain and year of birth is less than 2112? ### Input: CREATE TABL...
Show the amount for all the payments processed with Visa distributing the payment date with a bar chart, display in descending by the Date_Payment_Made please.
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made 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 amount for all the payments processed with Visa distributing the payment date with a bar chart, display in descendi...
Find meter_200 and the average of ID , and group by attribute meter_200, and visualize them by a bar chart, display from low to high by the X-axis.
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY meter_200
Below are sql tables 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_200 and the average of ID , and group by attribute meter_200, and visualize them by a bar chart, display from low...
What's the total number of episodes with the production code 2395113A?
CREATE TABLE table_16369 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text )
SELECT COUNT("Title") FROM table_16369 WHERE "Production code" = '2395113A'
Below are sql tables 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 total number of episodes with the production code 2395113A? ### Input: CREATE TABLE table_16369 ( "No. in ser...
what specimen test was given to patient 031-16123 in 09/last year for the first time?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT microlab.culturesite 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 DATETIME(microlab.culturetakentime, 'start of year') ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what specimen test was given to patient 031-16123 in 09/last year for the first time? ### Input: CREATE TABLE allergy ( ...
When did fitzroy play at home?
CREATE TABLE table_name_38 ( date VARCHAR, home_team VARCHAR )
SELECT date FROM table_name_38 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: When did fitzroy play at home? ### Input: CREATE TABLE table_name_38 ( date VARCHAR, home_team VARCHAR ) ### Respons...
Favorite questions asked since 1 Jan 2000.
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
SELECT Id AS "post_link", CreationDate, FavoriteCount FROM Posts WHERE PostTypeId = 1 AND TIME_TO_STR(CreationDate, '%Y') >= 2000 AND FavoriteCount >= 250 ORDER BY FavoriteCount 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: Favorite questions asked since 1 Jan 2000. ### Input: CREATE TABLE ReviewTaskStates ( Id number, Name text, Desc...
What is the average enrollment number?
CREATE TABLE College ( enr INTEGER )
SELECT AVG(enr) FROM College
Below are sql tables 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 enrollment number? ### Input: CREATE TABLE College ( enr INTEGER ) ### Response: SELECT AVG(enr) FRO...
For each type, how many ships are there. Show the proportion.
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
SELECT Type, COUNT(*) FROM ship GROUP BY Type
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For each type, how many ships are there. Show the proportion. ### Input: CREATE TABLE mission ( Mission_ID int, Ship...
what was the name of the procedure that was given two times to patient 51200 a month before?
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 512...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the procedure that was given two times to patient 51200 a month before? ### Input: CREATE TABLE chartev...
Who was the home team when the crowd was larger than 13,557?
CREATE TABLE table_57023 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_57023 WHERE "Crowd" > '13,557'
Below are sql tables 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 when the crowd was larger than 13,557? ### Input: CREATE TABLE table_57023 ( "Home team" text, ...
what is the rank when the time is 3:12.40?
CREATE TABLE table_name_70 ( rank INTEGER, time VARCHAR )
SELECT SUM(rank) FROM table_name_70 WHERE time = "3:12.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: what is the rank when the time is 3:12.40? ### Input: CREATE TABLE table_name_70 ( rank INTEGER, time VARCHAR ) ### ...
how many times does patient 016-18575 produce an output (ml)-chest tube #3 mid output on this month/30?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeo...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times does patient 016-18575 produce an output (ml)-chest tube #3 mid output on this month/30? ### Input: CREATE TA...
how many hours has it been since patient 92788's first late effect cv dis nec diagnosis in the current hospital encounter.
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late effect cv dis nec') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admi...
Below are sql tables 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 been since patient 92788's first late effect cv dis nec diagnosis in the current hospital encounter. #...
what is days of hospital stay and death status of subject id 7578?
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.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "7578"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is days of hospital stay and death status of subject id 7578? ### Input: CREATE TABLE demographic ( subject_id text...
If the rating/share is 3.8/10, what is the total number of rating?
CREATE TABLE table_23341 ( "#" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (Night)" text )
SELECT COUNT("Rating") FROM table_23341 WHERE "Rating/Share (18-49)" = '3.8/10'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the rating/share is 3.8/10, what is the total number of rating? ### Input: CREATE TABLE table_23341 ( "#" real, "...
How many losses have a draw greater than 0?
CREATE TABLE table_43193 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real )
SELECT SUM("Lost") FROM table_43193 WHERE "Draw" > '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: How many losses have a draw greater than 0? ### Input: CREATE TABLE table_43193 ( "Team" text, "Match" real, "Po...
How many of the patients on continuous invasive mechanical ventilation for 96 hours or more died in or before the year 2186?
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.dod_year <= "2186.0" AND procedures.long_title = "Continuous invasive mechanical ventilation for 96 consecutive hours or more"
Below are sql tables 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 on continuous invasive mechanical ventilation for 96 hours or more died in or before the year 2186?...
What is Player, when To Par is '7', and when Score is '73-72-67-75=287'?
CREATE TABLE table_49091 ( "Place" text, "Player" text, "Country" text, "Score" text, "To Par" real, "Money ( $ )" real )
SELECT "Player" FROM table_49091 WHERE "To Par" = '7' AND "Score" = '73-72-67-75=287'
Below are sql tables 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 Player, when To Par is '7', and when Score is '73-72-67-75=287'? ### Input: CREATE TABLE table_49091 ( "Place" t...
what number of married patients underwent the procedure titled radiotherapeut proc nec?
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 WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Radiotherapeut proc NEC"
Below are sql tables 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 married patients underwent the procedure titled radiotherapeut proc nec? ### Input: CREATE TABLE prescription...
What are all of the townlands that have exactly 131 acres.
CREATE TABLE table_30120761_1 ( townland VARCHAR, area__acres__ VARCHAR )
SELECT townland FROM table_30120761_1 WHERE area__acres__ = 131
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are all of the townlands that have exactly 131 acres. ### Input: CREATE TABLE table_30120761_1 ( townland VARCHAR, ...
How many people attended the home game for South Melbourne?
CREATE TABLE table_name_58 ( crowd INTEGER, home_team VARCHAR )
SELECT SUM(crowd) FROM table_name_58 WHERE home_team = "south melbourne"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people attended the home game for South Melbourne? ### Input: CREATE TABLE table_name_58 ( crowd INTEGER, h...
How many high assists did the Lakers have?
CREATE TABLE table_78402 ( "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "High assists" FROM table_78402 WHERE "Team" = 'lakers'
Below are sql tables 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 high assists did the Lakers have? ### Input: CREATE TABLE table_78402 ( "Date" text, "Team" text, "Scor...
What is 2008, when 2006 is 'Grand Slam Tournaments'?
CREATE TABLE table_40792 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT "2008" FROM table_40792 WHERE "2006" = 'grand slam tournaments'
Below are sql tables 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 2008, when 2006 is 'Grand Slam Tournaments'? ### Input: CREATE TABLE table_40792 ( "Tournament" text, "2000"...
give me the number of patients whose admission year is less than 2150 and procedure long title is hemodialysis?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2150" 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: give me the number of patients whose admission year is less than 2150 and procedure long title is hemodialysis? ### Input: C...
give me the number of patients whose marital status is single and lab test name is oxygen saturation?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Oxygen Saturation"
Below are sql tables 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 marital status is single and lab test name is oxygen saturation? ### Input: CREATE TABL...
Compare the average of maximum score of wines each year, bin the year into the weekday interval, and show by the Y-axis from high to low.
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
SELECT Year, AVG(MAX(Score)) FROM wine ORDER BY AVG(MAX(Score)) 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: Compare the average of maximum score of wines each year, bin the year into the weekday interval, and show by the Y-axis from...
Who did they play on August 12?
CREATE TABLE table_name_48 ( opponent VARCHAR, date VARCHAR )
SELECT opponent FROM table_name_48 WHERE date = "august 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: Who did they play on August 12? ### Input: CREATE TABLE table_name_48 ( opponent VARCHAR, date VARCHAR ) ### Respons...
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, list by the y axis in desc.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average ...
When 2-0 is the 1st leg what are the home (2nd leg)?
CREATE TABLE table_19174 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
SELECT "Home (2nd leg)" FROM table_19174 WHERE "1st Leg" = '2-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: When 2-0 is the 1st leg what are the home (2nd leg)? ### Input: CREATE TABLE table_19174 ( "Home (1st leg)" text, "H...
When the away team was st kilda, what did the home team score?
CREATE TABLE table_name_7 ( home_team VARCHAR, away_team VARCHAR )
SELECT home_team AS score FROM table_name_7 WHERE away_team = "st kilda"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the away team was st kilda, what did the home team score? ### Input: CREATE TABLE table_name_7 ( home_team VARCHAR,...
what was the name of the drug prescribed for patient 99647 during the same hospital visit after having received a pericardiocentesis procedure since 12/2102?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 cost ( row_id...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 99647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the drug prescribed for patient 99647 during the same hospital visit after having received a pericardio...
what is days of hospital stay and admission time of subject id 15061?
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.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "15061"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is days of hospital stay and admission time of subject id 15061? ### Input: CREATE TABLE demographic ( subject_id t...
what are the four most commonly prescribed drugs that patients of the 60 or above were prescribed within 2 months after having been diagnosed with dmi ophth nt st uncntrld in a year before?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
Below are sql tables 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 prescribed drugs that patients of the 60 or above were prescribed within 2 months after havi...
How much Body Width/mm has a Body Length/mm of 18.4, and Pins of 40?
CREATE TABLE table_65820 ( "Part Number" text, "Pins" text, "Body Width/mm" real, "Body Length/mm" real, "Lead Pitch/mm" real )
SELECT COUNT("Body Width/mm") FROM table_65820 WHERE "Body Length/mm" = '18.4' AND "Pins" = '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: How much Body Width/mm has a Body Length/mm of 18.4, and Pins of 40? ### Input: CREATE TABLE table_65820 ( "Part Number"...
What is the Set 3 when the Total was 62 - 75?
CREATE TABLE table_43378 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
SELECT "Set 3" FROM table_43378 WHERE "Total" = '62 - 75'
Below are sql tables 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 Set 3 when the Total was 62 - 75? ### Input: CREATE TABLE table_43378 ( "Date" text, "Score" text, "...
what is the top four most frequently prescribed drugs that were prescribed to patients in the same month after being diagnosed with encephalopathy - metabolic since 3 years ago?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
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 = 'encephalopathy - metabolic' AND DATETIME(diagnosis...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the top four most frequently prescribed drugs that were prescribed to patients in the same month after being diagnos...
What theme placed as #3 in the finale?
CREATE TABLE table_12175755_1 ( result VARCHAR, theme VARCHAR, order__number VARCHAR )
SELECT result FROM table_12175755_1 WHERE theme = "Finale" AND order__number = "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: What theme placed as #3 in the finale? ### Input: CREATE TABLE table_12175755_1 ( result VARCHAR, theme VARCHAR, ...
Which Tournament has an Outcome of winner, and a Surface of hard (i)?
CREATE TABLE table_36760 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
SELECT "Tournament" FROM table_36760 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_36760 ( "Outcome" te...
Find the relationship between minimum and average gpa of all students in each department with a scatter chart.
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1),...
SELECT AVG(STU_GPA), MIN(STU_GPA) 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: Find the relationship between minimum and average gpa of all students in each department with a scatter chart. ### Input: CR...
what is average age of patients whose admission type is urgent and year of death is less than 2133?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dod_year < "2133.0"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is average age of patients whose admission type is urgent and year of death is less than 2133? ### Input: CREATE TABLE ...
What is the build date of the model with a PRR Class of brs24?
CREATE TABLE table_54317 ( "PRR Class" text, "Builder\u2019s Model" text, "Build date" text, "Total produced" real, "Wheel arrangement" text, "Service" text, "Power output" text )
SELECT "Build date" FROM table_54317 WHERE "PRR Class" = 'brs24'
Below are sql tables 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 build date of the model with a PRR Class of brs24? ### Input: CREATE TABLE table_54317 ( "PRR Class" text, ...
cheapest round trip airfare from TACOMA to ORLANDO
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
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 = 'TACOMA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.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: cheapest round trip airfare from TACOMA to ORLANDO ### Input: CREATE TABLE flight_leg ( flight_id int, leg_number in...
When it comes to the Dance Laboratory course , what 's the course number ?
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT number FROM course WHERE (description LIKE '%Dance Laboratory%' OR name LIKE '%Dance Laboratory%') AND department = 'EECS'
Below are sql tables 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 it comes to the Dance Laboratory course , what 's the course number ? ### Input: CREATE TABLE course_tags_count ( c...
Provide the number of private insurance patients who were dischared to home health care.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "HOME HEALTH CARE"
Below are sql tables 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 private insurance patients who were dischared to home health care. ### Input: CREATE TABLE prescriptio...
tell me the total amount of patient 021-213732's output on last month/10.
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-213732')) AND intakeoutput.cellpath LIKE '%o...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the total amount of patient 021-213732's output on last month/10. ### Input: CREATE TABLE allergy ( allergyid nu...
In 1961, what was the Chassis when the points were lower than 6?
CREATE TABLE table_71423 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
SELECT "Chassis" FROM table_71423 WHERE "Points" < '6' AND "Year" = '1961'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In 1961, what was the Chassis when the points were lower than 6? ### Input: CREATE TABLE table_71423 ( "Year" real, ...
Tell me the player for round more than 5 and position of c
CREATE TABLE table_57287 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
SELECT "Player" FROM table_57287 WHERE "Round" > '5' AND "Position" = '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: Tell me the player for round more than 5 and position of c ### Input: CREATE TABLE table_57287 ( "Round" real, "Play...
Which classes are the easiest for the ULCS requirement ?
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co...
Below are sql tables 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 classes are the easiest for the ULCS requirement ? ### Input: CREATE TABLE course ( course_id int, name varcha...
Name the Qual 2 of a Team of american spirit team johansson and a Best of 59.073?
CREATE TABLE table_65372 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
SELECT "Qual 2" FROM table_65372 WHERE "Team" = 'american spirit team johansson' AND "Best" = '59.073'
Below are sql tables 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 Qual 2 of a Team of american spirit team johansson and a Best of 59.073? ### Input: CREATE TABLE table_65372 ( ...
top 100 POST LINKS for tag AKENEO order by VIEW.
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejecti...
SELECT Posts.Id AS "post_link", ViewCount, Score, FavoriteCount, AnswerCount, CommentCount, Tags, CreationDate FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'akeneo' ORDER BY Posts.ViewCount DESC LIMIT 100
Below are sql tables 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 100 POST LINKS for tag AKENEO order by VIEW. ### Input: CREATE TABLE PostTypes ( Id number, Name text ) CREATE ...
what was patient 035-4312's intake for the first time on this month/26?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
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 = '035-4312')) AND intakeoutput.cellpath LIKE '%intake%' AND DA...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was patient 035-4312's intake for the first time on this month/26? ### Input: CREATE TABLE intakeoutput ( intakeout...
when did patient 59002 have the last test for microbiology until 10 months ago?
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59002) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-10 month') 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: when did patient 59002 have the last test for microbiology until 10 months ago? ### Input: CREATE TABLE prescriptions ( ...
Name the number of first elected for phil crane
CREATE TABLE table_1341672_14 ( first_elected VARCHAR, incumbent VARCHAR )
SELECT COUNT(first_elected) FROM table_1341672_14 WHERE incumbent = "Phil Crane"
Below are sql tables 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 number of first elected for phil crane ### Input: CREATE TABLE table_1341672_14 ( first_elected VARCHAR, in...
For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between price and code .
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.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.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, visualize a scatter chart about the correlation between...
what number of patients with femoral artery thrombosis have 0 death status?
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.expire_flag = "0" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS"
Below are sql tables 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 with femoral artery thrombosis have 0 death status? ### Input: CREATE TABLE demographic ( subjec...
what is the total number of patients who were admitted to the hospital?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABL...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions
Below are sql tables 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 number of patients who were admitted to the hospital? ### Input: CREATE TABLE inputevents_cv ( row_id ...
provide the number of patients who had total calcium lab test and are diagnosed with percutaneous transluminal coronary angioplasty status.
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Status-post ptca" AND lab.label = "Calcium, Total"
Below are sql tables 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 who had total calcium lab test and are diagnosed with percutaneous transluminal coronary angi...
Name the high rebounds for 17-33
CREATE TABLE table_23274514_7 ( high_rebounds VARCHAR, record VARCHAR )
SELECT high_rebounds FROM table_23274514_7 WHERE record = "17-33"
Below are sql tables 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 high rebounds for 17-33 ### Input: CREATE TABLE table_23274514_7 ( high_rebounds VARCHAR, record VARCHAR ) ...
Show the county name and population of all counties with a bar chart, I want to sort by the x axis in asc.
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, A...
SELECT County_name, Population FROM county ORDER BY County_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the county name and population of all counties with a bar chart, I want to sort by the x axis in asc. ### Input: CREATE...
Draw a bar chart about the distribution of meter_700 and ID , and order in asc by the names.
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 record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
SELECT meter_700, ID FROM swimmer ORDER BY meter_700
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of meter_700 and ID , and order in asc by the names. ### Input: CREATE TABLE stadium...
Who had the high rebounds on February 24?
CREATE TABLE table_56734 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "High rebounds" FROM table_56734 WHERE "Date" = 'february 24'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had the high rebounds on February 24? ### Input: CREATE TABLE table_56734 ( "Game" real, "Date" text, "Team"...
since 2104, what are the top four most frequently given lab tests to patients in the same month after they were diagnosed with atherosclerosis nec?
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 d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.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: since 2104, what are the top four most frequently given lab tests to patients in the same month after they were diagnosed wi...
List the names of counties in descending order of population.
CREATE TABLE county_public_safety ( Name VARCHAR, Population VARCHAR )
SELECT Name FROM county_public_safety ORDER BY Population 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: List the names of counties in descending order of population. ### Input: CREATE TABLE county_public_safety ( Name VARCHA...
give me the number of patients whose days of hospital stay is greater than 27 and lab test name is magnesium?
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.days_stay > "27" AND lab.label = "Magnesium"
Below are sql tables 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 days of hospital stay is greater than 27 and lab test name is magnesium? ### Input: CRE...
did patient 53863 have late eff fire acc since 6 years ago.
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE 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.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late eff fire acc') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53863) AND DATETIME(diagnoses_icd.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: did patient 53863 have late eff fire acc since 6 years ago. ### Input: CREATE TABLE inputevents_cv ( row_id number, ...
What is the most common birth place of people?
CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text ) CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number )
SELECT birth_place FROM people GROUP BY birth_place 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 most common birth place of people? ### Input: CREATE TABLE people ( people_id number, name text, hei...
Show me mean rating by languages in a histogram, order by the mean rating in desc please.
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( so...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY AVG(rating) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me mean rating by languages in a histogram, order by the mean rating in desc please. ### Input: CREATE TABLE artist ( ...
How many courses each teacher taught? Show me a stacked bar chart. The x-axis is the instructor's first name and group by course code.
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EM...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE, EMP_FNAME
Below are sql tables 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 courses each teacher taught? Show me a stacked bar chart. The x-axis is the instructor's first name and group by co...
what is date of death of subject id 2560?
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 demographic.dod FROM demographic WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is date of death of subject id 2560? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd...
List the distinct payment method codes with the number of orders mad Show bar chart, and could you order in asc by the y-axis please?
CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Other_Product_Service_...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_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: List the distinct payment method codes with the number of orders mad Show bar chart, and could you order in asc by the y-axi...
how many patients stayed in hospital for more than 10 days and tested in lab for ferritin?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "10" AND lab.label = "Ferritin"
Below are sql tables 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 stayed in hospital for more than 10 days and tested in lab for ferritin? ### Input: CREATE TABLE prescript...
Return a histogram on what is the average number of stars that each reviewer awards for a movie?
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on what is the average number of stars that each reviewer awards for a movie? ### Input: CREATE TABLE Rat...
Which orders are made by the customer named 'Jeramie'? Give me the order ids and status.
CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE invoices ( invoice_number number, invoice_date time, invoice_details text ) CREATE TABLE customers ( customer_id number, customer_name text, customer_details text ) CREATE TABLE products ( produc...
SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
Below are sql tables 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 orders are made by the customer named 'Jeramie'? Give me the order ids and status. ### Input: CREATE TABLE shipment_it...
indicate the daily minimum amount of temperature c (calc) for patient 16329 since 139 months ago.
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id n...
SELECT MIN(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 = 16329)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temp...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the daily minimum amount of temperature c (calc) for patient 16329 since 139 months ago. ### Input: CREATE TABLE pa...
What is the highest number of tourism receipts in 2011 US $ per capita with 19.4 % of GDP in 2003 tourism receipts and less than 655 US $ per arrival in 2011 tourism receipts?
CREATE TABLE table_64550 ( "Country" text, "Tourist arrivals (2011) (Millions)" real, "Tourism receipts (2011) (Millions of US$)" real, "Tourism receipts (2011) (US$ per arrival)" real, "Tourism receipts (2011) (US$ per capita)" real, "Tourism receipts (2003) (as % of GDP)" text, "Tourism re...
SELECT MAX("Tourism receipts (2011) (US$ per capita)") FROM table_64550 WHERE "Tourism receipts (2003) (as % of GDP)" = '19.4' AND "Tourism receipts (2011) (US$ per arrival)" < '655'
Below are sql tables 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 number of tourism receipts in 2011 US $ per capita with 19.4 % of GDP in 2003 tourism receipts and less ...
provide the number of patients whose primary disease is colangitis and lab test fluid is blood?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "COLANGITIS" AND lab.fluid = "Blood"
Below are sql tables 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 primary disease is colangitis and lab test fluid is blood? ### Input: CREATE TABLE lab ...
Who vacated the Pennsylvania 6th district?
CREATE TABLE table_25069 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
SELECT "Vacator" FROM table_25069 WHERE "District" = 'Pennsylvania 6th'
Below are sql tables 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 vacated the Pennsylvania 6th district? ### Input: CREATE TABLE table_25069 ( "District" text, "Vacator" text, ...
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, return a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and list by the x-axis in desc.
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 JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
If the game was on January 21, which game was it?
CREATE TABLE table_3778 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text )
SELECT MAX("Game") FROM table_3778 WHERE "January" = '21'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the game was on January 21, which game was it? ### Input: CREATE TABLE table_3778 ( "Game" real, "January" real, ...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and commission_pct , and visualize them by a bar chart.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 departments ( DEPARTMENT_ID decimal...
SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Below are sql tables 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, find last_name and commi...
Return a bar chart about the distribution of All_Neutral and All_Games_Percent , rank by the X in ascending.
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 All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Neutral
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of All_Neutral and All_Games_Percent , rank by the X in ascending. ### Input: CREA...
What album was recorded by the rca label?
CREATE TABLE table_name_83 ( album VARCHAR, record_label VARCHAR )
SELECT album FROM table_name_83 WHERE record_label = "rca"
Below are sql tables 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 album was recorded by the rca label? ### Input: CREATE TABLE table_name_83 ( album VARCHAR, record_label VARCHA...
Find the number of students in each department that has the top 3 highest number of students. Show the department address and number of students with a bar chart.
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CL...
SELECT DEPT_ADDRESS, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) DESC LIMIT 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: Find the number of students in each department that has the top 3 highest number of students. Show the department address an...
How many years had the best actress in a Revival category?
CREATE TABLE table_47434 ( "Year" real, "Award" text, "Category" text, "Nominated work" text, "Result" text )
SELECT COUNT("Year") FROM table_47434 WHERE "Category" = 'best actress in a revival'
Below are sql tables 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 years had the best actress in a Revival category? ### Input: CREATE TABLE table_47434 ( "Year" real, "Award...
Show the number of courses for each course description in a bar chart, and sort bar from low to high order please.
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 CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) 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 ORDER BY CRS_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: Show the number of courses for each course description in a bar chart, and sort bar from low to high order please. ### Input...
How many patients are with primary disease ventricular tachycardia with age below 70?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "VENTRICULAR TACHYCARDIA" AND demographic.age < "70"
Below are sql tables 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 are with primary disease ventricular tachycardia with age below 70? ### Input: CREATE TABLE prescriptions ...
Which Date has an Away team score of 16.13 (109)?
CREATE TABLE table_51888 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_51888 WHERE "Away team score" = '16.13 (109)'
Below are sql tables 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 Date has an Away team score of 16.13 (109)? ### Input: CREATE TABLE table_51888 ( "Home team" text, "Home team...
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 average of salary , and group by attribute job_id, show y-axis in asc order.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(SALARY)
Below are sql tables 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...
Name the march 27-29 for november 3 being 133
CREATE TABLE table_21286 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text )
SELECT "March 27-29" FROM table_21286 WHERE "November 3" = '133'
Below are sql tables 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 march 27-29 for november 3 being 133 ### Input: CREATE TABLE table_21286 ( "June 10-11" text, "March 27-29"...
What district first elected a Democratic incumbent in 1998?
CREATE TABLE table_1805191_50 ( district VARCHAR, party VARCHAR, first_elected VARCHAR )
SELECT district FROM table_1805191_50 WHERE party = "Democratic" AND first_elected = 1998
Below are sql tables 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 district first elected a Democratic incumbent in 1998? ### Input: CREATE TABLE table_1805191_50 ( district VARCHAR,...
Give me a bar chart showing the number of films for each director, rank in ascending by the Y-axis.
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart showing the number of films for each director, rank in ascending by the Y-axis. ### Input: CREATE TABLE ...
Show party names and the number of events for each party by a pie chart.
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, ...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_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: Show party names and the number of events for each party by a pie chart. ### Input: CREATE TABLE region ( Region_ID int,...
Top 100 stackoverflow users in Tunisia.
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId numb...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%tunisia%' OR LOWER(Location) LIKE '%tunisie%' ORDER BY Reputation DESC LIMIT 100
Below are sql tables 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 100 stackoverflow users in Tunisia. ### Input: CREATE TABLE Badges ( Id number, UserId number, Name text, ...
In which venue did the home team score 10.11 (71)
CREATE TABLE table_52838 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_52838 WHERE "Home team score" = '10.11 (71)'
Below are sql tables 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 which venue did the home team score 10.11 (71) ### Input: CREATE TABLE table_52838 ( "Home team" text, "Home team...
When was John McEnroe's minimum year?
CREATE TABLE table_2646 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
SELECT MIN("Year") FROM table_2646
Below are sql tables 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 John McEnroe's minimum year? ### Input: CREATE TABLE table_2646 ( "Outcome" text, "Year" real, "Champio...
Give me a bar chart for the total number of each class
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
SELECT Class, COUNT(*) FROM race GROUP BY Class
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart for the total number of each class ### Input: CREATE TABLE race ( Race_ID int, Name text, Cl...
Return a bar chart showing how many shops in each location, could you rank how many location in ascending order please?
CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE stock ( Shop_ID int, Device...
SELECT Location, COUNT(Location) FROM shop GROUP BY Location ORDER BY COUNT(Location)
Below are sql tables 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 how many shops in each location, could you rank how many location in ascending order please? ### ...
What is the player from Japan's To Par?
CREATE TABLE table_name_30 ( to_par VARCHAR, country VARCHAR )
SELECT to_par FROM table_name_30 WHERE country = "japan"
Below are sql tables 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 player from Japan's To Par? ### Input: CREATE TABLE table_name_30 ( to_par VARCHAR, country VARCHAR ) ##...