instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
provide the number of patients whose lab test abnormal status is abnormal and lab test name is wbc, joint fluid. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "WBC, Joint Fluid" | Below are sql tables 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 lab test abnormal status is abnormal and lab test name is wbc, joint fluid. ### Input: ... |
what is the top four prescription drugs among the patients with an age 50s in this year? | CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the top four prescription drugs among the patients with an age 50s in this year? ### Input: CREATE TABLE intakeoutpu... |
Top C++ users in Sweden. | CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top C++ users in Sweden. ### Input: CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
Di... |
Name the power output for model of s-13 | CREATE TABLE table_name_29 (
power_output VARCHAR,
model VARCHAR
) | SELECT power_output FROM table_name_29 WHERE model = "s-13" | Below are sql tables 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 power output for model of s-13 ### Input: CREATE TABLE table_name_29 (
power_output VARCHAR,
model VARCHAR
... |
What is the round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt? | CREATE TABLE table_62055 (
"Round" real,
"Race" text,
"Circuit" text,
"Date" text,
"Event" text,
"Winning driver" text
) | SELECT "Round" FROM table_62055 WHERE "Race" = 'int. adac-preis der tourenwagen von sachsen-anhalt' | Below are sql tables 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 round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt? ### Input: CREATE TABLE table_62055 (
"Rou... |
Show the names of countries and the average speed of roller coasters from each country with a bar chart, sort in asc by the bars. | CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
) | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name ORDER BY T1.Name | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the names of countries and the average speed of roller coasters from each country with a bar chart, sort in asc by the ... |
What is the highest population in the millions that has an influence of 1.02? | CREATE TABLE table_42956 (
"Member state" text,
"Population millions" real,
"MEPs" real,
"Inhabitants per MEP" real,
"Influence" real
) | SELECT MAX("Population millions") FROM table_42956 WHERE "Influence" = '1.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 highest population in the millions that has an influence of 1.02? ### Input: CREATE TABLE table_42956 (
"Mem... |
What is Score, when Opponent is Atlanta Hawks? | CREATE TABLE table_name_44 (
score VARCHAR,
opponent VARCHAR
) | SELECT score FROM table_name_44 WHERE opponent = "atlanta hawks" | Below are sql tables 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 Score, when Opponent is Atlanta Hawks? ### Input: CREATE TABLE table_name_44 (
score VARCHAR,
opponent VARCH... |
what cities does NW fly out of | CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,... | SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'NW' AND flight.from_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: what cities does NW fly out of ### Input: CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code v... |
Draw a bar chart about the distribution of meter_700 and ID , and I want to sort by the Y from low to high. | 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 meter_700, ID FROM swimmer ORDER BY ID | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of meter_700 and ID , and I want to sort by the Y from low to high. ### Input: CREAT... |
what is the number of patients whose insurance is government and lab test name is ammonia? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Ammonia" | Below are sql tables 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 insurance is government and lab test name is ammonia? ### Input: CREATE TABLE prescript... |
What is Prize, when Runner-Up is 'Simon Ehne', and when Winner is 'David Tighe'? | CREATE TABLE table_name_37 (
prize VARCHAR,
runner_up VARCHAR,
winner VARCHAR
) | SELECT prize FROM table_name_37 WHERE runner_up = "simon ehne" AND winner = "david tighe" | Below are sql tables 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 Prize, when Runner-Up is 'Simon Ehne', and when Winner is 'David Tighe'? ### Input: CREATE TABLE table_name_37 (
... |
i would like to get the top four diagnosis that has the highest three year mortality rate. | CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT d_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: i would like to get the top four diagnosis that has the highest three year mortality rate. ### Input: CREATE TABLE admission... |
retrieve the patient ids who are diagnosed with nonrupt cerebral aneurym since 2105. | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate ti... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_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 = 'nonrupt cerebral aneurym') AND STRFTIME('%y', diagnoses_icd.charttime) >= ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: retrieve the patient ids who are diagnosed with nonrupt cerebral aneurym since 2105. ### Input: CREATE TABLE d_icd_procedure... |
A bar chart for finding the number of the names of swimmers who has a result of 'win'. | CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY 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: A bar chart for finding the number of the names of swimmers who has a result of 'win'. ### Input: CREATE TABLE event (
I... |
How many top 10s associated with 3 top 5s and under 22 cuts made? | CREATE TABLE table_name_13 (
top_10 INTEGER,
top_5 VARCHAR,
cuts_made VARCHAR
) | SELECT MAX(top_10) FROM table_name_13 WHERE top_5 = 3 AND cuts_made < 22 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many top 10s associated with 3 top 5s and under 22 cuts made? ### Input: CREATE TABLE table_name_13 (
top_10 INTEGER... |
what is diagnoses short title and diagnoses long title of diagnoses icd9 code 1918? | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "1918" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is diagnoses short title and diagnoses long title of diagnoses icd9 code 1918? ### Input: CREATE TABLE demographic (
... |
Are there any software courses amongst the ones that I 've already done ? | CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
s... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%software%' AND student_record.student_id = 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: Are there any software courses amongst the ones that I 've already done ? ### Input: CREATE TABLE requirement (
requirem... |
What Number of households have a Median family income of $58,491? | CREATE TABLE table_62665 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
) | SELECT "Number of households" FROM table_62665 WHERE "Median family income" = '$58,491' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Number of households have a Median family income of $58,491? ### Input: CREATE TABLE table_62665 (
"County" text,
... |
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the sum of salary bin hire_date by time, order by the Y-axis from high to low. | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' 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: For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the sum of salary b... |
Show the number of faculty for each rank in a bar chart. | CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Faculty_Participates_in (
Fac... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP 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: Show the number of faculty for each rank in a bar chart. ### Input: CREATE TABLE Activity (
actid INTEGER,
activity_... |
What is the Total with 0 Silver and Gold, 1 Bronze and Rank larger than 2? | CREATE TABLE table_71433 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Total") FROM table_71433 WHERE "Rank" > '2' AND "Bronze" = '1' AND "Silver" > '0' AND "Gold" < '0' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Total with 0 Silver and Gold, 1 Bronze and Rank larger than 2? ### Input: CREATE TABLE table_71433 (
"Rank" ... |
what's patient 022-89058's length of stay in the first icu stay? | 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 STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058') 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: what's patient 022-89058's length of stay in the first icu stay? ### Input: CREATE TABLE intakeoutput (
intakeoutputid n... |
among patients tested for folate, how many of them were treated with base drug? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Folate" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among patients tested for folate, how many of them were treated with base drug? ### Input: CREATE TABLE demographic (
su... |
count the number of patients who were diagnosed with chronic respiratory failure and did not get back to the hospital within the same month in 2105. | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chronic respiratory failure' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (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: count the number of patients who were diagnosed with chronic respiratory failure and did not get back to the hospital within... |
give me the number of patients whose admission type is urgent and ethnicity is hispanic/latino - puerto rican? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission type is urgent and ethnicity is hispanic/latino - puerto rican? ### Input: CR... |
For those employees who did not have any job in the past, draw a line chart about the change of commission_pct over hire_date , display X-axis in asc order. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 jobs (
JOB_ID varchar(10),
JOB_TI... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) 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 those employees who did not have any job in the past, draw a line chart about the change of commission_pct over hire_dat... |
What country does Adam van Koeverden play for? | CREATE TABLE table_name_31 (
country VARCHAR,
athletes VARCHAR
) | SELECT country FROM table_name_31 WHERE athletes = "adam van koeverden" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What country does Adam van Koeverden play for? ### Input: CREATE TABLE table_name_31 (
country VARCHAR,
athletes VAR... |
Show different types of ships and the average tonnage of ships of each type. | CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
) | SELECT type, AVG(tonnage) FROM ship GROUP BY type | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show different types of ships and the average tonnage of ships of each type. ### Input: CREATE TABLE ship (
ship_id numb... |
Who constructed the car that has a Time/Retired of +2:06.0? | CREATE TABLE table_56489 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | SELECT "Constructor" FROM table_56489 WHERE "Time/Retired" = '+2:06.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: Who constructed the car that has a Time/Retired of +2:06.0? ### Input: CREATE TABLE table_56489 (
"Driver" text,
"Co... |
How many female patients are using the drug - epidural bag? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Epidural Bag" | Below are sql tables 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 are using the drug - epidural bag? ### Input: CREATE TABLE prescriptions (
subject_id text,
... |
What are the different ship flags, and how many ships have each Plot them as bar chart, and could you display bar from low to high order? | 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 Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY Flag | Below are sql tables 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 ship flags, and how many ships have each Plot them as bar chart, and could you display bar from low t... |
find the number of players whose points are lower than 30 in each position. | CREATE TABLE club_rank (
rank number,
club_id number,
gold number,
silver number,
bronze number,
total number
)
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
c... | 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 club_rank (
rank num... |
how many patients who stayed in hospital for more than 29 days had nu roue of drug administration? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "29" AND prescriptions.route = "NU" | Below are sql tables 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 who stayed in hospital for more than 29 days had nu roue of drug administration? ### Input: CREATE TABLE p... |
papers about object recognition | CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphr... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'object recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: papers about object recognition ### Input: CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE venue (
... |
Show the name of each party and the corresponding number of delegates from that party with a bar chart, I want to order in desc by the bars. | CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party 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 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 name of each party and the corresponding number of delegates from that party with a bar chart, I want to order in d... |
Find the total revenue for each manufacturer Plot them as bar chart, I want to list from low to high by the Y-axis. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue) | Below are sql tables 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 total revenue for each manufacturer Plot them as bar chart, I want to list from low to high by the Y-axis. ### Inpu... |
Bar chart x axis building y axis the average of capacity | CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE takes (
ID varchar(5),
course_... | SELECT building, AVG(capacity) FROM classroom GROUP BY building | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis building y axis the average of capacity ### Input: CREATE TABLE course (
course_id varchar(8),
titl... |
How many semesters has ARABIC 503 been offered ? | CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ARABIC' AND course.number = 503 AND semester.semester_id = course_offering.semester ORDER BY semester.year 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 semesters has ARABIC 503 been offered ? ### Input: CREATE TABLE program (
program_id int,
name varchar,
... |
Name the average goal difference for draw of 7 and played more than 18 | CREATE TABLE table_54447 (
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" real,
"Points" real
) | SELECT AVG("Goal Difference") FROM table_54447 WHERE "Draw" = '7' AND "Played" > '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: Name the average goal difference for draw of 7 and played more than 18 ### Input: CREATE TABLE table_54447 (
"Team" text... |
provide the number of patients whose admission type is emergency and procedure long title is atrial cardioversion. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Atrial cardioversion" | Below are sql tables 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 type is emergency and procedure long title is atrial cardioversion. ### Input... |
Who directed series episode number 201? | CREATE TABLE table_29107 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
) | SELECT "Director" FROM table_29107 WHERE "Series #" = '201' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who directed series episode number 201? ### Input: CREATE TABLE table_29107 (
"Series #" real,
"Season #" real,
... |
count the number of patients who have been diagnosed with congestive heart failure and who haven't returned to the hospital in the same month until 2 years ago. | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive heart failure' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 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: count the number of patients who have been diagnosed with congestive heart failure and who haven't returned to the hospital ... |
Return the claim start date for the claims whose claimed amount is no more than the average | CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
CREATE TABLE customer_poli... | SELECT date_claim_made FROM claims WHERE amount_settled <= (SELECT AVG(amount_settled) FROM claims) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return the claim start date for the claims whose claimed amount is no more than the average ### Input: CREATE TABLE customer... |
What is the highest crowd listed when the away side scores 4.9 (33)? | CREATE TABLE table_54182 (
"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_54182 WHERE "Away team score" = '4.9 (33)' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest crowd listed when the away side scores 4.9 (33)? ### Input: CREATE TABLE table_54182 (
"Home team" t... |
give me the number of patients whose primary disease is neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues\bone marrow transplant and admission year is less than 2197? | CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.admityear < "2197" | Below are sql tables 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 primary disease is neoplasm of uncertain behavior of other lymphatic and hematopoietic ... |
what are the procedures that are the top three most commonly received since 2101? | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) >= '2101' GROUP BY treatment.treatmentname) 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 are the procedures that are the top three most commonly received since 2101? ### Input: CREATE TABLE cost (
costid ... |
how many patients whose drug name is oxycodone sr (oxycontin)? | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Oxycodone SR (OxyconTIN)" | Below are sql tables 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 drug name is oxycodone sr (oxycontin)? ### Input: CREATE TABLE prescriptions (
subject_id text,
... |
What is the name of episode number 29 in the series? | CREATE TABLE table_31037 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | SELECT "Title" FROM table_31037 WHERE "No. in series" = '29' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of episode number 29 in the series? ### Input: CREATE TABLE table_31037 (
"No. in series" real,
"No... |
What was the result when he went 1 round against jeremy beck? | CREATE TABLE table_name_4 (
res VARCHAR,
round VARCHAR,
opponent VARCHAR
) | SELECT res FROM table_name_4 WHERE round = 1 AND opponent = "jeremy beck" | Below are sql tables 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 result when he went 1 round against jeremy beck? ### Input: CREATE TABLE table_name_4 (
res VARCHAR,
ro... |
What's the title of the film with the release date of 1954-12-18? | CREATE TABLE table_66356 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" real,
"Release date" text,
"reissue?" text
) | SELECT "Title" FROM table_66356 WHERE "Release date" = '1954-12-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's the title of the film with the release date of 1954-12-18? ### Input: CREATE TABLE table_66356 (
"Title" text,
... |
Plot the number of result by grouped by result as a bar graph, and sort by the Y in descending. | CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Ar... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY COUNT(Result) 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: Plot the number of result by grouped by result as a bar graph, and sort by the Y in descending. ### Input: CREATE TABLE volu... |
what team appears on this table the most ? | CREATE TABLE table_203_348 (
id number,
"number" number,
"name" text,
"team" text,
"position" text,
"years with franchise" text,
"note" text
) | SELECT "team" FROM table_203_348 GROUP BY "team" ORDER BY COUNT(*) DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what team appears on this table the most ? ### Input: CREATE TABLE table_203_348 (
id number,
"number" number,
"... |
what are the three most frequent microbiology tests that followed within 2 months for those who received normal saline administration - aggressive volume resuscitation (>250 mls/hr) since 2104? | CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid numb... | SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'normal saline administration - aggressive vo... | Below are sql tables 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 frequent microbiology tests that followed within 2 months for those who received normal saline admin... |
is there ground transportation from the MILWAUKEE airport to the downtown area | CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
descript... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'MILWAUKEE' 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: is there ground transportation from the MILWAUKEE airport to the downtown area ### Input: CREATE TABLE date_day (
month_... |
With a score of 68-65=133 and United States as the country what is the To par? | CREATE TABLE table_79181 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | SELECT "To par" FROM table_79181 WHERE "Country" = 'united states' AND "Score" = '68-65=133' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: With a score of 68-65=133 and United States as the country what is the To par? ### Input: CREATE TABLE table_79181 (
"Pl... |
Show all the planned delivery dates and bin by year in a line chart. | CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Invoice_Items (
Invoice_Item_ID INTEGER,
Invoice_ID INTEGER,
Order_ID INTEGE... | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show all the planned delivery dates and bin by year in a line chart. ### Input: CREATE TABLE Customers (
Customer_ID VAR... |
What was the attendance of the Indiana game? | CREATE TABLE table_17080868_7 (
location_attendance VARCHAR,
team VARCHAR
) | SELECT location_attendance FROM table_17080868_7 WHERE team = "Indiana" | Below are sql tables 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 of the Indiana game? ### Input: CREATE TABLE table_17080868_7 (
location_attendance VARCHAR,
... |
What town has the population of 777? | CREATE TABLE table_2562572_39 (
cyrillic_name_other_names VARCHAR,
population__2011_ VARCHAR
) | SELECT cyrillic_name_other_names FROM table_2562572_39 WHERE population__2011_ = "777" | Below are sql tables 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 town has the population of 777? ### Input: CREATE TABLE table_2562572_39 (
cyrillic_name_other_names VARCHAR,
p... |
Get the number of patients with item id 51514 who died in 2112 or before that. | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2112.0" AND lab.itemid = "51514" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Get the number of patients with item id 51514 who died in 2112 or before that. ### Input: CREATE TABLE diagnoses (
subje... |
when did patient 015-96048 first take his/her enteral novosource renal? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND intakeoutput.cellpath LIKE '%intake%... | Below are sql tables 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 015-96048 first take his/her enteral novosource renal? ### Input: CREATE TABLE vitalperiodic (
vitalper... |
What was the venue where the result was 2-1? | CREATE TABLE table_name_33 (
venue VARCHAR,
result VARCHAR
) | SELECT venue FROM table_name_33 WHERE result = "2-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 venue where the result was 2-1? ### Input: CREATE TABLE table_name_33 (
venue VARCHAR,
result VARCHAR
)... |
count the number of patients whose primary disease is congestive heart failure and year of death is less than or equal to 2174? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE" AND demographic.dod_year <= "2174.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: count the number of patients whose primary disease is congestive heart failure and year of death is less than or equal to 21... |
tell me the procedure that patient 027-95744 first had? | 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 treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-95744')) ORDER BY treatment.treatmenttime 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 procedure that patient 027-95744 first had? ### Input: CREATE TABLE medication (
medicationid number,
pa... |
What is department name and office for the professor whose last name is Heffington? | CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob... | SELECT T3.dept_name, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T1.emp_lname = 'Heffington' | Below are sql tables 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 department name and office for the professor whose last name is Heffington? ### Input: CREATE TABLE department (
... |
who is the away team when the away team score is 10.12 (72)? | CREATE TABLE table_52260 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | SELECT "Away team" FROM table_52260 WHERE "Away team score" = '10.12 (72)' | Below are sql tables 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 away team when the away team score is 10.12 (72)? ### Input: CREATE TABLE table_52260 (
"Home team" text,
... |
Bar chart x axis name y axis age, and rank Y in asc order. | CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Name, Age FROM artist ORDER BY Age | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis name y axis age, and rank Y in asc order. ### Input: CREATE TABLE exhibition_record (
Exhibition_ID int... |
Which MDE course has the most attending that 's least hard ? | CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduct... | SELECT DISTINCT department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')) AND num_enrolled = (S... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which MDE course has the most attending that 's least hard ? ### Input: CREATE TABLE student_record (
student_id int,
... |
Show the name of the party that has the most delegates. | CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptroller text,
attorney_general text,
us_senate text
)
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE el... | SELECT T2.party FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id GROUP BY T1.party ORDER BY COUNT(*) DESC LIMIT 1 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the name of the party that has the most delegates. ### Input: CREATE TABLE party (
party_id number,
year number... |
has patient 83466 undergone a excise lg intestine les procedure during the last year? | 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'excise lg intestine les') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83466) AND DATETIME(pro... | Below are sql tables 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 83466 undergone a excise lg intestine les procedure during the last year? ### Input: CREATE TABLE procedures_icd... |
How many goals did a player active since 2006 have? | CREATE TABLE table_14624 (
"Player" text,
"Country" text,
"Caps" real,
"Goals" text,
"Years Active" text
) | SELECT "Goals" FROM table_14624 WHERE "Years Active" = '2006' | Below are sql tables 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 goals did a player active since 2006 have? ### Input: CREATE TABLE table_14624 (
"Player" text,
"Country" t... |
find out the short title of diagnoses and long title of diagnoses for patient with patient id 11221. | CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT diagnoses.short_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "11221" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find out the short title of diagnoses and long title of diagnoses for patient with patient id 11221. ### Input: CREATE TABLE... |
Compute the total maximal product price across product type code as a pie chart. | CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(10),
customer_code VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(25... | SELECT product_type_code, MAX(product_price) 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: Compute the total maximal product price across product type code as a pie chart. ### Input: CREATE TABLE Customer_Orders (
... |
how did patient 021-246447 last entered hospital in a year before? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '021-246447' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime 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 did patient 021-246447 last entered hospital in a year before? ### Input: CREATE TABLE medication (
medicationid num... |
Which Name has a Number of electorates (2009) greater than 188,799? | CREATE TABLE table_14189 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | SELECT "Name" FROM table_14189 WHERE "Number of electorates (2009)" > '188,799' | Below are sql tables 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 Name has a Number of electorates (2009) greater than 188,799? ### Input: CREATE TABLE table_14189 (
"Constituency ... |
what is the number of patients under 45 years of age who had closure of skin and subcutaneous tissue of other sites? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Closure of skin and subcutaneous tissue of other sites" | Below are sql tables 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 under 45 years of age who had closure of skin and subcutaneous tissue of other sites? ### Inp... |
Visualize a bar chart for what are the names and the total prices of all products in the store?, and display by the y axis in ascending. | 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 Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) | Below are sql tables 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 for what are the names and the total prices of all products in the store?, and display by the y axis i... |
what is gender and diagnoses short title of subject id 2560? | 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 demographic.gender, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id 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 gender and diagnoses short title of subject id 2560? ### Input: CREATE TABLE prescriptions (
subject_id text,
... |
what ground transportation is available from the PIT airport | CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
... | SELECT DISTINCT ground_service.transport_type FROM airport, ground_service WHERE airport.airport_code = 'PIT' AND ground_service.airport_code = airport.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: what ground transportation is available from the PIT airport ### Input: CREATE TABLE class_of_service (
booking_class va... |
Which classes are upper level and have projects but not exams ? | CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which classes are upper level and have projects but not exams ? ### Input: CREATE TABLE requirement (
requirement_id int... |
explain the fare code Q | CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
C... | SELECT DISTINCT booking_class FROM class_of_service WHERE booking_class = 'Q' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: explain the fare code Q ### Input: CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_far... |
Which Opponent has a Time of 4:51? | CREATE TABLE table_name_84 (
opponent VARCHAR,
time VARCHAR
) | SELECT opponent FROM table_name_84 WHERE time = "4:51" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Opponent has a Time of 4:51? ### Input: CREATE TABLE table_name_84 (
opponent VARCHAR,
time VARCHAR
) ### Resp... |
Who was Milwaukee's opponent? | CREATE TABLE table_14309 (
"Date" text,
"Opponent" text,
"City" text,
"Result" text,
"Score" text
) | SELECT "Opponent" FROM table_14309 WHERE "City" = 'milwaukee' | Below are sql tables 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 Milwaukee's opponent? ### Input: CREATE TABLE table_14309 (
"Date" text,
"Opponent" text,
"City" text,
... |
What is the minimum age of patients whose ethnicity is white and were admitted before the year 2121? | 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 MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2121" | Below are sql tables 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 minimum age of patients whose ethnicity is white and were admitted before the year 2121? ### Input: CREATE TABLE... |
How many of the patients admitted to trsf within this facility were born before the year 2087? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2087" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many of the patients admitted to trsf within this facility were born before the year 2087? ### Input: CREATE TABLE presc... |
Name the average for 23 games played | CREATE TABLE table_28822 (
"Category" text,
"Player" text,
"Games played" real,
"Totals" text,
"Average" text
) | SELECT "Average" FROM table_28822 WHERE "Games played" = '23' | Below are sql tables 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 average for 23 games played ### Input: CREATE TABLE table_28822 (
"Category" text,
"Player" text,
"Game... |
how many patients stayed on the 52 ward until 2104? | CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 52 AND STRFTIME('%y', transfers.intime) <= '2104') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients stayed on the 52 ward until 2104? ### Input: CREATE TABLE icustays (
row_id number,
subject_id num... |
Which country has a finish of t4? | CREATE TABLE table_69575 (
"Player" text,
"Country" text,
"Year(s) Won" text,
"Total" real,
"To par" text,
"Finish" text
) | SELECT "Country" FROM table_69575 WHERE "Finish" = 't4' | Below are sql tables 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 country has a finish of t4? ### Input: CREATE TABLE table_69575 (
"Player" text,
"Country" text,
"Year(s) ... |
What is Acquisition via, when Season is 2006-2012? | CREATE TABLE table_6879 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | SELECT "Acquisition via" FROM table_6879 WHERE "Season" = '2006-2012' | Below are sql tables 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 Acquisition via, when Season is 2006-2012? ### Input: CREATE TABLE table_6879 (
"Name" text,
"Position" text... |
In order to declare a major in DENT , what classes do I need to take ? | CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%DENT%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In order to declare a major in DENT , what classes do I need to take ? ### Input: CREATE TABLE course (
course_id int,
... |
how many hispanic or latino patients had the procedure long title incision of vessel, lower limb arteries? | 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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.long_title = "Incision of vessel, lower limb arteries" | Below are sql tables 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 hispanic or latino patients had the procedure long title incision of vessel, lower limb arteries? ### Input: CREATE... |
give me the number of patients whose marital status is divorced and lab test category is hematology? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" 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 marital status is divorced and lab test category is hematology? ### Input: CREATE TABLE... |
tell me the type of admission and status of death for patient with patient id 25167. | 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 demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "25167" | Below are sql tables 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 type of admission and status of death for patient with patient id 25167. ### Input: CREATE TABLE procedures (
... |
what is the number of patients whose year of birth is less than 2197 and procedure icd9 code is 3142? | CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "3142" | Below are sql tables 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 year of birth is less than 2197 and procedure icd9 code is 3142? ### Input: CREATE TABL... |
What's the biggest Bronze that has less than 0 Silvers? | CREATE TABLE table_name_73 (
bronze INTEGER,
silver INTEGER
) | SELECT MAX(bronze) FROM table_name_73 WHERE silver < 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's the biggest Bronze that has less than 0 Silvers? ### Input: CREATE TABLE table_name_73 (
bronze INTEGER,
silv... |
What is the average money ($) that Tom Weiskopf made? | CREATE TABLE table_name_54 (
money___ INTEGER,
player VARCHAR
) | SELECT AVG(money___) AS $__ FROM table_name_54 WHERE player = "tom weiskopf" | Below are sql tables 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 money ($) that Tom Weiskopf made? ### Input: CREATE TABLE table_name_54 (
money___ INTEGER,
play... |
subjects with a primary diagnosis of depression or with a major depression diagnosis. | CREATE TABLE table_train_127 (
"id" int,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"back_pain" bool,
"renal_disease" bool,
"osteoarthritis" bool,
"hamilton_depression_scale_hds" int,
"liver_disease" bool,
"painful_condition" bool,
"other_chronic_musculoskeletal... | SELECT * FROM table_train_127 WHERE depression = 1 OR major_depression = 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: subjects with a primary diagnosis of depression or with a major depression diagnosis. ### Input: CREATE TABLE table_train_12... |
For those records from the products and each product's manufacturer, find founder and the average of revenue , and group by attribute founder, and visualize them by a bar chart, could you sort x-axis in ascending order 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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | Below are sql tables 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 founder and the average of revenue , and group by ... |
which patients have bisoprolol fumarate prescription? | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "bisoprolol fumarate" | Below are sql tables 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 patients have bisoprolol fumarate prescription? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
... |
A bar chart showing the number of first name for all female students Their sex is F, and show total number from low to high order. | CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY COUNT(Fname) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart showing the number of first name for all female students Their sex is F, and show total number from low to high ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.