instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Find the oldest age for students with different sex in a bar chart, I want to show from high to low by the names. | CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Ad... | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY Sex 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: Find the oldest age for students with different sex in a bar chart, I want to show from high to low by the names. ### Input:... |
Return a bar chart on how many wines are there for each grape? | CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on how many wines are there for each grape? ### Input: CREATE TABLE appellations (
No INTEGER,
Ap... |
how many of the male patients had icd9 code 51889? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "51889" | Below are sql tables 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 male patients had icd9 code 51889? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text... |
show me all flights from PITTSBURGH to PHILADELPHIA which arrive before 800 o'clock am on wednesday | 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, date_day, days, flight WHERE (((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.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: show me all flights from PITTSBURGH to PHILADELPHIA which arrive before 800 o'clock am on wednesday ### Input: CREATE TABLE ... |
Who directed the episode with the production code of 6AKY11? | CREATE TABLE table_28027307_1 (
directed_by VARCHAR,
production_code VARCHAR
) | SELECT directed_by FROM table_28027307_1 WHERE production_code = "6AKY11" | Below are sql tables 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 directed the episode with the production code of 6AKY11? ### Input: CREATE TABLE table_28027307_1 (
directed_by VARC... |
What is melbourne's home team score? | CREATE TABLE table_name_48 (
home_team VARCHAR
) | SELECT home_team AS score FROM table_name_48 WHERE home_team = "melbourne" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is melbourne's home team score? ### Input: CREATE TABLE table_name_48 (
home_team VARCHAR
) ### Response: SELECT ho... |
Show me about the distribution of Sex and the average of Weight , and group by attribute Sex in a bar chart, list mean weight in ascending order. | 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(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of Sex and the average of Weight , and group by attribute Sex in a bar chart, list mean weigh... |
What did the home team score when playing at Western Oval? | CREATE TABLE table_32339 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team score" FROM table_32339 WHERE "Venue" = 'western oval' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What did the home team score when playing at Western Oval? ### Input: CREATE TABLE table_32339 (
"Home team" text,
"... |
i need a flight from KANSAS CITY to NEWARK on the 1 of 7 | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND date_day.day_number = 1 AND date_day.month_number = 7 AND dat... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i need a flight from KANSAS CITY to NEWARK on the 1 of 7 ### Input: CREATE TABLE city (
city_code varchar,
city_name... |
what's the estimated value where cover date is august 1962 | CREATE TABLE table_1217448_1 (
estimated_value VARCHAR,
cover_date VARCHAR
) | SELECT estimated_value FROM table_1217448_1 WHERE cover_date = "August 1962" | Below are sql tables 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 estimated value where cover date is august 1962 ### Input: CREATE TABLE table_1217448_1 (
estimated_value VAR... |
How many workshops did each author submit to? Return the author name and the number of workshops in a bar chart. | CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_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: How many workshops did each author submit to? Return the author name and the number of workshops in a bar chart. ### Input: ... |
what is average age of patients whose admission type is elective and days of hospital stay is 16? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay = "16" | Below are sql tables 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 elective and days of hospital stay is 16? ### Input: CREATE TABLE la... |
How many years had the best actress in a Revival category? | CREATE TABLE table_name_9 (
year VARCHAR,
category VARCHAR
) | SELECT COUNT(year) FROM table_name_9 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_name_9 (
year VARCHAR,
cate... |
Create a bar chart showing the total number across city code, sort y-axis in ascending order. | CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
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 Dorm (
dormid INTEGER,
dorm_name VARC... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_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: Create a bar chart showing the total number across city code, sort y-axis in ascending order. ### Input: CREATE TABLE Has_am... |
What is Power (kW), when Coverage (Transmitter Site) is 'Lucena'? | CREATE TABLE table_8145 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power (kW)" text,
"Station Type" text,
"Coverage (Transmitter site)" text
) | SELECT "Power (kW)" FROM table_8145 WHERE "Coverage (Transmitter site)" = 'lucena' | Below are sql tables 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 Power (kW), when Coverage (Transmitter Site) is 'Lucena'? ### Input: CREATE TABLE table_8145 (
"Branding" text,
... |
find the number of patients with blood gas lab test category who were hospitalized for more than 7 days. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab."CATEGORY" = "Blood Gas" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of patients with blood gas lab test category who were hospitalized for more than 7 days. ### Input: CREATE T... |
what was the name of the drug patient 32755 got prescription for within 2 days after being diagnosed with bmi 33.0-33.9,adult in the last hospital visit? | 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 t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 32755 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bmi 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: what was the name of the drug patient 32755 got prescription for within 2 days after being diagnosed with bmi 33.0-33.9,adul... |
What is the average credit score for customers who have taken a loan? | CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABLE ... | SELECT AVG(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) | Below are sql tables 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 credit score for customers who have taken a loan? ### Input: CREATE TABLE loan (
loan_id text,
l... |
what is patient 17944's maximum value of osmolality, urine since 80 months ago? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
h... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17944) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'osmolality, urine') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_T... | Below are sql tables 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 patient 17944's maximum value of osmolality, urine since 80 months ago? ### Input: CREATE TABLE diagnoses_icd (
... |
What was the date of the game when their record was 84-69? | CREATE TABLE table_name_56 (
date VARCHAR,
record VARCHAR
) | SELECT date FROM table_name_56 WHERE record = "84-69" | Below are sql tables 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 their record was 84-69? ### Input: CREATE TABLE table_name_56 (
date VARCHAR,
rec... |
For all employees who have the letters D or S in their first name, visualize the relationship between employee_id and department_id . | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | Below are sql tables 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, visualize the relationship between employee_id and depart... |
Name the sum of FA cup when league cup is less than 0 | CREATE TABLE table_15725 (
"Name" text,
"League" real,
"FA Cup" real,
"League Cup" real,
"Other" real,
"Total" real
) | SELECT SUM("FA Cup") FROM table_15725 WHERE "League Cup" < '0' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the sum of FA cup when league cup is less than 0 ### Input: CREATE TABLE table_15725 (
"Name" text,
"League" re... |
what is the number of patients whose days of hospital stay is greater than 6 and drug type is main? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "6" AND prescriptions.drug_type = "MAIN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose days of hospital stay is greater than 6 and drug type is main? ### Input: CREATE TABLE ... |
was there a microbiological test result during the last month for patient 61751's bile? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751) AND microbiologyevents.spec_type_desc = 'bile' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 mon... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: was there a microbiological test result during the last month for patient 61751's bile? ### Input: CREATE TABLE transfers (
... |
what is the semifinalists when the surface is hard (i)? | CREATE TABLE table_name_9 (
semifinalists VARCHAR,
surface VARCHAR
) | SELECT semifinalists FROM table_name_9 WHERE 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: what is the semifinalists when the surface is hard (i)? ### Input: CREATE TABLE table_name_9 (
semifinalists VARCHAR,
... |
What is the average base price of different bed type? List bed type and average base price Plot them as bar chart, I want to display by the bar from high to low. | CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType 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 is the average base price of different bed type? List bed type and average base price Plot them as bar chart, I want to... |
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there Plot them as bar chart, and could you sort total number in ascending order please? | CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
)
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
) | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country 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: What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there Plot them as ba... |
What is the Away team score when home's score is 10.16 (76)? | CREATE TABLE table_58073 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Away team score" FROM table_58073 WHERE "Home team score" = '10.16 (76)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Away team score when home's score is 10.16 (76)? ### Input: CREATE TABLE table_58073 (
"Home team" text,
... |
For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, list sum manager id in asc order. | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the sum of m... |
how many games did cal state fullerton 's baseball team play during april 1979 ? | CREATE TABLE table_204_418 (
id number,
"date" text,
"opponent" text,
"score" text,
"overall record" text,
"scba record" text
) | SELECT COUNT(*) FROM table_204_418 | Below are sql tables 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 cal state fullerton 's baseball team play during april 1979 ? ### Input: CREATE TABLE table_204_418 (
... |
What was the attendance when the VFL played Arden Street Oval? | CREATE TABLE table_name_50 (
crowd VARCHAR,
venue VARCHAR
) | SELECT COUNT(crowd) FROM table_name_50 WHERE venue = "arden street oval" | Below are sql tables 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 attendance when the VFL played Arden Street Oval? ### Input: CREATE TABLE table_name_50 (
crowd VARCHAR,
... |
Tell me the lowest 2005 for 2010 less than 21 for 2009 being 19 | CREATE TABLE table_56912 (
"Year" text,
"2010" real,
"2009" real,
"2008" real,
"2005" real,
"2000" real
) | SELECT MIN("2005") FROM table_56912 WHERE "2009" = '19' AND "2010" < '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: Tell me the lowest 2005 for 2010 less than 21 for 2009 being 19 ### Input: CREATE TABLE table_56912 (
"Year" text,
"... |
give me the number of patients whose ethnicity is american indian/alaska native and diagnoses icd9 code is 51881? | 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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "51881" | Below are sql tables 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 ethnicity is american indian/alaska native and diagnoses icd9 code is 51881? ### Input:... |
What is the Result of the game against Philadelphia Eagles? | CREATE TABLE table_66399 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT "Result" FROM table_66399 WHERE "Opponent" = 'philadelphia eagles' | Below are sql tables 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 Result of the game against Philadelphia Eagles? ### Input: CREATE TABLE table_66399 (
"Week" real,
"Date... |
What are the facility codes of the apartments with more than four bedrooms, and count them by a bar chart, sort in asc by the Y. | CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartment_Facilities (
apt_id I... | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_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: What are the facility codes of the apartments with more than four bedrooms, and count them by a bar chart, sort in asc by th... |
give the number of patients whose admission location is clinic referral/premature and procedure long title is central venous catheter placement with guidance. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.long_title = "Central venous catheter placement with guidance" | Below are sql tables 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 number of patients whose admission location is clinic referral/premature and procedure long title is central venous... |
what time patient 13536 had last had the maximum arterial bp [systolic] value until 05/09/2105? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_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 cost (
row_id number,
... | 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 = 13536)) 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: what time patient 13536 had last had the maximum arterial bp [systolic] value until 05/09/2105? ### Input: CREATE TABLE labe... |
what is the maximum age of male patients above 49? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.age >= "49" | Below are sql tables 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 maximum age of male patients above 49? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text... |
When spvgg vohenstrau is the oberpfalz what is the season? | CREATE TABLE table_25737 (
"Season" text,
"Oberbayern A" text,
"Oberbayern B" text,
"Niederbayern" text,
"Schwaben" text,
"Oberpfalz" text
) | SELECT "Season" FROM table_25737 WHERE "Oberpfalz" = 'SpVgg Vohenstrauß' | Below are sql tables 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 spvgg vohenstrau is the oberpfalz what is the season? ### Input: CREATE TABLE table_25737 (
"Season" text,
"Obe... |
what are the five most commonly performed procedures for patients who were previously diagnosed with heparin-indu thrombocyto within 2 months, in 2104? | CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admissi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most commonly performed procedures for patients who were previously diagnosed with heparin-indu thrombocyt... |
What was the position of Frank Tripp? | CREATE TABLE table_56084 (
"Character" text,
"Position" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Episodes Credited" real
) | SELECT "Position" FROM table_56084 WHERE "Character" = 'frank tripp' | Below are sql tables 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 position of Frank Tripp? ### Input: CREATE TABLE table_56084 (
"Character" text,
"Position" text,
"... |
Bar graph to show the total number from different team, and could you show in ascending by the y-axis please? | 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 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: Bar graph to show the total number from different team, and could you show in ascending by the y-axis please? ### Input: CRE... |
Which Region has an area of 14,037km ? | CREATE TABLE table_55117 (
"Region" text,
"Capital" text,
"Area (km\u00b2)" text,
"Area (sq. mi.)" text,
"Population" text,
"GDP ( bn )" text
) | SELECT "Region" FROM table_55117 WHERE "Area (km\u00b2)" = '14,037' | Below are sql tables 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 Region has an area of 14,037km ? ### Input: CREATE TABLE table_55117 (
"Region" text,
"Capital" text,
"Are... |
calculate the number of medications that patient 002-75209 has been prescribed in 10/last year. | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-75209')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIM... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: calculate the number of medications that patient 002-75209 has been prescribed in 10/last year. ### Input: CREATE TABLE vita... |
what was the name of the output patient 002-58943 first had until 257 days ago. | CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT 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 = '002-58943')) AND intakeoutput.cellpath LIKE '%output%' AND D... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the output patient 002-58943 first had until 257 days ago. ### Input: CREATE TABLE diagnosis (
diag... |
What is the lowest Silver in the Total Sport has less than 1 Gold and more than 1 Bronze? | CREATE TABLE table_name_77 (
silver INTEGER,
gold VARCHAR,
bronze VARCHAR,
sport VARCHAR
) | SELECT MIN(silver) FROM table_name_77 WHERE bronze > 1 AND sport = "total" AND gold < 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 lowest Silver in the Total Sport has less than 1 Gold and more than 1 Bronze? ### Input: CREATE TABLE table_name... |
what's the name of the procedure that patient 42757 was given two or more times in 11/2102? | CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | 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 = 427... | Below are sql tables 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 name of the procedure that patient 42757 was given two or more times in 11/2102? ### Input: CREATE TABLE icustays... |
What medal did Michael Conlon, with a weight of fly, win? | CREATE TABLE table_36407 (
"Order" text,
"Year" real,
"Olympic Games" text,
"Medal" text,
"Weight" text,
"Boxer" text,
"Club" text
) | SELECT "Medal" FROM table_36407 WHERE "Weight" = 'fly' AND "Boxer" = 'michael conlon' | Below are sql tables 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 medal did Michael Conlon, with a weight of fly, win? ### Input: CREATE TABLE table_36407 (
"Order" text,
"Year"... |
What the date of the game of the team that plays in princes park? | CREATE TABLE table_name_25 (
date VARCHAR,
venue VARCHAR
) | SELECT date FROM table_name_25 WHERE venue = "princes park" | Below are sql tables 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 the date of the game of the team that plays in princes park? ### Input: CREATE TABLE table_name_25 (
date VARCHAR,
... |
tell me the sum of patient 032-21820's input during the previous day. | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | 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 = '032-21820')) AND intakeoutput.cellpath LIKE '%in... | Below are sql tables 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 sum of patient 032-21820's input during the previous day. ### Input: CREATE TABLE lab (
labid number,
pa... |
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id. | 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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the... |
What is the lowest student GPA for every department? Return a bar chart, show in asc by the y axis. | CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE STUDENT (
STU_NUM int,
... | SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY MIN(STU_GPA) | Below are sql tables 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 student GPA for every department? Return a bar chart, show in asc by the y axis. ### Input: CREATE TABLE ... |
find out the number of patients less than 79 years who have been diagnosed with wheelchair dependence. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "79" AND diagnoses.short_title = "Wheelchair dependence" | Below are sql tables 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 out the number of patients less than 79 years who have been diagnosed with wheelchair dependence. ### Input: CREATE TAB... |
until 959 days ago had patient 005-12192 had any intake of ffp? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-12192')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutpu... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 959 days ago had patient 005-12192 had any intake of ffp? ### Input: CREATE TABLE allergy (
allergyid number,
... |
tell me the number of elective hospital admission patients who have stemi primary disease. | 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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "STEMI" | Below are sql tables 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 number of elective hospital admission patients who have stemi primary disease. ### Input: CREATE TABLE prescript... |
What date was the game when away team northampton town played? | CREATE TABLE table_60694 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | SELECT "Date" FROM table_60694 WHERE "Away team" = 'northampton town' | Below are sql tables 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 date was the game when away team northampton town played? ### Input: CREATE TABLE table_60694 (
"Tie no" text,
... |
What is the country with a 68-73-69=210 score? | CREATE TABLE table_10054 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "Country" FROM table_10054 WHERE "Score" = '68-73-69=210' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the country with a 68-73-69=210 score? ### Input: CREATE TABLE table_10054 (
"Place" text,
"Player" text,
... |
what is the five most frequent drugs that were prescribed in the same hospital visit during this year to the patients of age 40s after having been diagnosed with atrial fibrillation. | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrilla... | Below are sql tables 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 five most frequent drugs that were prescribed in the same hospital visit during this year to the patients of age... |
give me the flights for AA from PHILADELPHIA to DALLAS | CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE days (
days_code varchar,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD... | Below are sql tables 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 flights for AA from PHILADELPHIA to DALLAS ### Input: CREATE TABLE date_day (
month_number int,
day_numb... |
Which engine has a year larger than 1956? | CREATE TABLE table_70780 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | SELECT "Engine" FROM table_70780 WHERE "Year" > '1956' | Below are sql tables 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 engine has a year larger than 1956? ### Input: CREATE TABLE table_70780 (
"Year" real,
"Entrant" text,
"Ch... |
what was the last drug patient 60347 was prescribed via im in the first hospital visit? | CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60347 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.route = 'im' ORDER BY prescriptions.startdate 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 was the last drug patient 60347 was prescribed via im in the first hospital visit? ### Input: CREATE TABLE d_icd_diagno... |
how much is the total hospital bill for patient 027-165214 during their stay on the current hospital encounter? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214' AND patient.hospitaldischargetime IS NULL) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much is the total hospital bill for patient 027-165214 during their stay on the current hospital encounter? ### Input: C... |
in this year, how many patients were prescribed vitamin a? | 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 COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'vitamin a' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 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: in this year, how many patients were prescribed vitamin a? ### Input: CREATE TABLE labevents (
row_id number,
subjec... |
how many patients admitted under emergency admission type are of hispanic/latino - puertorican ethnicity? | 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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | Below are sql tables 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 admitted under emergency admission type are of hispanic/latino - puertorican ethnicity? ### Input: CREATE ... |
Show all role codes and the number of employees in each role. | CREATE TABLE roles (
role_code text,
role_name text,
role_description text
)
CREATE TABLE all_documents (
document_id number,
date_stored time,
document_type_code text,
document_name text,
document_description text,
other_details text
)
CREATE TABLE ref_calendar (
calendar_date... | SELECT role_code, COUNT(*) FROM employees GROUP BY role_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 all role codes and the number of employees in each role. ### Input: CREATE TABLE roles (
role_code text,
role_n... |
What is the highest value for Byes, when Against is less than 1794, when Losses is '6', and when Draws is less than 0? | CREATE TABLE table_name_61 (
byes INTEGER,
draws VARCHAR,
against VARCHAR,
losses VARCHAR
) | SELECT MAX(byes) FROM table_name_61 WHERE against < 1794 AND losses = 6 AND draws < 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 value for Byes, when Against is less than 1794, when Losses is '6', and when Draws is less than 0? ### I... |
What is the total of the crowd when the home team is footscray? | CREATE TABLE table_name_60 (
crowd VARCHAR,
home_team VARCHAR
) | SELECT COUNT(crowd) FROM table_name_60 WHERE home_team = "footscray" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total of the crowd when the home team is footscray? ### Input: CREATE TABLE table_name_60 (
crowd VARCHAR,
... |
What Country scored 72-65-73=210? | CREATE TABLE table_name_2 (
country VARCHAR,
score VARCHAR
) | SELECT country FROM table_name_2 WHERE score = 72 - 65 - 73 = 210 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Country scored 72-65-73=210? ### Input: CREATE TABLE table_name_2 (
country VARCHAR,
score VARCHAR
) ### Respon... |
What is the total number of Round, when College/Junior/Club Team (League) is 'Kelowna Rockets ( WHL )'? | CREATE TABLE table_49846 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | SELECT COUNT("Round") FROM table_49846 WHERE "College/Junior/Club Team (League)" = 'kelowna rockets ( whl )' | Below are sql tables 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 Round, when College/Junior/Club Team (League) is 'Kelowna Rockets ( WHL )'? ### Input: CREATE TA... |
What is the winning score for the B.C. Open 1 tournament? | CREATE TABLE table_name_40 (
winning_score VARCHAR,
tournament VARCHAR
) | SELECT winning_score FROM table_name_40 WHERE tournament = "b.c. open 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 winning score for the B.C. Open 1 tournament? ### Input: CREATE TABLE table_name_40 (
winning_score VARCHAR,... |
Name the total number of points for beta team march 1975 and chassis of march 751 | CREATE TABLE table_15127 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | SELECT COUNT("Points") FROM table_15127 WHERE "Entrant" = 'beta team march' AND "Year" = '1975' AND "Chassis" = 'march 751' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the total number of points for beta team march 1975 and chassis of march 751 ### Input: CREATE TABLE table_15127 (
... |
what are the three most commonly prescribed drugs since 2105 for patients who had serum transfusion nec before during the same month? | 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_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | Below are sql tables 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 three most commonly prescribed drugs since 2105 for patients who had serum transfusion nec before during the sa... |
What is the sum number of year when Call of Duty 4: Modern Warfare was the game? | CREATE TABLE table_64966 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | SELECT COUNT("Year") FROM table_64966 WHERE "Game" = 'call of duty 4: modern warfare' | Below are sql tables 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 sum number of year when Call of Duty 4: Modern Warfare was the game? ### Input: CREATE TABLE table_64966 (
"... |
how many patients admitted urgently are on main drug type prescription? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug_type = "MAIN" | Below are sql tables 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 admitted urgently are on main drug type prescription? ### Input: CREATE TABLE demographic (
subject_id... |
Which tyres has more than 5 laps with team nissan motorsports international? | CREATE TABLE table_53840 (
"Year" real,
"Class" text,
"Tyres" text,
"Team" text,
"Co-Drivers" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | SELECT "Tyres" FROM table_53840 WHERE "Laps" > '5' AND "Team" = 'nissan motorsports international' | Below are sql tables 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 tyres has more than 5 laps with team nissan motorsports international? ### Input: CREATE TABLE table_53840 (
"Year... |
provide the number of patients whose admission location is phys referral/normal deli and drug code is baci15o? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.formulary_drug_cd = "BACI15O" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission location is phys referral/normal deli and drug code is baci15o? ### Input: CR... |
tell me what the top three most common specimen tests were this year? | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t... | Below are sql tables 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 what the top three most common specimen tests were this year? ### Input: CREATE TABLE chartevents (
row_id numbe... |
In what language is the Lyrics of the release on August 10, 2005 with Catalog number of TOCP-66427? | CREATE TABLE table_name_48 (
lyrics VARCHAR,
date VARCHAR,
catalog_number VARCHAR
) | SELECT lyrics FROM table_name_48 WHERE date = "august 10, 2005" AND catalog_number = "tocp-66427" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what language is the Lyrics of the release on August 10, 2005 with Catalog number of TOCP-66427? ### Input: CREATE TABLE ... |
When was the game played at Princes Park? | CREATE TABLE table_53626 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_53626 WHERE "Venue" = 'princes park' | Below are sql tables 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 game played at Princes Park? ### Input: CREATE TABLE table_53626 (
"Home team" text,
"Home team score" ... |
what's the total passengers with freight (metric tonnes) being 827 | CREATE TABLE table_19025 (
"Rank" real,
"Airport" text,
"Total Passengers" real,
"% Change 2005/2006" text,
"International Passengers" real,
"Domestic Passengers" real,
"Transit Passengers" real,
"Aircraft Movements" real,
"Freight (Metric Tonnes)" real
) | SELECT "Total Passengers" FROM table_19025 WHERE "Freight (Metric Tonnes)" = '827' | Below are sql tables 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 passengers with freight (metric tonnes) being 827 ### Input: CREATE TABLE table_19025 (
"Rank" real,
... |
When hale irwin is the winner what is the margin of victory? | CREATE TABLE table_2417741_1 (
margin_of_victory VARCHAR,
winner VARCHAR
) | SELECT margin_of_victory FROM table_2417741_1 WHERE winner = "Hale Irwin" | Below are sql tables 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 hale irwin is the winner what is the margin of victory? ### Input: CREATE TABLE table_2417741_1 (
margin_of_victory... |
has there been since 09/2104 any organism found in patient 025-44495's first sputum, tracheal specimen microbiology test? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND STRFTI... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has there been since 09/2104 any organism found in patient 025-44495's first sputum, tracheal specimen microbiology test? ##... |
give me the number of patients whose diagnoses short title is dysthymic disorder and lab test fluid is ascites? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Dysthymic disorder" AND lab.fluid = "Ascites" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose diagnoses short title is dysthymic disorder and lab test fluid is ascites? ### Input: C... |
what is the yearly average of patient 016-26867's weight until 24 months ago? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-26867') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-24 month') GROUP BY STRFTIME... | Below are sql tables 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 yearly average of patient 016-26867's weight until 24 months ago? ### Input: CREATE TABLE intakeoutput (
int... |
where can we find some restaurants on bethel island rd in bethel island ? | CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_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: where can we find some restaurants on bethel island rd in bethel island ? ### Input: CREATE TABLE restaurant (
id int,
... |
What opponnent has a record of 82-68? | CREATE TABLE table_75161 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | SELECT "Opponent" FROM table_75161 WHERE "Record" = '82-68' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What opponnent has a record of 82-68? ### Input: CREATE TABLE table_75161 (
"Date" text,
"Opponent" text,
"Score... |
list flights from PHILADELPHIA to SAN FRANCISCO via DALLAS | CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list flights from PHILADELPHIA to SAN FRANCISCO via DALLAS ### Input: CREATE TABLE flight (
aircraft_code_sequence text,... |
Display a bar chart for what is total number of show times per dat for each cinema?, and show show times per day in asc order please. | CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY SUM(T1.Show_times_per_day) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Display a bar chart for what is total number of show times per dat for each cinema?, and show show times per day in asc orde... |
Show the average salary by each hire date of employees, and please bin the hire date into the day of week interval for showing a bar chart, could you display Y from low to high order please? | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | SELECT HIRE_DATE, AVG(SALARY) FROM employees 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: Show the average salary by each hire date of employees, and please bin the hire date into the day of week interval for showi... |
Return the number of music festivals of each category, show by the Category in desc. | CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Ar... | SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY Category DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the number of music festivals of each category, show by the Category in desc. ### Input: CREATE TABLE music_festival ... |
What are my score in subjects taught by Prof. Sundararaghavan ? | CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | SELECT DISTINCT student_record.grade FROM student_record INNER JOIN offering_instructor ON student_record.offering_id = offering_instructor.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE LOWER(instructor.name) LIKE '%Sundararaghavan%' AND student_record.student_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: What are my score in subjects taught by Prof. Sundararaghavan ? ### Input: CREATE TABLE ta (
campus_job_id int,
stud... |
how many european baseball championship gold medals does italy need in order to have the same total amount of any type of medal as netherlands ? | CREATE TABLE table_204_107 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | SELECT (SELECT "gold" FROM table_204_107 WHERE "nation" = 'netherlands') - (SELECT "gold" FROM table_204_107 WHERE "nation" = 'italy') | Below are sql tables 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 european baseball championship gold medals does italy need in order to have the same total amount of any type of me... |
Which opponent played on July 15? | CREATE TABLE table_name_3 (
opponent VARCHAR,
date VARCHAR
) | SELECT opponent FROM table_name_3 WHERE date = "july 15" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which opponent played on July 15? ### Input: CREATE TABLE table_name_3 (
opponent VARCHAR,
date VARCHAR
) ### Respon... |
For all employees who have the letters D or S in their first name, give me the trend about manager_id over hire_date , display in descending by the x-axis. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' 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 all employees who have the letters D or S in their first name, give me the trend about manager_id over hire_date , displ... |
what are the four most commonly given procedures for patients who have an age 30s? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most commonly given procedures for patients who have an age 30s? ### Input: CREATE TABLE transfers (
r... |
What CD has a catalog # of PCR 502? | CREATE TABLE table_70557 (
"Catalog #" text,
"Title" text,
"Year" text,
"Composer" text,
"Released" real
) | SELECT "Title" FROM table_70557 WHERE "Catalog #" = 'pcr 502' | Below are sql tables 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 CD has a catalog # of PCR 502? ### Input: CREATE TABLE table_70557 (
"Catalog #" text,
"Title" text,
"Year"... |
For those employees who was hired before 2002-06-21, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, and I want to order JOB_ID in asc order. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, find job_id and the sum of employee_id , and group by attribute job_id,... |
What's the least amount of laps that George Eaton completed that has a time/retired engine and a grid larger than 8? | CREATE TABLE table_10651 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT MIN("Laps") FROM table_10651 WHERE "Time/Retired" = 'engine' AND "Grid" > '8' AND "Driver" = 'george eaton' | Below are sql tables 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 least amount of laps that George Eaton completed that has a time/retired engine and a grid larger than 8? ### Inp... |
Which Gold has a Total of 721? | CREATE TABLE table_name_18 (
gold INTEGER,
total VARCHAR
) | SELECT AVG(gold) FROM table_name_18 WHERE total = 721 | Below are sql tables 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 Gold has a Total of 721? ### Input: CREATE TABLE table_name_18 (
gold INTEGER,
total VARCHAR
) ### Response: S... |
what was the total quantity of output from patient 9964 on the first icu visit? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9964) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the total quantity of output from patient 9964 on the first icu visit? ### Input: CREATE TABLE d_labitems (
row... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.