instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Top 10 Users From India. | CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id num... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE Reputation >= 20 AND (LOWER(Location) LIKE '%INDIA%' OR LOWER(Location) LIKE '%india%') ORDER BY Reputation LIMIT 100 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 10 Users From India. ### Input: CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TA... |
Name the high rebounds for record 10-19 | CREATE TABLE table_2821 (
"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_2821 WHERE "Record" = '10-19' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the high rebounds for record 10-19 ### Input: CREATE TABLE table_2821 (
"Game" real,
"Date" text,
"Team" te... |
i want to fly from BOSTON to ATLANTA i would like the cheapest fare please | CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varcha... | 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: i want to fly from BOSTON to ATLANTA i would like the cheapest fare please ### Input: CREATE TABLE date_day (
month_numb... |
what flights are available friday afternoon from PITTSBURGH to SAN FRANCISCO | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | 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 = 'SAN FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number = ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights are available friday afternoon from PITTSBURGH to SAN FRANCISCO ### Input: CREATE TABLE flight_fare (
fligh... |
indicate the yearly average amount of temperature c (calc) for patient 1912 since 116 months ago. | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1912)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tempe... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the yearly average amount of temperature c (calc) for patient 1912 since 116 months ago. ### Input: CREATE TABLE ch... |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of email and manager_id , display X in desc order please. | CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the di... |
Show different type codes of products and the number of products with each type code. | CREATE TABLE Parties (
Party_ID INTEGER,
Party_Details VARCHAR(255)
)
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Code CHAR(15),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4)
)
CREATE TABLE Locations (
Location_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABL... | SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_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 different type codes of products and the number of products with each type code. ### Input: CREATE TABLE Parties (
... |
How hard is an average Core class ? | CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREAT... | SELECT AVG(workload) FROM program_course WHERE category LIKE '%Core%' | Below are sql tables 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 hard is an average Core class ? ### Input: CREATE TABLE offering_instructor (
offering_instructor_id int,
offeri... |
Which Red Cards has a Season of 1998/1999, and a Games larger than 41? | CREATE TABLE table_44063 (
"Season" text,
"Games" real,
"Yellow Cards" real,
"Red Cards" real,
"Average Cards a game" real
) | SELECT MIN("Red Cards") FROM table_44063 WHERE "Season" = '1998/1999' AND "Games" > '41' | Below are sql tables 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 Red Cards has a Season of 1998/1999, and a Games larger than 41? ### Input: CREATE TABLE table_44063 (
"Season" te... |
What game showed a home team score of 8.11 (59)? | CREATE TABLE table_77597 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Date" FROM table_77597 WHERE "Home team score" = '8.11 (59)' | Below are sql tables 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 game showed a home team score of 8.11 (59)? ### Input: CREATE TABLE table_77597 (
"Home team" text,
"Home team ... |
What is the average number of laps with 16 grids? | CREATE TABLE table_name_54 (
laps INTEGER,
grid VARCHAR
) | SELECT AVG(laps) FROM table_name_54 WHERE grid = 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 the average number of laps with 16 grids? ### Input: CREATE TABLE table_name_54 (
laps INTEGER,
grid VARCHAR... |
What is the highest crowd with north melbourne as away team? | CREATE TABLE table_name_10 (
crowd INTEGER,
away_team VARCHAR
) | SELECT MAX(crowd) FROM table_name_10 WHERE away_team = "north 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 the highest crowd with north melbourne as away team? ### Input: CREATE TABLE table_name_10 (
crowd INTEGER,
... |
how many hours has it passed since the first time that patient 51858 stayed in careunit micu on this hospital visit? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.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: how many hours has it passed since the first time that patient 51858 stayed in careunit micu on this hospital visit? ### Inp... |
A bar chart listing the number of faults for different description of skills required to fix them, and sort in asc by the y axis. | CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_ty... | SELECT skill_description, COUNT(skill_description) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description ORDER BY COUNT(skill_description) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart listing the number of faults for different description of skills required to fix them, and sort in asc by the y ... |
what's the total amount of output patient 021-148847 had? | 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 SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-148847')) AND intakeoutput.cellpath LIKE '%o... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's the total amount of output patient 021-148847 had? ### Input: CREATE TABLE vitalperiodic (
vitalperiodicid number... |
What is the average attendance for matches where the home team was vida? | CREATE TABLE table_name_2 (
attendance INTEGER,
home VARCHAR
) | SELECT AVG(attendance) FROM table_name_2 WHERE home = "vida" | Below are sql tables 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 attendance for matches where the home team was vida? ### Input: CREATE TABLE table_name_2 (
attendan... |
For those employees who did not have any job in the past, visualize a scatter chart about the correlation between commission_pct and manager_id . | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | Below are sql tables 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 scatter chart about the correlation between commission... |
Which grid is lower for thierry boutsen which laps less than 44? | CREATE TABLE table_name_90 (
grid INTEGER,
driver VARCHAR,
laps VARCHAR
) | SELECT MIN(grid) FROM table_name_90 WHERE driver = "thierry boutsen" AND laps < 44 | Below are sql tables 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 grid is lower for thierry boutsen which laps less than 44? ### Input: CREATE TABLE table_name_90 (
grid INTEGER,
... |
i'd also like to see a list of the flights from PITTSBURGH to ATLANTA | CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt ... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATL... | Below are sql tables 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'd also like to see a list of the flights from PITTSBURGH to ATLANTA ### Input: CREATE TABLE dual_carrier (
main_airlin... |
Where did Richmond play as the away team? | CREATE TABLE table_53872 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_53872 WHERE "Away team" = 'richmond' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where did Richmond play as the away team? ### Input: CREATE TABLE table_53872 (
"Home team" text,
"Home team score" ... |
What is the lowest events that have 17 as the cuts made, with a top-25 less than 8? | CREATE TABLE table_name_14 (
events INTEGER,
cuts_made VARCHAR,
top_25 VARCHAR
) | SELECT MIN(events) FROM table_name_14 WHERE cuts_made = 17 AND top_25 < 8 | Below are sql tables 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 events that have 17 as the cuts made, with a top-25 less than 8? ### Input: CREATE TABLE table_name_14 (
... |
Visualize the number of grape of the wines whose price is bigger than 100 with a bar chart, ordered the x-axis by year. | CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | SELECT Grape, COUNT(Grape) FROM wine WHERE Price > 100 GROUP BY Grape ORDER BY 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: Visualize the number of grape of the wines whose price is bigger than 100 with a bar chart, ordered the x-axis by year. ### ... |
Find the number of male students (with sex M) from each city in a bar chart. | CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
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 INTEG... | SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' 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: Find the number of male students (with sex M) from each city in a bar chart. ### Input: CREATE TABLE Lives_in (
stuid IN... |
Visualize a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home. | CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home. ###... |
let me know the lab test item id of patient stephanie suchan. | 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 demographic (
subject_id text,
hadm_id t... | SELECT lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan" | Below are sql tables 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 lab test item id of patient stephanie suchan. ### Input: CREATE TABLE procedures (
subject_id text,
... |
What award did they win before 2005? | CREATE TABLE table_66102 (
"Year" real,
"Organization" text,
"Award" text,
"Work" text,
"Result" text
) | SELECT "Award" FROM table_66102 WHERE "Year" < '2005' | Below are sql tables 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 award did they win before 2005? ### Input: CREATE TABLE table_66102 (
"Year" real,
"Organization" text,
"Aw... |
A bar chart for giveing me the number of the dates when the max temperature was higher than 85, and could you list y axis in ascending order please? | CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) | Below are sql tables 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 giveing me the number of the dates when the max temperature was higher than 85, and could you list y axis in... |
what is the name of the prescription drug patient 009-5351 was prescribed within 2 days after being diagnosed with copd in 06/this year? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5351') AND diagnosis.diagnosi... | Below are sql tables 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 name of the prescription drug patient 009-5351 was prescribed within 2 days after being diagnosed with copd in 0... |
Who was the home team at Princes Park? | CREATE TABLE table_57353 (
"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_57353 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: Who was the home team at Princes Park? ### Input: CREATE TABLE table_57353 (
"Home team" text,
"Home team score" tex... |
Show the total salary by each hire date of employees, and please bin the hire date into the day of week interval for showing a bar chart, and I want to show by the y-axis in descending please. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the total salary by each hire date of employees, and please bin the hire date into the day of week interval for showing... |
is the bicarbonate level of patient 016-20141 second measured on the last hospital visit less than first measured on the last hospital visit? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodici... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-20141' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the bicarbonate level of patient 016-20141 second measured on the last hospital visit less than first measured on the las... |
What CD has a catalog # of PCR 502? | CREATE TABLE table_name_12 (
title VARCHAR,
catalog__number VARCHAR
) | SELECT title FROM table_name_12 WHERE catalog__number = "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_name_12 (
title VARCHAR,
catalog__number VARCHAR
)... |
count the number of times on this month/21 patient 71558 has produced cerebral drain r ventricular drain. | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT COUNT(*) 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 = 71558)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cerebral drain r v... | Below are sql tables 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 times on this month/21 patient 71558 has produced cerebral drain r ventricular drain. ### Input: CREATE ... |
how many patients on elective admission were divorcee? | 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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "ELECTIVE" | Below are sql tables 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 on elective admission were divorcee? ### Input: CREATE TABLE prescriptions (
subject_id text,
hadm... |
when is the first time that patient 12927 has had a arterial bp [systolic] measured yesterday? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | 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 = 12927)) 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 is the first time that patient 12927 has had a arterial bp [systolic] measured yesterday? ### Input: CREATE TABLE micro... |
Who were the opponents during week 14? | CREATE TABLE table_6524 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT "Opponent" FROM table_6524 WHERE "Week" = '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: Who were the opponents during week 14? ### Input: CREATE TABLE table_6524 (
"Week" real,
"Date" text,
"Opponent"... |
A bar chart for what are the number of the descriptions for the aircrafts? | CREATE TABLE airport_aircraft (
ID int,
Airport_ID int,
Aircraft_ID int
)
CREATE TABLE match (
Round real,
Location text,
Country text,
Date text,
Fastest_Qualifying text,
Winning_Pilot text,
Winning_Aircraft text
)
CREATE TABLE airport (
Airport_ID int,
Airport_Name te... | SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the descriptions for the aircrafts? ### Input: CREATE TABLE airport_aircraft (
ID... |
what were the five most frequent drugs prescribed within the same month to the patients aged 60 or above after they had been diagnosed with hepatic dysfunction - chronic,? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatic dysfunction - chronic') AS t1 JOIN (SELECT... | Below are sql tables 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 were the five most frequent drugs prescribed within the same month to the patients aged 60 or above after they had been... |
Return a pie on what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor? | CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
) | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a pie on what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each inves... |
show me flights to SAN FRANCISCO arriving before 100 | CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name ... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO' AND flight.arrival_time < 100 AND flight.to_airport = airport_service.airport_code | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me flights to SAN FRANCISCO arriving before 100 ### Input: CREATE TABLE fare (
fare_id int,
from_airport varcha... |
what 's the earliest flight from BOSTON to BWI that serves LUNCH | CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREA... | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight, food_service WHERE ((airport.airport_code = 'BWI' AND flight.to_airport = airport.airport_code AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'LUNCH') AND city.city_code = airport_service.city_code AND 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 's the earliest flight from BOSTON to BWI that serves LUNCH ### Input: CREATE TABLE airport_service (
city_code var... |
When spvgg vohenstrau is the oberpfalz what is the season? | CREATE TABLE table_23224961_1 (
season VARCHAR,
oberpfalz VARCHAR
) | SELECT season FROM table_23224961_1 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_23224961_1 (
season VARCHAR,
... |
what was the name of the intake, patient 15447 first had on the current icu visit? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 15447) AND icustays.outtime IS NULL)... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the intake, patient 15447 first had on the current icu visit? ### Input: CREATE TABLE cost (
row_id... |
please give me round trip fares from PITTSBURGH to PHILADELPHIA | CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | 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 = 'PITTSBURGH' 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: please give me round trip fares from PITTSBURGH to PHILADELPHIA ### Input: CREATE TABLE time_zone (
time_zone_code text,... |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of code , and group by attribute founder, rank names in desc order. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder 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, draw a bar chart about the distribution of founder and ... |
what is the maximum value of heart rate of patient 10855 on 12/27/this year? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icust... | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear... | Below are sql tables 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 value of heart rate of patient 10855 on 12/27/this year? ### Input: CREATE TABLE labevents (
row_id ... |
What is the magnitude with epicenter at Vrancea County, unknown intensity and which happened at 06:36? | CREATE TABLE table_79127 (
"Date" text,
"Time (UTC)" text,
"Epicenter" text,
"Magnitude" text,
"Depth" text,
"Intensity" text
) | SELECT "Magnitude" FROM table_79127 WHERE "Epicenter" = 'vrancea county' AND "Intensity" = 'unknown' AND "Time (UTC)" = '06:36' | Below are sql tables 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 magnitude with epicenter at Vrancea County, unknown intensity and which happened at 06:36? ### Input: CREATE TAB... |
provide the number of patients whose primary disease is abdominal abscess and year of death is less than or equal to 2112? | 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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND demographic.dod_year <= "2112.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: provide the number of patients whose primary disease is abdominal abscess and year of death is less than or equal to 2112? #... |
For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the headquarter , and group by attribute headquarter. | 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 Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | Below are sql tables 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, give me the comparison about the average of revenue ove... |
count the number of patients who received packed cell transfusion procedure during the same month after having received cont inv mec ven 96+ hrs procedure until 2100. | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | SELECT COUNT(DISTINCT t1.subject_id) 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 WHERE d_icd_procedures.short_title = 'cont inv me... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients who received packed cell transfusion procedure during the same month after having received cont... |
provide the number of patients whose admission location is clinic referral/premature and were born before the year 2114. | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2114" | Below are sql tables 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 clinic referral/premature and were born before the year 2114. ###... |
What is the newest season? | CREATE TABLE table_2140071_7 (
season INTEGER
) | SELECT MAX(season) FROM table_2140071_7 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the newest season? ### Input: CREATE TABLE table_2140071_7 (
season INTEGER
) ### Response: SELECT MAX(season) F... |
What is the version shown for the Length of 4:58? | CREATE TABLE table_75019 (
"Version" text,
"Length" text,
"Album" text,
"Remixed by" text,
"Year" real
) | SELECT "Version" FROM table_75019 WHERE "Length" = '4:58' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the version shown for the Length of 4:58? ### Input: CREATE TABLE table_75019 (
"Version" text,
"Length" tex... |
What are the different budget type codes, and how many documents are there for each? | CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE r... | SELECT budget_type_code, COUNT(*) FROM documents_with_expenses GROUP BY budget_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: What are the different budget type codes, and how many documents are there for each? ### Input: CREATE TABLE accounts (
... |
what was the date of the first game played ? | CREATE TABLE table_204_197 (
id number,
"date" text,
"time" text,
"opponent#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | SELECT "date" FROM table_204_197 ORDER BY "date" 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 date of the first game played ? ### Input: CREATE TABLE table_204_197 (
id number,
"date" text,
"ti... |
Draw a bar chart about the distribution of All_Road and Team_ID . | CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Road, Team_ID FROM basketball_match | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of All_Road and Team_ID . ### Input: CREATE TABLE university (
School_ID int,
... |
what was the total output patient 016-13544 had received on 01/20/last year? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | 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 = '016-13544')) AND intakeoutput.cellpath LIKE '%ou... | Below are sql tables 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 output patient 016-13544 had received on 01/20/last year? ### Input: CREATE TABLE intakeoutput (
inta... |
what flights does DL have between BOSTON and SAN FRANCISCO | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights does DL have between BOSTON and SAN FRANCISCO ### Input: CREATE TABLE flight_fare (
flight_id int,
fare... |
What Country's content is Televendite? | CREATE TABLE table_name_32 (
country VARCHAR,
content VARCHAR
) | SELECT country FROM table_name_32 WHERE content = "televendite" | Below are sql tables 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's content is Televendite? ### Input: CREATE TABLE table_name_32 (
country VARCHAR,
content VARCHAR
) ##... |
Name the least series number with production code of 717 and season number less than 17 | CREATE TABLE table_53533 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Original air date" text,
"Production code" real
) | SELECT MIN("Series #") FROM table_53533 WHERE "Production code" = '717' AND "Season #" < '17' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least series number with production code of 717 and season number less than 17 ### Input: CREATE TABLE table_53533 ... |
give me the number of patients whose death status is 0 and procedure icd9 code is 4513? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "4513" | Below are sql tables 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 death status is 0 and procedure icd9 code is 4513? ### Input: CREATE TABLE lab (
su... |
What Class to 1928 has the Quantity smaller than 440 and Seats of 29/29? | CREATE TABLE table_13347 (
"Class to 1928" text,
"Class from 1928" text,
"Seats" text,
"Quantity" real,
"Year(s) of Manufacture" text
) | SELECT "Class to 1928" FROM table_13347 WHERE "Quantity" < '440' AND "Seats" = '29/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 Class to 1928 has the Quantity smaller than 440 and Seats of 29/29? ### Input: CREATE TABLE table_13347 (
"Class to... |
How many votes did Kerry get in the county that gave Bush 189,605 votes? | CREATE TABLE table_49640 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real,
"2000 result" text
) | SELECT AVG("Kerry#") FROM table_49640 WHERE "Bush#" = '189,605' | Below are sql tables 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 votes did Kerry get in the county that gave Bush 189,605 votes? ### Input: CREATE TABLE table_49640 (
"County" ... |
Which Lost is the highest one that has a Drawn smaller than 4, and a Played smaller than 9? | CREATE TABLE table_74877 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | SELECT MAX("Lost") FROM table_74877 WHERE "Drawn" < '4' AND "Played" < '9' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Lost is the highest one that has a Drawn smaller than 4, and a Played smaller than 9? ### Input: CREATE TABLE table_74... |
tell me the length of stay of patient 006-93519's first stay in the icu. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-93519') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime 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 length of stay of patient 006-93519's first stay in the icu. ### Input: CREATE TABLE cost (
costid number,
... |
how many female patients had the primary disease congestive heart failure? | 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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE" | Below are sql tables 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 female patients had the primary disease congestive heart failure? ### Input: CREATE TABLE procedures (
subject_... |
count the number of patients that received non-invasive mech vent procedure in the same hospital encounter after receiving a insert spinal canal cath procedure in 2104. | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
ro... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... | Below are sql tables 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 that received non-invasive mech vent procedure in the same hospital encounter after receiving a... |
specify the number of patients with regional enteritis nos who received iv therapy | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Regional enteritis NOS" AND prescriptions.route = "IV" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the number of patients with regional enteritis nos who received iv therapy ### Input: CREATE TABLE demographic (
... |
since 2104, has any urine, voided specimen microbiology test been carried out on patient 025-19271? | 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 COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y'... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 2104, has any urine, voided specimen microbiology test been carried out on patient 025-19271? ### Input: CREATE TABLE ... |
For those employees who do not work in departments with managers that have ids between 100 and 200, find first_name and commission_pct , and visualize them by a bar chart, list from high to low by the Y. | 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_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, find first_name and comm... |
During what years did athletes who attended school in Minnesota play for the Grizzlies? | CREATE TABLE table_20865 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | SELECT "Years for Grizzlies" FROM table_20865 WHERE "School/Club Team" = 'Minnesota' | Below are sql tables 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 what years did athletes who attended school in Minnesota play for the Grizzlies? ### Input: CREATE TABLE table_20865 ... |
Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart, and rank in ascending by the X-axis. | CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 ORDER BY Date | Below are sql tables 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 dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart, and rank i... |
What is the maximum population of the land with an area of 276.84 km2? | CREATE TABLE table_21284 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | SELECT MAX("Population") FROM table_21284 WHERE "Area km 2" = '276.84' | Below are sql tables 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 population of the land with an area of 276.84 km2? ### Input: CREATE TABLE table_21284 (
"Official N... |
Show the name of each party and the corresponding number of delegates from that party with a bar chart, and sort by the bar in asc. | CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party | Below are sql tables 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 name of each party and the corresponding number of delegates from that party with a bar chart, and sort by the bar ... |
In what year was Terry Johnson nominated for a Tony award? | CREATE TABLE table_11943 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | SELECT COUNT("Year") FROM table_11943 WHERE "Award" = 'tony award' AND "Nominee" = 'terry johnson' | Below are sql tables 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 year was Terry Johnson nominated for a Tony award? ### Input: CREATE TABLE table_11943 (
"Year" real,
"Award... |
Next semester who is teaching RCCORE 102 ? | CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Next semester who is teaching RCCORE 102 ? ### Input: CREATE TABLE jobs (
job_id int,
job_title varchar,
descrip... |
Which Bronze has a Total smaller than 1? | CREATE TABLE table_65776 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT AVG("Bronze") FROM table_65776 WHERE "Total" < '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Bronze has a Total smaller than 1? ### Input: CREATE TABLE table_65776 (
"Rank" real,
"Gold" real,
"Silver... |
show me a list of flights on AA from BOSTON to WASHINGTON on 7 22 | 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 fare_basis (
fare_basis_code text,
booking_class text,
class_type text,... | 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 = 'WASHINGTON' AND date_day.day_number = 22 AND date_day.month_number = 7 A... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me a list of flights on AA from BOSTON to WASHINGTON on 7 22 ### Input: CREATE TABLE restriction (
restriction_code... |
What television service has italian as the language, and sky famiglia as the package option? | CREATE TABLE table_39986 (
"Television service" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | SELECT "Television service" FROM table_39986 WHERE "Language" = 'italian' AND "Package/Option" = 'sky famiglia' | Below are sql tables 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 television service has italian as the language, and sky famiglia as the package option? ### Input: CREATE TABLE table_3... |
give me the number of patients whose diagnoses icd9 code is 44020 and lab test category is hematology? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "44020" AND lab."CATEGORY" = "Hematology" | Below are sql tables 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 icd9 code is 44020 and lab test category is hematology? ### Input: CREATE TAB... |
Where was the game held when the attendance was 56,770? | CREATE TABLE table_15782 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | SELECT "Game site" FROM table_15782 WHERE "Attendance" = '56,770' | Below are sql tables 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 was the game held when the attendance was 56,770? ### Input: CREATE TABLE table_15782 (
"Week" real,
"Date" te... |
What is the rank of the qual 141.471? | CREATE TABLE table_71921 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | SELECT "Rank" FROM table_71921 WHERE "Qual" = '141.471' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the rank of the qual 141.471? ### Input: CREATE TABLE table_71921 (
"Year" text,
"Start" text,
"Qual" te... |
What is the lowest rank when Jianshu is smaller than 9.66, for Richard Devine ( gbr ), with a total smaller than 19.02? | CREATE TABLE table_name_25 (
rank INTEGER,
total VARCHAR,
jianshu VARCHAR,
athlete VARCHAR
) | SELECT MIN(rank) FROM table_name_25 WHERE jianshu < 9.66 AND athlete = "richard devine ( gbr )" AND total < 19.02 | Below are sql tables 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 rank when Jianshu is smaller than 9.66, for Richard Devine ( gbr ), with a total smaller than 19.02? ### ... |
so whats the first weight of patient 033-32465 during the first hospital encounter? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-32465' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY p... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: so whats the first weight of patient 033-32465 during the first hospital encounter? ### Input: CREATE TABLE vitalperiodic (
... |
count the number of patients whose diagnoses short title is ventricular fibrillation and drug route is replace? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ventricular fibrillation" AND prescriptions.route = "REPLACE" | Below are sql tables 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 diagnoses short title is ventricular fibrillation and drug route is replace? ### Input: C... |
What was Collingwood's score when they played against North Melbourne at home? | CREATE TABLE table_name_12 (
home_team VARCHAR,
away_team VARCHAR
) | SELECT home_team AS score FROM table_name_12 WHERE away_team = "north 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 was Collingwood's score when they played against North Melbourne at home? ### Input: CREATE TABLE table_name_12 (
h... |
what is the first value of the sodium lab test of patient 006-14121 since 12/2105? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-14121')) AND lab.labname = 'sodium' AND STRFTIME('%y-%m', lab.labresulttime) >= '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: what is the first value of the sodium lab test of patient 006-14121 since 12/2105? ### Input: CREATE TABLE medication (
... |
how many times was the metoclopramide prescribed in this month for patient 42829? | CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42829) AND prescriptions.drug = 'metoclopramide' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | Below are sql tables 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 was the metoclopramide prescribed in this month for patient 42829? ### Input: CREATE TABLE cost (
row_id ... |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, and I want to list by the mean salary in asc. | 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 HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about... |
Who was the home team at the game held at Princes Park? | CREATE TABLE table_name_76 (
home_team VARCHAR,
venue VARCHAR
) | SELECT home_team FROM table_name_76 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: Who was the home team at the game held at Princes Park? ### Input: CREATE TABLE table_name_76 (
home_team VARCHAR,
v... |
What was the 2nd leg that had the Estudiantes La Plata home for the 2nd leg? | CREATE TABLE table_name_41 (
home__2nd_leg_ VARCHAR
) | SELECT 2 AS nd_leg FROM table_name_41 WHERE home__2nd_leg_ = "estudiantes la plata" | Below are sql tables 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 2nd leg that had the Estudiantes La Plata home for the 2nd leg? ### Input: CREATE TABLE table_name_41 (
hom... |
ground transportation in PHOENIX | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHOENIX' 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 PHOENIX ### Input: CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fa... |
What is the T score of the team with an E score of 6.625? | CREATE TABLE table_39234 (
"Nation" text,
"T Score" real,
"A Score" real,
"E Score" real,
"Total" real
) | SELECT "T Score" FROM table_39234 WHERE "E Score" = '6.625' | Below are sql tables 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 T score of the team with an E score of 6.625? ### Input: CREATE TABLE table_39234 (
"Nation" text,
"T Sc... |
What was the two-round score for Bob Tway? | CREATE TABLE table_69035 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "Score" FROM table_69035 WHERE "Player" = 'bob tway' | Below are sql tables 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 two-round score for Bob Tway? ### Input: CREATE TABLE table_69035 (
"Place" text,
"Player" text,
"C... |
i'm trying to make a connection between DENVER and SAN FRANCISCO does DL fly between those two | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight te... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'DL') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRP... | Below are sql tables 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'm trying to make a connection between DENVER and SAN FRANCISCO does DL fly between those two ### Input: CREATE TABLE fligh... |
For all employees who have the letters D or S in their first name, a line chart shows the trend of commission_pct over hire_date , and could you rank from low to high by the x-axis? | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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),
... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | Below are sql tables 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, a line chart shows the trend of commission_pct over hire_... |
provide the number of patients whose days of hospital stay is greater than 11 and drug name is chlorothiazide? | 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 > "11" AND prescriptions.drug = "Chlorothiazide" | Below are sql tables 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 days of hospital stay is greater than 11 and drug name is chlorothiazide? ### Input: CR... |
List all payment methods and number of payments using each payment methods. | CREATE TABLE Customer_Payments (
payment_method_code VARCHAR
) | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_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: List all payment methods and number of payments using each payment methods. ### Input: CREATE TABLE Customer_Payments (
... |
What team had less than 291 total points whole having 76 bronze and over 21 gold? | CREATE TABLE table_37924 (
"Rank" real,
"Province" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT SUM("Silver") FROM table_37924 WHERE "Gold" > '21' AND "Bronze" = '76' AND "Total" < '291' | Below are sql tables 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 team had less than 291 total points whole having 76 bronze and over 21 gold? ### Input: CREATE TABLE table_37924 (
... |
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. | CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | Below are sql tables 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 hire_date and the sum o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.