instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
What number is Andrea Bargnani? | CREATE TABLE table_17890 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
) | SELECT MAX("No") FROM table_17890 WHERE "Player" = 'Andrea Bargnani' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What number is Andrea Bargnani? ### Input: CREATE TABLE table_17890 (
"No" real,
"Player" text,
"Height" text,
... |
has patient 016-26884 been prescribed any medication since 2100? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-26884')) AND STRFTIME('%y', medication.drugstarttime) >= '2100' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 016-26884 been prescribed any medication since 2100? ### Input: CREATE TABLE lab (
labid number,
patient... |
how many days has passed since patient 30826 was admitted into the hospital? | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime 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 many days has passed since patient 30826 was admitted into the hospital? ### Input: CREATE TABLE microbiologyevents (
... |
what 's the lowest round trip fare from ATLANTA to BWI | 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 code_description (
code varchar,
description text
)
CREATE TABLE month (
... | SELECT DISTINCT fare.fare_id FROM airport, airport_service, city, fare, flight, flight_fare WHERE airport.airport_code = 'BWI' AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND fare.round_trip_cost = (SELECT MIN(FAREalias1.round_trip_cost) FROM airport AS AIRPORTalias1, airport_service 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: what 's the lowest round trip fare from ATLANTA to BWI ### Input: CREATE TABLE restriction (
restriction_code text,
... |
Find the first names of professors who are not playing Canoeing or Kayaking. | CREATE TABLE faculty (
lname VARCHAR,
rank VARCHAR
)
CREATE TABLE Faculty (
lname VARCHAR,
facID VARCHAR
)
CREATE TABLE activity (
activity_name VARCHAR
)
CREATE TABLE Faculty_participates_in (
facID VARCHAR,
actid VARCHAR
) | SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' | Below are sql tables 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 first names of professors who are not playing Canoeing or Kayaking. ### Input: CREATE TABLE faculty (
lname VAR... |
Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, and could you rank by the x axis in asc? | CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numer... | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_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: Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, and c... |
Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, and order x-axis in ascending order. | CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality,... |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and manufacturer , and group by attribute headquarter, order in ascending by the Y-axis please. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Manufacturer | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name an... |
Name the number of year for dick hutcherson | CREATE TABLE table_2696 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | SELECT COUNT("Year") FROM table_2696 WHERE "Driver" = 'Dick Hutcherson' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of year for dick hutcherson ### Input: CREATE TABLE table_2696 (
"Year" real,
"Date" text,
"Driv... |
what are the three most commonly ordered procedures for patients who had previously received antidepressant within the same month, in 2104? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antidepressant' AND STRFTIME('%y', treat... | Below are sql tables 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 ordered procedures for patients who had previously received antidepressant within the same ... |
Show the number of documents for different budget type code in a bar chart. | CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Ac... | SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.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: Show the number of documents for different budget type code in a bar chart. ### Input: CREATE TABLE Documents (
Document... |
What is the Record of the game on September 6? | CREATE TABLE table_76533 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
) | SELECT "Record" FROM table_76533 WHERE "Date" = 'september 6' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Record of the game on September 6? ### Input: CREATE TABLE table_76533 (
"Date" text,
"Opponent" text,
... |
how much bag is prescribed to patient 9338 in total until 07/2104? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9338) AND prescriptions.drug = 'bag' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-07' | Below are sql tables 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 bag is prescribed to patient 9338 in total until 07/2104? ### Input: CREATE TABLE d_labitems (
row_id number,
... |
what were the top three most frequent diagnosis that patients received within the same month after they were diagnosed with bacteremia during a year before? | 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 inputevents_cv (
row_id number,
subject_id number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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 = admissions... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the top three most frequent diagnosis that patients received within the same month after they were diagnosed with ... |
Draw a bar chart for how many captains with younger than 50 are in each rank?, sort by the X from low to high. | CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY Rank | Below are sql tables 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 for how many captains with younger than 50 are in each rank?, sort by the X from low to high. ### Input: CR... |
what is date of birth of subject id 2560? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.dob FROM demographic WHERE demographic.subject_id = "2560" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is date of birth of subject id 2560? ### Input: CREATE TABLE demographic (
subject_id text,
hadm_id text,
n... |
what is the three most common laboratory test ordered until 2103 for patients of age 40s? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', lab.labresulttime) <= '2103' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the three most common laboratory test ordered until 2103 for patients of age 40s? ### Input: CREATE TABLE treatment ... |
What is the lowest number of laps for kyle petty with under 118 points? | CREATE TABLE table_name_99 (
laps INTEGER,
points VARCHAR,
driver VARCHAR
) | SELECT MIN(laps) FROM table_name_99 WHERE points < 118 AND driver = "kyle petty" | Below are sql tables 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 number of laps for kyle petty with under 118 points? ### Input: CREATE TABLE table_name_99 (
laps INT... |
Who was the opponent when Devin Gardner was the player? | CREATE TABLE table_26108103_2 (
opponent VARCHAR,
player VARCHAR
) | SELECT opponent FROM table_26108103_2 WHERE player = "Devin Gardner" | Below are sql tables 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 opponent when Devin Gardner was the player? ### Input: CREATE TABLE table_26108103_2 (
opponent VARCHAR,
... |
how many patients are with death status 0 and with diagnosis chronic diastolic heart failure? | 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 WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Chronic diastolic 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 patients are with death status 0 and with diagnosis chronic diastolic heart failure? ### Input: CREATE TABLE prescr... |
Return a bar chart on how many patients do each physician take care of? List their names and number of patients they take care of, order by the Y-axis in ascending. | CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Affiliated_W... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID 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: Return a bar chart on how many patients do each physician take care of? List their names and number of patients they take ca... |
had the heartrate of patient 009-11591 been less on 10/10/2105 than 88.0? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-11591')) AND vitalperiodic.heartrate < 88.0 AND NOT vitalperiodi... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had the heartrate of patient 009-11591 been less on 10/10/2105 than 88.0? ### Input: CREATE TABLE microlab (
microlabid ... |
calculate the total number of patients who had icd9 code 3950 | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "3950" | Below are sql tables 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 total number of patients who had icd9 code 3950 ### Input: CREATE TABLE procedures (
subject_id text,
... |
i'd like a ticket on a plane from DENVER to ATLANTA i would like a COACH class or lowest fare ticket | CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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 ... | 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, fare_basis, flight, flight_fare WHERE ((fare_basis.class_type = 'COACH' AND fare.fare_basis_code = fare_basis.fare_basis_code) OR fare.one_direction_cost = (SELECT MIN(FARE... | Below are sql tables 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 like a ticket on a plane from DENVER to ATLANTA i would like a COACH class or lowest fare ticket ### Input: CREATE TABLE... |
Count the number of medicaid patients who have pneumonia as their primary disease. | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "PNEUMONIA" | Below are sql tables 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 medicaid patients who have pneumonia as their primary disease. ### Input: CREATE TABLE demographic (
... |
how long did they produce singles ? | CREATE TABLE table_203_629 (
id number,
"year" number,
"title" text,
"lead vocalist" text,
"aria chart position" number,
"album" text
) | SELECT MAX("year") - MIN("year") FROM table_203_629 | Below are sql tables 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 long did they produce singles ? ### Input: CREATE TABLE table_203_629 (
id number,
"year" number,
"title" te... |
For those records from the products and each product's manufacturer, find name and the sum of code , and group by attribute name, and visualize them by a bar chart, and show total number of code from high to low order. | CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code 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, find name and the sum of code , and group by attribute ... |
what time was patient 035-13344 prescribed a drug for the last time until 27 months ago? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-13344')) AND DATETIME(medication.drugstarttime) <= 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: what time was patient 035-13344 prescribed a drug for the last time until 27 months ago? ### Input: CREATE TABLE cost (
... |
Find login_name and gender_mf , and visualize them by a bar chart. | CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_des... | SELECT login_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_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: Find login_name and gender_mf , and visualize them by a bar chart. ### Input: CREATE TABLE Student_Course_Enrolment (
re... |
How many different products correspond to each order id. Plot them as scatter chart. | CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),
login_name VARCHAR(80),
login_password VARCHAR(20),
phone_number VARCHAR(255),
town_ci... | SELECT order_id, COUNT(DISTINCT product_id) FROM Order_Items | Below are sql tables 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 different products correspond to each order id. Plot them as scatter chart. ### Input: CREATE TABLE Customers (
... |
show me all FIRST class fares from NEW YORK to MIAMI leaving on a TUESDAY | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... | 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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.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: show me all FIRST class fares from NEW YORK to MIAMI leaving on a TUESDAY ### Input: CREATE TABLE month (
month_number i... |
What is the market value of every comapny in the banking industry ordered by sales and profits? Return a bar chart. | CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Pr... | SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion | Below are sql tables 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 market value of every comapny in the banking industry ordered by sales and profits? Return a bar chart. ### Inpu... |
I want to know the proportion for each team. | CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: I want to know the proportion for each team. ### Input: CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID ... |
What is the country of the player whose score is 71-69-70-69=279? | CREATE TABLE table_name_21 (
country VARCHAR,
score VARCHAR
) | SELECT country FROM table_name_21 WHERE score = 71 - 69 - 70 - 69 = 279 | Below are sql tables 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 of the player whose score is 71-69-70-69=279? ### Input: CREATE TABLE table_name_21 (
country VARCHA... |
What was the attendance when VFL played MCG? | CREATE TABLE table_32306 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT MAX("Crowd") FROM table_32306 WHERE "Venue" = 'mcg' | Below are sql tables 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 VFL played MCG? ### Input: CREATE TABLE table_32306 (
"Home team" text,
"Home team scor... |
Visualize a bar chart that bin the open date into a day of the week interval and count them, and list in ascending by the total number please. | CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of t... | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY COUNT(Open_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: Visualize a bar chart that bin the open date into a day of the week interval and count them, and list in ascending by the to... |
provide the number of patients with the diagnoses of tricuspid valve disorders, specified as nonrheumtatic who have sc route of drug administration. | 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 = "Nonrheum tricusp val dis" AND prescriptions.route = "SC" | Below are sql tables 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 with the diagnoses of tricuspid valve disorders, specified as nonrheumtatic who have sc route... |
What is the sum of the weeks that games occured on october 21, 1974 and less than 50,623 fans attended? | CREATE TABLE table_39695 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
) | SELECT SUM("Week") FROM table_39695 WHERE "Date" = 'october 21, 1974' AND "Attendance" < '50,623' | Below are sql tables 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 of the weeks that games occured on october 21, 1974 and less than 50,623 fans attended? ### Input: CREATE TA... |
what is admission location and discharge time of subject id 52118? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.admission_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "52118" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is admission location and discharge time of subject id 52118? ### Input: CREATE TABLE lab (
subject_id text,
ha... |
what flights are there available from PHILADELPHIA to DENVER on wednesday with economy class | CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE time_interval (
period text,
begin_time in... | 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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((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: what flights are there available from PHILADELPHIA to DENVER on wednesday with economy class ### Input: CREATE TABLE days (
... |
How many figures are given for the New Democratic for the polling range May 11 31, 2010? | CREATE TABLE table_24778847_2 (
new_democratic VARCHAR,
date_of_polling VARCHAR
) | SELECT COUNT(new_democratic) FROM table_24778847_2 WHERE date_of_polling = "May 11–31, 2010" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many figures are given for the New Democratic for the polling range May 11 31, 2010? ### Input: CREATE TABLE table_24778... |
What is the name of every city that has at least 15 stations and how many stations does it have. Show the proportion. | 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 city, COUNT(*) FROM station GROUP BY 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 is the name of every city that has at least 15 stations and how many stations does it have. Show the proportion. ### In... |
what are the costs of pseudomonal pneumonia diagnosis? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pseudomonal pneumonia')) | Below are sql tables 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 costs of pseudomonal pneumonia diagnosis? ### Input: CREATE TABLE outputevents (
row_id number,
subject... |
What shows for 2005 when 2002 shows 0 1? | CREATE TABLE table_45217 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text
) | SELECT "2005" FROM table_45217 WHERE "2002" = '0–1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What shows for 2005 when 2002 shows 0 1? ### Input: CREATE TABLE table_45217 (
"Tournament" text,
"2002" text,
"... |
Player than won in 2003? | CREATE TABLE table_name_94 (
player VARCHAR,
year_s__won VARCHAR
) | SELECT player FROM table_name_94 WHERE year_s__won = "2003" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Player than won in 2003? ### Input: CREATE TABLE table_name_94 (
player VARCHAR,
year_s__won VARCHAR
) ### Response:... |
what exactly was the name of the drug that patient 61591 was prescribed during the same hospital visit after receiving a aortocor bypas-1 cor art procedure in 05/2105? | 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 d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABL... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 61591 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what exactly was the name of the drug that patient 61591 was prescribed during the same hospital visit after receiving a aor... |
Name the week for kingdome | CREATE TABLE table_14520977_1 (
week VARCHAR,
location VARCHAR
) | SELECT week FROM table_14520977_1 WHERE location = "Kingdome" | Below are sql tables 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 week for kingdome ### Input: CREATE TABLE table_14520977_1 (
week VARCHAR,
location VARCHAR
) ### Response:... |
Return a histogram on how old is the average person for each job?, and could you list by the y axis in desc please? | CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on how old is the average person for each job?, and could you list by the y axis in desc please? ### Inpu... |
Can you tell me of any upper level elective classes offered before noon ? | CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Can you tell me of any upper level elective classes offered before noon ? ### Input: CREATE TABLE course_tags_count (
co... |
Who was second when Martynas Norkus was the skip? | CREATE TABLE table_name_86 (
second VARCHAR,
skip VARCHAR
) | SELECT second FROM table_name_86 WHERE skip = "martynas norkus" | Below are sql tables 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 second when Martynas Norkus was the skip? ### Input: CREATE TABLE table_name_86 (
second VARCHAR,
skip VARCH... |
show me the airlines between BOSTON and TORONTO | CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar... | 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 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_na... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the airlines between BOSTON and TORONTO ### Input: CREATE TABLE date_day (
month_number int,
day_number int,... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and display by the total number from low to high. | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
If the Home team is carlton, what's the lowest Crowd found? | CREATE TABLE table_55058 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT MIN("Crowd") FROM table_55058 WHERE "Home team" = 'carlton' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the Home team is carlton, what's the lowest Crowd found? ### Input: CREATE TABLE table_55058 (
"Home team" text,
... |
what are the five most frequent drugs that were prescribed to hemorrhage - related to anticoagulation male patients of 30s within 2 months after they have been diagnosed with hemorrhage - related to anticoagulation since 2104? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperio... | 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 = 'hemorrhage - related to anticoagulation' AND STRFT... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the five most frequent drugs that were prescribed to hemorrhage - related to anticoagulation male patients of 30s w... |
What are the dates that have an average sea level pressure between 303 and 31, and count them by a line chart, order in desc by the date. | CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
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_... | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY 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: What are the dates that have an average sea level pressure between 303 and 31, and count them by a line chart, order in desc... |
Who is the player from La Costa Canyon High School? | CREATE TABLE table_54588 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | SELECT "Player" FROM table_54588 WHERE "School" = 'la costa canyon high school' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the player from La Costa Canyon High School? ### Input: CREATE TABLE table_54588 (
"Player" text,
"Height" te... |
When goals against is greater than 60 and losses less than 29, what is the highest played? | CREATE TABLE table_14453 (
"Position" real,
"Club" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Points" real,
"Goal Difference" real
) | SELECT MAX("Played") FROM table_14453 WHERE "Goals against" > '60' AND "Losses" < '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: When goals against is greater than 60 and losses less than 29, what is the highest played? ### Input: CREATE TABLE table_144... |
when did patient 006-40255 last have the maximum amount of phosphate since 136 months ago? | 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 microlab (
microlabid number,
... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-40255')) AND lab.labname = 'phosphate' AND DATETIME(lab.labresulttime) >= DATET... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did patient 006-40255 last have the maximum amount of phosphate since 136 months ago? ### Input: CREATE TABLE allergy (... |
What is the highest Week when the opponent was the los angeles rams, with more than 37,382 in Attendance? | CREATE TABLE table_76128 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | SELECT MAX("Week") FROM table_76128 WHERE "Opponent" = 'los angeles rams' AND "Attendance" > '37,382' | Below are sql tables 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 Week when the opponent was the los angeles rams, with more than 37,382 in Attendance? ### Input: CREATE ... |
systolic bp >= 170 mmhg | CREATE TABLE table_train_109 (
"id" int,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
) | SELECT * FROM table_train_109 WHERE systolic_blood_pressure_sbp >= 170 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: systolic bp >= 170 mmhg ### Input: CREATE TABLE table_train_109 (
"id" int,
"serum_potassium" float,
"systolic_b... |
What is the hebrew word listed for strongs # 5418? | CREATE TABLE table_1242447_2 (
hebrew_word VARCHAR,
strongs__number VARCHAR
) | SELECT hebrew_word FROM table_1242447_2 WHERE strongs__number = "5418" | Below are sql tables 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 hebrew word listed for strongs # 5418? ### Input: CREATE TABLE table_1242447_2 (
hebrew_word VARCHAR,
st... |
Give me a histogram for how old is each gender, on average?, rank in asc by the x-axis. | CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a histogram for how old is each gender, on average?, rank in asc by the x-axis. ### Input: CREATE TABLE PersonFriend... |
how many private health insurance patients have procedure icd9 code 12? | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "12" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many private health insurance patients have procedure icd9 code 12? ### Input: CREATE TABLE diagnoses (
subject_id t... |
tell me the minimum total hospital cost that includes hydroxyzine hcl until 3 years ago? | CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
r... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'hydroxyzine hcl') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY cost.hadm_id) AS t1 | Below are sql tables 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 minimum total hospital cost that includes hydroxyzine hcl until 3 years ago? ### Input: CREATE TABLE outputevent... |
what is the number of patients whose admission type is emergency and diagnoses long title is automatic implantable cardiac defibrillator in situ? | 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.admission_type = "EMERGENCY" AND diagnoses.long_title = "Automatic implantable cardiac defibrillator in situ" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is emergency and diagnoses long title is automatic implantable cardiac d... |
okay i need to see economy flights on UA between DALLAS and BALTIMORE | CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_... | 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, fare, fare_basis, flight, flight_fare 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_cod... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: okay i need to see economy flights on UA between DALLAS and BALTIMORE ### Input: CREATE TABLE fare_basis (
fare_basis_co... |
for patient id 21796, specify the type of admission. | 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 demographic.admission_type FROM demographic WHERE demographic.subject_id = "21796" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: for patient id 21796, specify the type of admission. ### Input: CREATE TABLE procedures (
subject_id text,
hadm_id t... |
what are the three diagnoses with the lowest three year survival rate? | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | Below are sql tables 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 diagnoses with the lowest three year survival rate? ### Input: CREATE TABLE transfers (
row_id number... |
let me know both the long title and short title of diagnoses for patient with diagnoses icd9 code 4271. | 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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "4271" | Below are sql tables 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 both the long title and short title of diagnoses for patient with diagnoses icd9 code 4271. ### Input: CREATE TA... |
Return a bar chart about the distribution of ACC_Regular_Season and ACC_Percent , order in asc by the ACC_Regular_Season. | 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 ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart about the distribution of ACC_Regular_Season and ACC_Percent , order in asc by the ACC_Regular_Season. ##... |
how many male patients have 3799 as the procedure icd9 code? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "3799" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many male patients have 3799 as the procedure icd9 code? ### Input: CREATE TABLE demographic (
subject_id text,
... |
when was the last time on the last intensive care unit visit patient 29161's respiratory rate was less than 12.0? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_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 = 29161) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid... | Below are sql tables 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 last time on the last intensive care unit visit patient 29161's respiratory rate was less than 12.0? ### Input:... |
What district first elected a Democratic incumbent in 1998? | CREATE TABLE table_72954 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | SELECT "District" FROM table_72954 WHERE "Party" = 'Democratic' AND "First elected" = '1998' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What district first elected a Democratic incumbent in 1998? ### Input: CREATE TABLE table_72954 (
"District" text,
"... |
is there a flight between OAKLAND and BOSTON with a stopover in DALLAS FORT WORTH on TW | CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE restriction ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_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: is there a flight between OAKLAND and BOSTON with a stopover in DALLAS FORT WORTH on TW ### Input: CREATE TABLE flight_stop ... |
What won the Best Female Artist if People's Male MC won the Best Female Lyricist? | CREATE TABLE table_2639 (
"Best Male MC" text,
"Best Female MC" text,
"Best Male Artist" text,
"Best Female Artist" text,
"Best Male Lyricist" text,
"Best Female Lyricist" text,
"Best Male Record" text
) | SELECT "Best Female Artist" FROM table_2639 WHERE "Best Female Lyricist" = 'People''s Male MC' | Below are sql tables 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 won the Best Female Artist if People's Male MC won the Best Female Lyricist? ### Input: CREATE TABLE table_2639 (
"... |
provide the number of patients whose discharge location is left against medical advi and procedure short title is cardiac rhythm conv nec? | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.short_title = "Cardiac rhythm conv NEC" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose discharge location is left against medical advi and procedure short title is cardiac rh... |
Who is teaching MICRBIOL 320 in the Spring ? | CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city var... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is teaching MICRBIOL 320 in the Spring ? ### Input: CREATE TABLE comment_instructor (
instructor_id int,
student... |
What status has 18 as the against? | CREATE TABLE table_59709 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text,
"Report" text
) | SELECT "Status" FROM table_59709 WHERE "Against" = '18' | Below are sql tables 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 status has 18 as the against? ### Input: CREATE TABLE table_59709 (
"Opposing Team" text,
"Against" real,
"... |
I want the sum of drawn for lost less than 0 | CREATE TABLE table_name_81 (
drawn INTEGER,
lost INTEGER
) | SELECT SUM(drawn) FROM table_name_81 WHERE lost < 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: I want the sum of drawn for lost less than 0 ### Input: CREATE TABLE table_name_81 (
drawn INTEGER,
lost INTEGER
) #... |
is the AA flight 813 from BOSTON to OAKLAND a flight that goes straight through from BOSTON to OAKLAND without stopping at another city | CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
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,
... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.flight_number = 813 AND flight.to_airport = AIRPORT_SERVICE_1.airpo... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the AA flight 813 from BOSTON to OAKLAND a flight that goes straight through from BOSTON to OAKLAND without stopping at a... |
Which week did the Seattle Seahawks have a record of 6-6? | CREATE TABLE table_15780 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | SELECT AVG("Week") FROM table_15780 WHERE "Record" = '6-6' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which week did the Seattle Seahawks have a record of 6-6? ### Input: CREATE TABLE table_15780 (
"Week" real,
"Date" ... |
Name the most events with cuts made more than 6 and top 25 more than 30 | CREATE TABLE table_35858 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | SELECT MAX("Events") FROM table_35858 WHERE "Cuts made" > '6' AND "Top-25" > '30' | Below are sql tables 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 most events with cuts made more than 6 and top 25 more than 30 ### Input: CREATE TABLE table_35858 (
"Tournamen... |
What is the to par for Gene Littler? | CREATE TABLE table_15242 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "To par" FROM table_15242 WHERE "Player" = 'gene littler' | Below are sql tables 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 to par for Gene Littler? ### Input: CREATE TABLE table_15242 (
"Place" text,
"Player" text,
"Country... |
how many counties have larger areas than kilifi ? | CREATE TABLE table_204_778 (
id number,
"code" number,
"county" text,
"former province" text,
"area (km2)" number,
"population\ncensus 2009" number,
"capital" text
) | SELECT COUNT("county") FROM table_204_778 WHERE "area (km2)" > (SELECT "area (km2)" FROM table_204_778 WHERE "county" = 'kilifi') | Below are sql tables 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 counties have larger areas than kilifi ? ### Input: CREATE TABLE table_204_778 (
id number,
"code" number,
... |
how many days has it been since the last time patient 95892 stayed during the current hospital encounter in the careunit tsicu? | CREATE TABLE d_icd_procedures (
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 TABL... | SELECT 1 * (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 = 95892 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime 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: how many days has it been since the last time patient 95892 stayed during the current hospital encounter in the careunit tsi... |
what are the three most common procedures for a patient who was diagnosed with osteomyelitis nos-pelvis previously within the same hospital visit? | CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | 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, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_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 the three most common procedures for a patient who was diagnosed with osteomyelitis nos-pelvis previously within th... |
Which site has the CERCLIS ID fld004092532? | CREATE TABLE table_11971 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Partially deleted" text,
"Deleted" text
) | SELECT "Name" FROM table_11971 WHERE "CERCLIS ID" = 'fld004092532' | Below are sql tables 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 site has the CERCLIS ID fld004092532? ### Input: CREATE TABLE table_11971 (
"CERCLIS ID" text,
"Name" text,
... |
what is the total number of patients who had sternal wound infection and lab test for blood gas? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "STERNAL WOUND INFECTION" 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: what is the total number of patients who had sternal wound infection and lab test for blood gas? ### Input: CREATE TABLE dem... |
When did the episode with season number 10b air for the first time? | CREATE TABLE table_907 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Storyboarded by" text,
"Original air date" text,
"Production code" text
) | SELECT "Original air date" FROM table_907 WHERE "No. in season" = '10b' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the episode with season number 10b air for the first time? ### Input: CREATE TABLE table_907 (
"No. in series" ... |
Where was the game played when the home team scored 16.19 (115)? | CREATE TABLE table_51952 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_51952 WHERE "Home team score" = '16.19 (115)' | Below are sql tables 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 played when the home team scored 16.19 (115)? ### Input: CREATE TABLE table_51952 (
"Home team" text,... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the first_name , list MANAGER_ID in desc order. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 varch... | SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a... |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the job_id , order in desc by the y-axis please. | CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison a... |
Show the number of professors who is in office DRE 102 hired in each weekday with a bar chart, I want to rank from high to low by the Y-axis. | 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,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
... | SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' GROUP BY EMP_LNAME ORDER BY COUNT(EMP_HIREDATE) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of professors who is in office DRE 102 hired in each weekday with a bar chart, I want to rank from high to l... |
find the number of players whose points are lower than 30 in each position. | CREATE TABLE player (
POSITION VARCHAR,
points INTEGER
) | SELECT COUNT(*), POSITION FROM player WHERE points < 30 GROUP BY POSITION | Below are sql tables 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 players whose points are lower than 30 in each position. ### Input: CREATE TABLE player (
POSITION VA... |
what is diagnoses long title of subject id 21796? | 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 diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "21796" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is diagnoses long title of subject id 21796? ### Input: CREATE TABLE diagnoses (
subject_id text,
hadm_id text,... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the change of manager_id over hire_date in a line chart, and show from high to low by the x-axis. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
Name the total number of rank for percentage change yoy 13.1% | CREATE TABLE table_30153 (
"State Rank" real,
"National Rank" real,
"Institution" text,
"Location" text,
"Public or Private" text,
"Endowment Funds" text,
"Percentage Change YOY" text
) | SELECT COUNT("National Rank") FROM table_30153 WHERE "Percentage Change YOY" = '13.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: Name the total number of rank for percentage change yoy 13.1% ### Input: CREATE TABLE table_30153 (
"State Rank" real,
... |
how many patients whose gender is f and diagnoses long title is acute diastolic heart failure? | 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 WHERE demographic.gender = "F" AND diagnoses.long_title = "Acute diastolic 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 patients whose gender is f and diagnoses long title is acute diastolic heart failure? ### Input: CREATE TABLE lab (... |
What is Venue, when Result is '0-0'? | CREATE TABLE table_9303 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | SELECT "Venue" FROM table_9303 WHERE "Result" = '0-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 Venue, when Result is '0-0'? ### Input: CREATE TABLE table_9303 (
"Date" text,
"Opponent" text,
"Venue" ... |
Please tell the revenues of the companies with the highest revenues in each headquarter city. | 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, MAX(Revenue) FROM Manufacturers 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: Please tell the revenues of the companies with the highest revenues in each headquarter city. ### Input: CREATE TABLE Manufa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.