instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Which conflicts took place in Yemen?
CREATE TABLE table_22891 ( "Start of conflict" real, "End of conflict" text, "Conflict" text, "Continent" text, "Location" text, "Branches involved" text )
SELECT "Conflict" FROM table_22891 WHERE "Location" = 'Yemen'
Below are sql tables 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 conflicts took place in Yemen? ### Input: CREATE TABLE table_22891 ( "Start of conflict" real, "End of conflic...
how many patients whose admission location is transfer from hosp/extram and discharge location is disc-tran cancer/chldrn h?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
Below are sql tables 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 admission location is transfer from hosp/extram and discharge location is disc-tran cancer/chldrn h?...
What visitor has march 26 as the date?
CREATE TABLE table_38912 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
SELECT "Visitor" FROM table_38912 WHERE "Date" = 'march 26'
Below are sql tables 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 visitor has march 26 as the date? ### Input: CREATE TABLE table_38912 ( "Date" text, "Visitor" text, "Score...
give the admission type of subject id 11221.
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 FROM demographic WHERE demographic.subject_id = "11221"
Below are sql tables 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 the admission type of subject id 11221. ### Input: CREATE TABLE demographic ( subject_id text, hadm_id text, ...
when patient 8773 arterial bp [diastolic] last measured on 12/19/2104?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
SELECT chartevents.charttime 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 = 8773)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
Below are sql tables 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 patient 8773 arterial bp [diastolic] last measured on 12/19/2104? ### Input: CREATE TABLE labevents ( row_id number...
how many male patients have copd exacerbation as their primary disease?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "COPD EXACERBATION"
Below are sql tables 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 male patients have copd exacerbation as their primary disease? ### Input: CREATE TABLE procedures ( subject_id ...
Which player is from Northern Ireland?
CREATE TABLE table_61125 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Player" FROM table_61125 WHERE "Country" = 'northern ireland'
Below are sql tables 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 player is from Northern Ireland? ### Input: CREATE TABLE table_61125 ( "Place" text, "Player" text, "Count...
Show all the buildings along with the number of faculty members the buildings have Plot them as bar chart, and show from high to low by the x-axis.
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building 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 all the buildings along with the number of faculty members the buildings have Plot them as bar chart, and show from hig...
how many patients whose gender is m and lab test name is renal epithelial cells?
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.gender = "M" AND lab.label = "Renal Epithelial Cells"
Below are sql tables 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 m and lab test name is renal epithelial cells? ### Input: CREATE TABLE lab ( subject_i...
Show me the trend aboutthe maximum score of wines for each year, rank Year in desc order please.
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
SELECT Year, MAX(Score) FROM wine GROUP BY Year ORDER BY Year 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 the trend aboutthe maximum score of wines for each year, rank Year in desc order please. ### Input: CREATE TABLE win...
For those employees who did not have any job in the past, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, and sort by the total number in ascending.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY COUNT(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 those employees who did not have any job in the past, show me about the distribution of job_id and the amount of job_id ...
of the patients of age 60 or above , what was the top five most frequent diagnoses?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: of the patients of age 60 or above , what was the top five most frequent diagnoses? ### Input: CREATE TABLE labevents ( ...
What was the score for the game against San Antonio?
CREATE TABLE table_45265 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Score" FROM table_45265 WHERE "Team" = 'san antonio'
Below are sql tables 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 for the game against San Antonio? ### Input: CREATE TABLE table_45265 ( "Game" real, "Date" text,...
could you find me the cheapest fare from BOSTON to SAN FRANCISCO
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
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 = 'BOSTON' 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: could you find me the cheapest fare from BOSTON to SAN FRANCISCO ### Input: CREATE TABLE dual_carrier ( main_airline var...
How many publications does scott klemmer have ?
CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'scott klemmer' AND writes.authorid = author.authorid
Below are sql tables 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 publications does scott klemmer have ? ### Input: CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( ...
What was the venue when the home team was Essendon?
CREATE TABLE table_11148 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_11148 WHERE "Home team" = 'essendon'
Below are sql tables 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 venue when the home team was Essendon? ### Input: CREATE TABLE table_11148 ( "Home team" text, "Home te...
What is the lowest start in a year after 2008?
CREATE TABLE table_name_62 ( start INTEGER, year INTEGER )
SELECT MIN(start) FROM table_name_62 WHERE year > 2008
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest start in a year after 2008? ### Input: CREATE TABLE table_name_62 ( start INTEGER, year INTEGER )...
find the number of patients who were given the drug oseltamivir had stayed in the hospital for more than 7 days.
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "7" AND prescriptions.drug = "Oseltamivir"
Below are sql tables 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 were given the drug oseltamivir had stayed in the hospital for more than 7 days. ### Input: ...
What was the score for the game with a record of 11-22 and a H/A/N of A?
CREATE TABLE table_8033 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
SELECT "Score" FROM table_8033 WHERE "H/A/N" = 'a' AND "Record" = '11-22'
Below are sql tables 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 for the game with a record of 11-22 and a H/A/N of A? ### Input: CREATE TABLE table_8033 ( "Date" tex...
What capital has a population of 596268?
CREATE TABLE table_19083 ( "Code" real, "County" text, "Former Province" text, "Area (km 2 )" text, "Population Census 2009" real, "Capital" text )
SELECT "Capital" FROM table_19083 WHERE "Population Census 2009" = '596268'
Below are sql tables 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 capital has a population of 596268? ### Input: CREATE TABLE table_19083 ( "Code" real, "County" text, "Form...
What is the average Round for wide receiver r. jay soward and Overall smaller than 29?
CREATE TABLE table_75538 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT AVG("Round") FROM table_75538 WHERE "Position" = 'wide receiver' AND "Name" = 'r. jay soward' AND "Overall" < '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 is the average Round for wide receiver r. jay soward and Overall smaller than 29? ### Input: CREATE TABLE table_75538 (...
ground transportation in DENVER
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, pro...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: ground transportation in DENVER ### Input: CREATE TABLE code_description ( code varchar, description text ) CREATE ...
tell me the name of the lab tests that patient 027-61708 first received?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708')) ORDER BY lab.labresulttime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the name of the lab tests that patient 027-61708 first received? ### Input: CREATE TABLE intakeoutput ( intakeou...
how many current patients are of the age 60 or above.
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age >= 60
Below are sql tables 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 current patients are of the age 60 or above. ### Input: CREATE TABLE cost ( costid number, uniquepid text, ...
how many dead patients were admitted in hospital for more than 14 days?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.days_stay > "14"
Below are sql tables 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 dead patients were admitted in hospital for more than 14 days? ### Input: CREATE TABLE procedures ( subject_id ...
Which Losses have an Against smaller than 1464, and Draws smaller than 1, and Wins larger than 7?
CREATE TABLE table_12494 ( "Lexton Plains" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
SELECT MIN("Losses") FROM table_12494 WHERE "Against" < '1464' AND "Draws" < '1' AND "Wins" > '7'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Losses have an Against smaller than 1464, and Draws smaller than 1, and Wins larger than 7? ### Input: CREATE TABLE ta...
what's the candidates with party being democratic and dbeingtrict being north carolina 1
CREATE TABLE table_740 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "Candidates" FROM table_740 WHERE "Party" = 'Democratic' AND "District" = 'North Carolina 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's the candidates with party being democratic and dbeingtrict being north carolina 1 ### Input: CREATE TABLE table_740 (...
A bar chart for listing the number of the phone numbers of all employees, and I want to show in asc by the y axis.
CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varchar(20), Title varchar(30), ReportsTo integer, BirthDate datetime, HireDate datetime, Address varchar(70), City varchar(40), State varchar(40), Country varchar(40), PostalCode varchar(10), ...
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for listing the number of the phone numbers of all employees, and I want to show in asc by the y axis. ### Input...
Show the card type codes and the number of transactions Visualize by bar chart, I want to rank by the x-axis in ascending please.
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transa...
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY card_type_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the card type codes and the number of transactions Visualize by bar chart, I want to rank by the x-axis in ascending pl...
how many games did the broncos win ?
CREATE TABLE table_203_371 ( id number, "round" number, "opponent" text, "result" text, "bro." number, "opp." number, "date" text, "venue" text, "crowd" number, "position" text )
SELECT COUNT(*) FROM table_203_371 WHERE "result" = 'win'
Below are sql tables 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 games did the broncos win ? ### Input: CREATE TABLE table_203_371 ( id number, "round" number, "opponen...
what is subject name of subject id 66411?
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 demographic.name FROM demographic WHERE demographic.subject_id = "66411"
Below are sql tables 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 subject name of subject id 66411? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text, itemid te...
Create a pie chart showing how many headquarters across headquarters.
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Create a pie chart showing how many headquarters across headquarters. ### Input: CREATE TABLE company ( Company_ID int, ...
count the number of patients whose insurance is medicare and lab test name is atypical lymphocytes?
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.insurance = "Medicare" AND lab.label = "Atypical Lymphocytes"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose insurance is medicare and lab test name is atypical lymphocytes? ### Input: CREATE TABLE ...
What is the average crowd size for an away team with a score of 14.19 (103)?
CREATE TABLE table_55149 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT AVG("Crowd") FROM table_55149 WHERE "Away team score" = '14.19 (103)'
Below are sql tables 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 crowd size for an away team with a score of 14.19 (103)? ### Input: CREATE TABLE table_55149 ( "Home...
What is the score of the match with a 3-2 result?
CREATE TABLE table_76627 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT "Score" FROM table_76627 WHERE "Result" = '3-2'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the score of the match with a 3-2 result? ### Input: CREATE TABLE table_76627 ( "Date" text, "Venue" text, ...
during this year what were the five most frequent medications prescribed to patients aged 50s after being diagnosed with urin tract infection nos within 2 months?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardi...
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: during this year what were the five most frequent medications prescribed to patients aged 50s after being diagnosed with uri...
list the top four most common drugs that patients were prescribed with within 2 months after they were prescribed with sodium chloride 3% (hypertonic) last year.
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 t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'sodium chloride 3% (hypertonic)' AND DATETIME(prescriptions.start...
Below are sql tables 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 top four most common drugs that patients were prescribed with within 2 months after they were prescribed with sodiu...
What is the high rebounds with a record that is 18-14?
CREATE TABLE table_5804 ( "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_5804 WHERE "Record" = '18-14'
Below are sql tables 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 high rebounds with a record that is 18-14? ### Input: CREATE TABLE table_5804 ( "Game" real, "Date" text...
Draw a bar chart about the distribution of Team_Name and All_Games_Percent , order by the All_Games_Percent 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 Team_Name, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
Below are sql tables 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 Team_Name and All_Games_Percent , order by the All_Games_Percent in ascending. ##...
What was the tie no when Oxford city was the away team?
CREATE TABLE table_name_39 ( tie_no VARCHAR, away_team VARCHAR )
SELECT tie_no FROM table_name_39 WHERE away_team = "oxford city"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the tie no when Oxford city was the away team? ### Input: CREATE TABLE table_name_39 ( tie_no VARCHAR, away...
Compute the total the total number across type as a pie chart.
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, seq...
SELECT Type, COUNT(*) FROM Institution 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: Compute the total the total number across type as a pie chart. ### Input: CREATE TABLE building ( building_id text, ...
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of code , and group by attribute name, and display in desc by the X please.
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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the aver...
Are there any 500 -level classes offered in the Spring or Summer term ?
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('SP', 'SU', 'SS') AND semester.semester_i...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any 500 -level classes offered in the Spring or Summer term ? ### Input: CREATE TABLE program_course ( program...
provide the number of patients whose diagnoses short title is idio periph neurpthy nos and drug route is dwell?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Idio periph neurpthy NOS" AND prescriptions.route = "DWELL"
Below are sql tables 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 short title is idio periph neurpthy nos and drug route is dwell? ### Input: C...
what flights depart from CHARLOTTE to NEWARK that leave in the afternoon or leave in the evening
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE equipment_sequence (...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.departure_time BETWEEN 1200 AND 1800) OR (flight.departure_time BETWEEN 1800 AND 2200)) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.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: what flights depart from CHARLOTTE to NEWARK that leave in the afternoon or leave in the evening ### Input: CREATE TABLE tim...
What is the lowest tie with less than 100 points and 277 goals?
CREATE TABLE table_name_57 ( tied INTEGER, points VARCHAR, goals_for VARCHAR )
SELECT MIN(tied) FROM table_name_57 WHERE points < 100 AND goals_for = 277
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest tie with less than 100 points and 277 goals? ### Input: CREATE TABLE table_name_57 ( tied INTEGER, ...
What country does Adam van Koeverden play for?
CREATE TABLE table_66315 ( "Rank" real, "Athletes" text, "Country" text, "Time" text, "Notes" text )
SELECT "Country" FROM table_66315 WHERE "Athletes" = 'adam van koeverden'
Below are sql tables 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 country does Adam van Koeverden play for? ### Input: CREATE TABLE table_66315 ( "Rank" real, "Athletes" text, ...
What's the date of the week 12 game whose attendance was larger than 64,721?
CREATE TABLE table_9306 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT "Date" FROM table_9306 WHERE "Attendance" > '64,721' AND "Week" = '12'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the date of the week 12 game whose attendance was larger than 64,721? ### Input: CREATE TABLE table_9306 ( "Week"...
What was the date of the game when St. Louis was the visiting team?
CREATE TABLE table_name_17 ( date VARCHAR, visitor VARCHAR )
SELECT date FROM table_name_17 WHERE visitor = "st. louis"
Below are sql tables 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 date of the game when St. Louis was the visiting team? ### Input: CREATE TABLE table_name_17 ( date VARCHAR...
Show the album names and ids for albums that contain tracks with unit price bigger than 1 by a bar chart, sort from low to high by the y-axis.
CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Invoice ( InvoiceId integer, CustomerId integer, InvoiceDate datetime, BillingAddress varchar(70), BillingCity varchar(40), BillingState varchar(40), BillingCountry varchar(40), BillingPostalCode varc...
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.AlbumId
Below are sql tables 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 album names and ids for albums that contain tracks with unit price bigger than 1 by a bar chart, sort from low to h...
How many episodes are directed by ricardo mendez matta?
CREATE TABLE table_26866519_1 ( season__number VARCHAR, director VARCHAR )
SELECT COUNT(season__number) FROM table_26866519_1 WHERE director = "Ricardo Mendez Matta"
Below are sql tables 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 episodes are directed by ricardo mendez matta? ### Input: CREATE TABLE table_26866519_1 ( season__number VARCHA...
How many people attended the game that resulted in an away team score of 18.17 (125)?
CREATE TABLE table_54146 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT SUM("Crowd") FROM table_54146 WHERE "Away team score" = '18.17 (125)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many people attended the game that resulted in an away team score of 18.17 (125)? ### Input: CREATE TABLE table_54146 ( ...
TOP Scala users in Estonia.
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TA...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.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: TOP Scala users in Estonia. ### Input: CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks...
What is the highest league goals that have barry endean as the name, wirh FA cup apps greater than 0?
CREATE TABLE table_64902 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
SELECT MAX("League Goals") FROM table_64902 WHERE "Name" = 'barry endean' AND "FA Cup Apps" > '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 the highest league goals that have barry endean as the name, wirh FA cup apps greater than 0? ### Input: CREATE TABL...
Who was the rider who went 14 laps on a Honda CBR1000rr, with a time of +1'04.877 on a grid larger than 23?
CREATE TABLE table_name_46 ( rider VARCHAR, time VARCHAR, bike VARCHAR, laps VARCHAR, grid VARCHAR )
SELECT rider FROM table_name_46 WHERE laps = 14 AND grid > 23 AND bike = "honda cbr1000rr" AND time = "+1'04.877"
Below are sql tables 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 rider who went 14 laps on a Honda CBR1000rr, with a time of +1'04.877 on a grid larger than 23? ### Input: CREAT...
In the round that lasted 0:20, what was the Res?
CREATE TABLE table_name_1 ( res VARCHAR, time VARCHAR )
SELECT res FROM table_name_1 WHERE time = "0: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: In the round that lasted 0:20, what was the Res? ### Input: CREATE TABLE table_name_1 ( res VARCHAR, time VARCHAR ) ...
What are the names of the courses that have exactly 1 student enrollment?
CREATE TABLE Student_Course_Enrolment ( course_id VARCHAR ) CREATE TABLE Courses ( course_name VARCHAR, course_id VARCHAR )
SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name HAVING COUNT(*) = 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 are the names of the courses that have exactly 1 student enrollment? ### Input: CREATE TABLE Student_Course_Enrolment (...
what was the number of furosemide prescriptions prescribed since 2104?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'furosemide' AND STRFTIME('%y', prescriptions.startdate) >= '2104'
Below are sql tables 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 number of furosemide prescriptions prescribed since 2104? ### Input: CREATE TABLE diagnoses_icd ( row_id nu...
What was the margin of victory for the Players Championship tournament?
CREATE TABLE table_name_70 ( margin_of_victory VARCHAR, tournament VARCHAR )
SELECT margin_of_victory FROM table_name_70 WHERE tournament = "the players championship"
Below are sql tables 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 margin of victory for the Players Championship tournament? ### Input: CREATE TABLE table_name_70 ( margin_o...
At a Saginaw fare of $470.47, what is the fare to Lansing?
CREATE TABLE table_1637981_7 ( lansing__lan_ VARCHAR, saginaw__mbs_ VARCHAR )
SELECT lansing__lan_ FROM table_1637981_7 WHERE saginaw__mbs_ = "$470.47"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: At a Saginaw fare of $470.47, what is the fare to Lansing? ### Input: CREATE TABLE table_1637981_7 ( lansing__lan_ VARCH...
What is the Draw for skra warszawa?
CREATE TABLE table_41177 ( "Team" text, "Match" text, "Points" text, "Draw" text, "Lost" text )
SELECT "Draw" FROM table_41177 WHERE "Team" = 'skra warszawa'
Below are sql tables 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 Draw for skra warszawa? ### Input: CREATE TABLE table_41177 ( "Team" text, "Match" text, "Points" te...
what is diagnoses short title of subject id 21796?
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "21796"
Below are sql tables 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 diagnoses short title of subject id 21796? ### Input: CREATE TABLE demographic ( subject_id text, hadm_id te...
A bar chart about how many students live in each city?
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about how many students live in each city? ### Input: CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy ...
A pie chart about the proportion of the total number for each team.
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A pie chart about the proportion of the total number for each team. ### Input: CREATE TABLE Elimination ( Elimination_ID...
tell me the two year survival rate of patients who were prescribed piperacillin-tazobactam 3.375 g ivpb after they were diagnosed with malignancy?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
Below are sql tables 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 two year survival rate of patients who were prescribed piperacillin-tazobactam 3.375 g ivpb after they were diag...
Give me the trend about the amount of date_address_to over date_address_to , and group by attribute other_details.
CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Ref_Address_Types ( add...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me the trend about the amount of date_address_to over date_address_to , and group by attribute other_details. ### Input...
Name the numbers of the nba draft where the player went to kentucky
CREATE TABLE table_11677760_31 ( nba_draft VARCHAR, college VARCHAR )
SELECT nba_draft FROM table_11677760_31 WHERE college = "Kentucky"
Below are sql tables 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 numbers of the nba draft where the player went to kentucky ### Input: CREATE TABLE table_11677760_31 ( nba_draf...
What was the series standing after game 1?
CREATE TABLE table_name_5 ( series VARCHAR, game VARCHAR )
SELECT series FROM table_name_5 WHERE game = 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the series standing after game 1? ### Input: CREATE TABLE table_name_5 ( series VARCHAR, game VARCHAR ) ###...
does YX serve BALTIMORE
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_0.airport_code AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE') OR (flight.from_airpo...
Below are sql tables 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 YX serve BALTIMORE ### Input: CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopo...
How many users have asked a question for a tag?.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT COUNT(DISTINCT p.OwnerUserId) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.TagId = @TagId WHERE pt.PostId = p.Id AND p.PostTypeId = 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 users have asked a question for a tag?. ### Input: CREATE TABLE PostLinks ( Id number, CreationDate time, ...
WHAT IS THE 2012 WITH 2005 OF 1R?
CREATE TABLE table_name_35 ( Id VARCHAR )
SELECT 2012 FROM table_name_35 WHERE 2005 = "1r"
Below are sql tables 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 2012 WITH 2005 OF 1R? ### Input: CREATE TABLE table_name_35 ( Id VARCHAR ) ### Response: SELECT 2012 FROM ta...
What is the average in 2010 of the team with a code of (IATA/ICAO) or cra/lrcv?
CREATE TABLE table_name_20 ( code__iata_icao_ VARCHAR )
SELECT 2010 FROM table_name_20 WHERE code__iata_icao_ = "cra/lrcv"
Below are sql tables 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 in 2010 of the team with a code of (IATA/ICAO) or cra/lrcv? ### Input: CREATE TABLE table_name_20 ( ...
Draw a bar chart of sex versus mean height, order by the y axis in descending.
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart of sex versus mean height, order by the y axis in descending. ### Input: CREATE TABLE people ( People_I...
what is the number of patients born before 2101 who take prescription for mexiletine drug?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2101" AND prescriptions.drug = "Mexiletine"
Below are sql tables 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 born before 2101 who take prescription for mexiletine drug? ### Input: CREATE TABLE lab ( ...
Name the catalog number for am/pm callanetics
CREATE TABLE table_27303975_2 ( catalog_number VARCHAR, title VARCHAR )
SELECT catalog_number FROM table_27303975_2 WHERE title = "AM/PM Callanetics"
Below are sql tables 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 catalog number for am/pm callanetics ### Input: CREATE TABLE table_27303975_2 ( catalog_number VARCHAR, tit...
when was the first time the heart rate for patient 25814 was less than 78.0 on this month/30?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id ...
SELECT chartevents.charttime 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 = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time the heart rate for patient 25814 was less than 78.0 on this month/30? ### Input: CREATE TABLE inpute...
Does the class 571 have lab ?
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters ...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 571
Below are sql tables 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 the class 571 have lab ? ### Input: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar )...
how many times have patient 15119's been visited in icu when they visited the hospital first time?
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE i...
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15119 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times have patient 15119's been visited in icu when they visited the hospital first time? ### Input: CREATE TABLE c...
what's the price of prostate specific antigen.
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'prostate specific antigen'))
Below are sql tables 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 price of prostate specific antigen. ### Input: CREATE TABLE diagnoses_icd ( row_id number, subject_id num...
when did patient 20862 get a d5w intake for the last time on 02/19/last year?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20862)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 20862 get a d5w intake for the last time on 02/19/last year? ### Input: CREATE TABLE cost ( row_id numb...
let me know the long title of diagnoses for patient with patient id 18372.
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 diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18372"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: let me know the long title of diagnoses for patient with patient id 18372. ### Input: CREATE TABLE prescriptions ( subje...
For those employees who did not have any job in the past, visualize a line chart about the change of salary over hire_date , order by the x-axis from high to low please.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, visualize a line chart about the change of salary over hire_date ,...
What is the customer id, first and last name with most number of accounts.
CREATE TABLE orders ( order_id number, customer_id number, date_order_placed time, order_details text ) CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, derived_...
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM accounts AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id 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 customer id, first and last name with most number of accounts. ### Input: CREATE TABLE orders ( order_id num...
What is the most popular payment method?
CREATE TABLE Payments ( Payment_Method_Code VARCHAR )
SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code 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 popular payment method? ### Input: CREATE TABLE Payments ( Payment_Method_Code VARCHAR ) ### Response: ...
Who built the car that has a Time/Retired of 1:34:12.912?
CREATE TABLE table_11352 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Constructor" FROM table_11352 WHERE "Time/Retired" = '1:34:12.912'
Below are sql tables 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 built the car that has a Time/Retired of 1:34:12.912? ### Input: CREATE TABLE table_11352 ( "Driver" text, "Cons...
Return the number of the countries of the mountains that have a height larger than 5000.
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 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: Return the number of the countries of the mountains that have a height larger than 5000. ### Input: CREATE TABLE mountain ( ...
what is the three most common lab testing done this year?
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 t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 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 is the three most common lab testing done this year? ### Input: CREATE TABLE allergy ( allergyid number, patien...
what is diagnoses long title of subject id 18077?
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 diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18077"
Below are sql tables 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 diagnoses long title of subject id 18077? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id t...
how much do patients pay to get a diagnosis of cardiac tamponade?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cardiac tamponade'))
Below are sql tables 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 do patients pay to get a diagnosis of cardiac tamponade? ### Input: CREATE TABLE diagnoses_icd ( row_id number,...
for the first time in 11/2104, what specimen test did patient 031-9128 get?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
SELECT 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-9128')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2104-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: for the first time in 11/2104, what specimen test did patient 031-9128 get? ### Input: CREATE TABLE microlab ( microlabi...
SELECT TOP 10 * FROM Users.
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
SELECT * FROM Users WHERE Location LIKE '%Nigeria%' ORDER BY Reputation DESC LIMIT 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: SELECT TOP 10 * FROM Users. ### Input: CREATE TABLE Comments ( Id number, PostId number, Score number, Text ...
when did patient 030-34260 the last time had voided amount output yesterday?
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 intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260')) AND intakeoutput.cellpath LIKE '%output%...
Below are sql tables 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 030-34260 the last time had voided amount output yesterday? ### Input: CREATE TABLE vitalperiodic ( vit...
when was patient 007-7646 prescribed with dext 5%-nacl 0.45% 1000 ml lvp and ondansetron (pf) for the first time at the same time?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepi...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'dext 5%-nacl 0.45% 1000 ml lvp' AND patient.uniquepid = '007-7646') AS t1 JOIN (SELECT patient.uniquepid, medication.drug...
Below are sql tables 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 patient 007-7646 prescribed with dext 5%-nacl 0.45% 1000 ml lvp and ondansetron (pf) for the first time at the same...
What are the descriptions of all the project outcomes, and count them by a bar chart, show X in desc order.
CREATE TABLE Research_Staff ( staff_id INTEGER, employer_organisation_id INTEGER, staff_details VARCHAR(255) ) CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ...
SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the descriptions of all the project outcomes, and count them by a bar chart, show X in desc order. ### Input: CREAT...
For those employees who was hired before 2002-06-21, return a scatter chart about the correlation between commission_pct and department_id .
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 decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-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: For those employees who was hired before 2002-06-21, return a scatter chart about the correlation between commission_pct and...
What are the LOA (metres) of boat with sail number M10?
CREATE TABLE table_20854943_2 ( loa__metres_ VARCHAR, sail_number VARCHAR )
SELECT loa__metres_ FROM table_20854943_2 WHERE sail_number = "M10"
Below are sql tables 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 LOA (metres) of boat with sail number M10? ### Input: CREATE TABLE table_20854943_2 ( loa__metres_ VARCHAR,...
For 542 , how many times has Prof. Pelham Barron taught ?
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 542 AND instructor.name LIKE '%Pelham Barron%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.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: For 542 , how many times has Prof. Pelham Barron taught ? ### Input: CREATE TABLE student ( student_id int, lastname...
How many fans were at Essendon?
CREATE TABLE table_name_48 ( crowd VARCHAR, home_team VARCHAR )
SELECT COUNT(crowd) FROM table_name_48 WHERE home_team = "essendon"
Below are sql tables 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 fans were at Essendon? ### Input: CREATE TABLE table_name_48 ( crowd VARCHAR, home_team VARCHAR ) ### Respo...
How many Wins have a Top 5 smaller than 0?
CREATE TABLE table_name_57 ( wins INTEGER, top_5 INTEGER )
SELECT SUM(wins) FROM table_name_57 WHERE top_5 < 0
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many Wins have a Top 5 smaller than 0? ### Input: CREATE TABLE table_name_57 ( wins INTEGER, top_5 INTEGER ) ###...
For those products with a price between 60 and 120, for the attribute name and code, show their proportion by a pie chart.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those products with a price between 60 and 120, for the attribute name and code, show their proportion by a pie chart. #...