instruction stringlengths 11 303 | input stringlengths 38 5.51k | output stringlengths 25 1.92k | text stringlengths 321 6.52k |
|---|---|---|---|
Who directed the episode that had 0.54 million U.S. viewers? | CREATE TABLE table_26914076_4 (
directed_by VARCHAR,
us_viewers__millions_ VARCHAR
) | SELECT directed_by FROM table_26914076_4 WHERE us_viewers__millions_ = "0.54" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who directed the episode that had 0.54 million U.S. viewers? ### Input: CREATE TABLE table_26914076_4 (
directed_by VARC... |
How many stores are headquarted in each city Plot them as bar chart, and list in asc by the total number. | CREATE TABLE product (
product_id int,
product text,
dimensions text,
dpi real,
pages_per_minute_color real,
max_page_size text,
interface text
)
CREATE TABLE store_product (
Store_ID int,
Product_ID int
)
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREAT... | SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City 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: How many stores are headquarted in each city Plot them as bar chart, and list in asc by the total number. ### Input: CREATE ... |
count the number of patients whose admission location is trsf within this facility and year of birth is less than 2150? | 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.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2150" | Below are sql tables 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 admission location is trsf within this facility and year of birth is less than 2150? ### ... |
What player's original team are the Buffalo Bills? | CREATE TABLE table_name_31 (
player VARCHAR,
original_nfl_team VARCHAR
) | SELECT player FROM table_name_31 WHERE original_nfl_team = "buffalo bills" | Below are sql tables 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 player's original team are the Buffalo Bills? ### Input: CREATE TABLE table_name_31 (
player VARCHAR,
original_... |
Count the number of patients whose primary disease is neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues/bone marrow transplant and were born before the year 2156. | 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 WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.dob_year < "2156" | Below are sql tables 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 neoplasm of uncertain behavior of other lymphatic and hematopoietic ti... |
Name the home for 21-17 | CREATE TABLE table_name_93 (
home VARCHAR,
score VARCHAR
) | SELECT home FROM table_name_93 WHERE score = "21-17" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the home for 21-17 ### Input: CREATE TABLE table_name_93 (
home VARCHAR,
score VARCHAR
) ### Response: SELECT h... |
What is Brendan Locke's College/Junior/Club Team (League)? | CREATE TABLE table_name_11 (
college_junior_club_team__league_ VARCHAR,
player VARCHAR
) | SELECT college_junior_club_team__league_ FROM table_name_11 WHERE player = "brendan locke" | Below are sql tables 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 Brendan Locke's College/Junior/Club Team (League)? ### Input: CREATE TABLE table_name_11 (
college_junior_club_t... |
what time is the last flight from WASHINGTON to SAN FRANCISCO | CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id 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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SA... | Below are sql tables 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 is the last flight from WASHINGTON to SAN FRANCISCO ### Input: CREATE TABLE days (
days_code varchar,
day_... |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and manager_id , list in ascending by the MANAGER_ID. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | SELECT PHONE_NUMBER, 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 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about... |
For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between salary and manager_id . | CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | SELECT SALARY, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between sala... |
The los angeles kings drafted what player in the 7th round | CREATE TABLE table_1473672_7 (
player VARCHAR,
nhl_team VARCHAR
) | SELECT player FROM table_1473672_7 WHERE nhl_team = "Los Angeles Kings" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The los angeles kings drafted what player in the 7th round ### Input: CREATE TABLE table_1473672_7 (
player VARCHAR,
... |
provide the number of patients whose diagnoses long title is regional enteritis of unspecified site and drug route is ih? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Regional enteritis of unspecified site" AND prescriptions.route = "IH" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose diagnoses long title is regional enteritis of unspecified site and drug route is ih? ##... |
count the number of patients whose lab test abnormal status is abnormal and lab test name is triiodothyronine (t3)? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Triiodothyronine (T3)" | Below are sql tables 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 lab test abnormal status is abnormal and lab test name is triiodothyronine (t3)? ### Inpu... |
Plot season by how many season as a line chart | CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE sta... | SELECT Season, COUNT(Season) FROM game | Below are sql tables 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 season by how many season as a line chart ### Input: CREATE TABLE injury_accident (
game_id int,
id int,
Pl... |
Visualize the title and and the average star rating of the movie using a bar chart. | CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) | SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the title and and the average star rating of the movie using a bar chart. ### Input: CREATE TABLE Movie (
mID ... |
What date is the Victoria Park venue? | CREATE TABLE table_name_3 (
date VARCHAR,
venue VARCHAR
) | SELECT date FROM table_name_3 WHERE venue = "victoria park" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date is the Victoria Park venue? ### Input: CREATE TABLE table_name_3 (
date VARCHAR,
venue VARCHAR
) ### Respo... |
Which CFL team was pick #35? | CREATE TABLE table_31485 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | SELECT "CFL Team" FROM table_31485 WHERE "Pick #" = '35' | Below are sql tables 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 CFL team was pick #35? ### Input: CREATE TABLE table_31485 (
"Pick #" real,
"CFL Team" text,
"Player" text... |
Draw a pie chart to show all main industry and total market value in each industry. | CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
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 i... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry | Below are sql tables 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 pie chart to show all main industry and total market value in each industry. ### Input: CREATE TABLE station_company ... |
this year, what are the top five most frequently prescribed drugs for patients of age 60 or above? | CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT 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 >= 60) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: this year, what are the top five most frequently prescribed drugs for patients of age 60 or above? ### Input: CREATE TABLE p... |
Get me the number of hispanic or latino-puerto rican patients who were born before 2074. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2074" | Below are sql tables 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 me the number of hispanic or latino-puerto rican patients who were born before 2074. ### Input: CREATE TABLE lab (
s... |
how many patients whose primary disease is sternal wound infection and lab test category is hematology? | 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" = "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: how many patients whose primary disease is sternal wound infection and lab test category is hematology? ### Input: CREATE TA... |
from SEATTLE to SALT LAKE CITY | CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant 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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT L... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: from SEATTLE to SALT LAKE CITY ### Input: CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class... |
when was patient 15107 last admitted to the hospital through the emergency room admit until 1 year ago? | CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 15107 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime 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: when was patient 15107 last admitted to the hospital through the emergency room admit until 1 year ago? ### Input: CREATE TA... |
What is the average when interview is 9.465 and evening gown is less than 9.454? | CREATE TABLE table_name_28 (
average INTEGER,
interview VARCHAR,
evening_gown VARCHAR
) | SELECT SUM(average) FROM table_name_28 WHERE interview = 9.465 AND evening_gown < 9.454 | Below are sql tables 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 when interview is 9.465 and evening gown is less than 9.454? ### Input: CREATE TABLE table_name_28 (
... |
Which winery is the wine that has the highest score from? | CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,... | SELECT winery FROM wine ORDER BY score 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: Which winery is the wine that has the highest score from? ### Input: CREATE TABLE wine (
no number,
grape text,
... |
Which Lost has a Club of club? | CREATE TABLE table_46212 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Points" text
) | SELECT "Lost" FROM table_46212 WHERE "Club" = 'club' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Lost has a Club of club? ### Input: CREATE TABLE table_46212 (
"Club" text,
"Played" text,
"Drawn" text,
... |
what was the minimum creatinine, body fluid value for patient 60347 until 08/2104. | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60347) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine, body fluid') AND STRFTIME('%y-%m', labevents.charttime) <= '210... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the minimum creatinine, body fluid value for patient 60347 until 08/2104. ### Input: CREATE TABLE d_icd_procedures ... |
count the number of patients whose primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis and year of death is less than or equal to 2173? | 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 = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.dod_year <= "2173.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 pneumonia;human immunodefiency virus;rule out tuberculosis and year of... |
List the name for storms and the number of affected regions for each storm with a pie chart. | CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_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: List the name for storms and the number of affected regions for each storm with a pie chart. ### Input: CREATE TABLE region ... |
What was the surface type during the match with the score of 6 4, 7 6 (7-5)?? | CREATE TABLE table_name_54 (
surface VARCHAR,
score VARCHAR
) | SELECT surface FROM table_name_54 WHERE score = "6–4, 7–6 (7-5)" | Below are sql tables 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 surface type during the match with the score of 6 4, 7 6 (7-5)?? ### Input: CREATE TABLE table_name_54 (
su... |
Which Poles has a Wins larger than 0, and a Podiums smaller than 17? | CREATE TABLE table_5462 (
"Season" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real
) | SELECT "Poles" FROM table_5462 WHERE "Wins" > '0' AND "Podiums" < '17' AND "Fastest Laps" = '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: Which Poles has a Wins larger than 0, and a Podiums smaller than 17? ### Input: CREATE TABLE table_5462 (
"Season" text,... |
Revival badge progress for user for specific tag. | CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT a.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a WHERE a.PostTypeId = 2 AND EXISTS(SELECT * FROM Posts AS q WHERE q.Id = a.ParentId AND q.PostTypeId = 1 AND a.CreationDate > q.CreationDate + 30 AND Tags LIKE '%<' + LOWER(@tag) + '>%') ORDER BY a.Score DESC LIMIT 1000 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Revival badge progress for user for specific tag. ### Input: CREATE TABLE Posts (
Id number,
PostTypeId number,
... |
What is the crowd size for st kilda as the home team? | CREATE TABLE table_name_17 (
crowd VARCHAR,
home_team VARCHAR
) | SELECT crowd FROM table_name_17 WHERE home_team = "st kilda" | Below are sql tables 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 crowd size for st kilda as the home team? ### Input: CREATE TABLE table_name_17 (
crowd VARCHAR,
home_te... |
Draw a bar chart about the distribution of meter_600 and meter_100 , list from low to high by the x-axis please. | 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 event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 | Below are sql tables 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_600 and meter_100 , list from low to high by the x-axis please. ### Input: ... |
View Deadweight (Phase 2) questions. View latest questions older than 3 months that have score < 1 and all answers have score < 0 | CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment tex... | SELECT Id AS "post_link", Title, Body FROM Posts AS q WHERE PostTypeId = 1 AND Score < 1 AND CreationDate < DATEADD(MONTH, -3, GETDATE()) AND ClosedDate IS NULL AND AcceptedAnswerId IS NULL AND AnswerCount > 0 AND NOT EXISTS(SELECT * FROM Posts AS a WHERE PostTypeId = 2 AND ParentId = q.Id AND Score >= 0) ORDER BY Crea... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: View Deadweight (Phase 2) questions. View latest questions older than 3 months that have score < 1 and all answers have scor... |
Find the country of the airlines whose name starts with 'Orbit', and count them by a bar chart | CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
country text,
active varchar(2)
)
CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varc... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the country of the airlines whose name starts with 'Orbit', and count them by a bar chart ### Input: CREATE TABLE airli... |
Draw a bar chart about the distribution of ACC_Road and the average of Team_ID , and group by attribute ACC_Road, and I want to display from low to high by the total number. | 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_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_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 ACC_Road and the average of Team_ID , and group by attribute ACC_Road, and I want... |
What player has the score of 67-72=139? | CREATE TABLE table_name_58 (
player VARCHAR,
score VARCHAR
) | SELECT player FROM table_name_58 WHERE score = 67 - 72 = 139 | Below are sql tables 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 player has the score of 67-72=139? ### Input: CREATE TABLE table_name_58 (
player VARCHAR,
score VARCHAR
) ### ... |
Find the number of departments in each school Plot them as bar chart, and I want to show by the y axis from high to low please. | CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),... | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_NAME) DESC | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of departments in each school Plot them as bar chart, and I want to show by the y axis from high to low plea... |
What is No. 3, when No. 7 is Abigail, and when No. 2 is Olivia? | CREATE TABLE table_name_24 (
no_3 VARCHAR,
no_7 VARCHAR,
no_2 VARCHAR
) | SELECT no_3 FROM table_name_24 WHERE no_7 = "abigail" AND no_2 = "olivia" | Below are sql tables 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 No. 3, when No. 7 is Abigail, and when No. 2 is Olivia? ### Input: CREATE TABLE table_name_24 (
no_3 VARCHAR,
... |
count how many times patient 57023 came in to intensive care unit in this year. | 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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count how many times patient 57023 came in to intensive care unit in this year. ### Input: CREATE TABLE transfers (
row_... |
what is the number of patients whose age is less than 68 and drug name is syringe (neonatal) *sw*? | CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.drug = "Syringe (Neonatal) *SW*" | Below are sql tables 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 age is less than 68 and drug name is syringe (neonatal) *sw*? ### Input: CREATE TABLE d... |
give me the number of patients whose procedure icd9 code is 12? | 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 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: give me the number of patients whose procedure icd9 code is 12? ### Input: CREATE TABLE procedures (
subject_id text,
... |
what was the last lab test in 09/last year given to patient 031-16123? | CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND DATETIME(lab.labresulttime, '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 was the last lab test in 09/last year given to patient 031-16123? ### Input: CREATE TABLE medication (
medicationid... |
papers by stefan savage | CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperdataset (
paperid int,
datase... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'stefan savage' AND writes.authorid = author.authorid | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: papers by stefan savage ### Input: CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (... |
What is the highest L of the tournament? | CREATE TABLE table_29542147_2 (
l INTEGER
) | SELECT MAX(l) FROM table_29542147_2 | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest L of the tournament? ### Input: CREATE TABLE table_29542147_2 (
l INTEGER
) ### Response: SELECT MAX... |
what were the medications patient 035-3162 was allergic to until 2 months ago? | 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 lab (
labid numbe... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-3162')) AND DATETIME(allergy.allergytime) <= 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 were the medications patient 035-3162 was allergic to until 2 months ago? ### Input: CREATE TABLE vitalperiodic (
v... |
is patient 24762 given medication until 40 months ago? | CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24762) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-40 month') | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is patient 24762 given medication until 40 months ago? ### Input: CREATE TABLE patients (
row_id number,
subject_id ... |
list flights from MIAMI to INDIANAPOLIS on sunday | 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 airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restrict... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIANAPOLIS' AND date_day.day_number = 27 AND date_day.month_number = 8 ... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list flights from MIAMI to INDIANAPOLIS on sunday ### Input: CREATE TABLE fare_basis (
fare_basis_code text,
booking... |
what is the number of patients whose insurance is private and days of hospital stay is greater than 20? | 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 WHERE demographic.insurance = "Private" AND demographic.days_stay > "20" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose insurance is private and days of hospital stay is greater than 20? ### Input: CREATE TA... |
what is the number of patients whose discharge location is home and with hospital stay more than 15 days? | 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.discharge_location = "HOME" AND demographic.days_stay > "15" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose discharge location is home and with hospital stay more than 15 days? ### Input: CREATE ... |
For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the h... |
Which team has a record of 7-1? | CREATE TABLE table_name_99 (
opponent VARCHAR,
record VARCHAR
) | SELECT opponent FROM table_name_99 WHERE record = "7-1" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which team has a record of 7-1? ### Input: CREATE TABLE table_name_99 (
opponent VARCHAR,
record VARCHAR
) ### Respo... |
A bar chart for what are the number of the titles of all movies that have rating star is between 3 and 5? | CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the titles of all movies that have rating star is between 3 and 5? ### Input: CREATE ... |
do you have a flight from SALT LAKE CITY to ST. PETERSBURG on 6 2 | CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_req... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PETERSBURG' AND date_day.day_number = 2 AND date_day.month_number = 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: do you have a flight from SALT LAKE CITY to ST. PETERSBURG on 6 2 ### Input: CREATE TABLE time_interval (
period text,
... |
Return the average price of products that have each category code. | CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
email_address text,
phone_number text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
product_category_code text,
date_product_first_available time,
date_product_discon... | SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_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: Return the average price of products that have each category code. ### Input: CREATE TABLE staff (
staff_id number,
... |
is the value of bedside glucose of patient 006-167444 measured at 2100-02-25 11:03:00 less than the value measured at 2100-02-25 10:50:00. | CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444')) AND lab.labname = 'bedside glucose' AND lab.labresulttime = '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: is the value of bedside glucose of patient 006-167444 measured at 2100-02-25 11:03:00 less than the value measured at 2100-0... |
February 12 is the date for all location attendance. | CREATE TABLE table_17080868_8 (
location_attendance VARCHAR,
date VARCHAR
) | SELECT location_attendance FROM table_17080868_8 WHERE date = "February 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: February 12 is the date for all location attendance. ### Input: CREATE TABLE table_17080868_8 (
location_attendance VARC... |
What are the ids and details for all organizations that have grants of more than 6000 dollars, rank X from low to high order. | CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_start_date DATETIME,
grant_end_date DATETIME,
other_details VARCHAR(255)
)
CR... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details | Below are sql tables 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 ids and details for all organizations that have grants of more than 6000 dollars, rank X from low to high order... |
Who are all the major users of the Gordon Close-Support Weapon System? | CREATE TABLE table_29474407_11 (
major_users VARCHAR,
name__designation VARCHAR
) | SELECT major_users FROM table_29474407_11 WHERE name__designation = "Gordon Close-Support Weapon System" | Below are sql tables 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 are all the major users of the Gordon Close-Support Weapon System? ### Input: CREATE TABLE table_29474407_11 (
major... |
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the headquarter , and group by attribute headquarter by a bar chart, order in descending by the bars. | 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 Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter 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, give me the comparison about the sum of price over the ... |
For 420 , is there a lab ? | CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 420 | Below are sql tables 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 420 , is there a lab ? ### Input: CREATE TABLE course_offering (
offering_id int,
course_id int,
semester in... |
what is average age of patients whose gender is m and year of death is less than 2173? | CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2173.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 average age of patients whose gender is m and year of death is less than 2173? ### Input: CREATE TABLE prescriptions... |
What is the date for the home detroit and visitor was chicago? | CREATE TABLE table_name_82 (
date VARCHAR,
home VARCHAR,
visitor VARCHAR
) | SELECT date FROM table_name_82 WHERE home = "detroit" AND visitor = "chicago" | Below are sql tables 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 date for the home detroit and visitor was chicago? ### Input: CREATE TABLE table_name_82 (
date VARCHAR,
... |
Who did the housemate that nominated Kashmera Rakhi in week 3 and Amit Bobby in week 1 nominate in week 6? | CREATE TABLE table_name_60 (
week_6 VARCHAR,
week_3 VARCHAR,
week_1 VARCHAR
) | SELECT week_6 FROM table_name_60 WHERE week_3 = "kashmera rakhi" AND week_1 = "amit bobby" | Below are sql tables 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 did the housemate that nominated Kashmera Rakhi in week 3 and Amit Bobby in week 1 nominate in week 6? ### Input: CREATE... |
Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge. | CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CRE... | SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | Below are sql tables 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 name and age of students who are living in the dorms that do not have amenity TV Lounge. ### Input: CREATE TA... |
which type of drug is prescribed to patient with patient id 2560? | 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 prescriptions.drug_type FROM prescriptions WHERE prescriptions.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: which type of drug is prescribed to patient with patient id 2560? ### Input: CREATE TABLE procedures (
subject_id text,
... |
What is the Date of Tie no 21? | CREATE TABLE table_name_13 (
date VARCHAR,
tie_no VARCHAR
) | SELECT date FROM table_name_13 WHERE tie_no = "21" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Date of Tie no 21? ### Input: CREATE TABLE table_name_13 (
date VARCHAR,
tie_no VARCHAR
) ### Response: ... |
until 2104, patient 7073 underwent any procedure? | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND STRFTIME('%y', procedures_icd.charttime) <= '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: until 2104, patient 7073 underwent any procedure? ### Input: CREATE TABLE chartevents (
row_id number,
subject_id nu... |
Show the number of assets and group by asset make in a bar chart, and display by the asset_make in ascending. | CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_... | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make | Below are sql tables 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 assets and group by asset make in a bar chart, and display by the asset_make in ascending. ### Input: CRE... |
when was patient 14203's respiratory rate the first time measured greater than 16.0 on the first intensive care unit visit? | CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14203) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 14203's respiratory rate the first time measured greater than 16.0 on the first intensive care unit visit? ... |
Show the number of apartment bookings in each year and bin booking end date by year with a bar chart, and could you list in desc by the how many booking end date? | CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_nam... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_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: Show the number of apartment bookings in each year and bin booking end date by year with a bar chart, and could you list in ... |
provide the number of patients whose drug route is iv drip? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "IV DRIP" | Below are sql tables 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 drug route is iv drip? ### Input: CREATE TABLE diagnoses (
subject_id text,
had... |
List the types of competition and the number of competitions of each type in a bar chart. | CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_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: List the types of competition and the number of competitions of each type in a bar chart. ### Input: CREATE TABLE competitio... |
what are the top five of the most commonly prescribed drugs during this year? | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5 | Below are sql tables 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 top five of the most commonly prescribed drugs during this year? ### Input: CREATE TABLE microlab (
microla... |
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, what is the relationship between commission_pct and department_id ? | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | Below are sql tables 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 ... |
what is the number of patients whose admission type is urgent and drug name is senna? | 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.admission_type = "URGENT" AND prescriptions.drug = "Senna" | Below are sql tables 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 urgent and drug name is senna? ### Input: CREATE TABLE prescriptions ... |
A bar chart about what is the total rating of channel for each channel owner?, display in ascending by the y axis. | CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent real,
Rating_in_percent real
)
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date text,
Share_in_percent real
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,... | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent) | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what is the total rating of channel for each channel owner?, display in ascending by the y axis. ### Input... |
Which date has a region of united kingdom? | CREATE TABLE table_name_54 (
date VARCHAR,
region VARCHAR
) | SELECT date FROM table_name_54 WHERE region = "united kingdom" | Below are sql tables 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 date has a region of united kingdom? ### Input: CREATE TABLE table_name_54 (
date VARCHAR,
region VARCHAR
) ##... |
What's the total Rank that has a Gold that's smaller than 0? | CREATE TABLE table_name_2 (
rank INTEGER,
gold INTEGER
) | SELECT SUM(rank) FROM table_name_2 WHERE 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's the total Rank that has a Gold that's smaller than 0? ### Input: CREATE TABLE table_name_2 (
rank INTEGER,
go... |
Which lowest year has a Position of rb, and a College of louisiana state? | CREATE TABLE table_67762 (
"Year" real,
"Pick" text,
"Player name" text,
"College" text,
"Position" text
) | SELECT MIN("Year") FROM table_67762 WHERE "Position" = 'rb' AND "College" = 'louisiana state' | Below are sql tables 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 lowest year has a Position of rb, and a College of louisiana state? ### Input: CREATE TABLE table_67762 (
"Year" r... |
What is the total number of bronze when the total is less than 1? | CREATE TABLE table_77962 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT SUM("Bronze") FROM table_77962 WHERE "Total" < '1' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of bronze when the total is less than 1? ### Input: CREATE TABLE table_77962 (
"Rank" real,
... |
Which upper level courses are taught by Verma ? | CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admi... | SELECT DISTINCT course.department, course.name, course.number 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.ins... | Below are sql tables 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 upper level courses are taught by Verma ? ### Input: CREATE TABLE program (
program_id int,
name varchar,
... |
In a week , are there usually 2 or 3 lectures for 230 ? | CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instruc... | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In a week , are there usually 2 or 3 lectures for 230 ? ### Input: CREATE TABLE course_prerequisite (
pre_course_id int,... |
When t3 is the best finish what is the lowest amount of tournaments played? | CREATE TABLE table_26755 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"2nd" real,
"3rd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Money list rank" real,
"Scoring average" text,
"Scoring rank" real
) | SELECT MIN("Tournaments played") FROM table_26755 WHERE "Best finish" = 'T3' | Below are sql tables 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 t3 is the best finish what is the lowest amount of tournaments played? ### Input: CREATE TABLE table_26755 (
"Year"... |
Show me manager_id by last name in a histogram | CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | SELECT LAST_NAME, MANAGER_ID FROM employees | Below are sql tables 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 manager_id by last name in a histogram ### Input: CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME... |
Which Score has a Record of 9 8? | CREATE TABLE table_43767 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
) | SELECT "Score" FROM table_43767 WHERE "Record" = '9–8' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Score has a Record of 9 8? ### Input: CREATE TABLE table_43767 (
"Game" real,
"Date" text,
"Team" text,
... |
how did patient 028-47306 last visit in this year to the hospital? | CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '028-47306' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 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 028-47306 last visit in this year to the hospital? ### Input: CREATE TABLE allergy (
allergyid number,
... |
how many students are in each department?, and could you rank by the the total number in desc? | CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr ... | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY COUNT(*) 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: how many students are in each department?, and could you rank by the the total number in desc? ### Input: CREATE TABLE cours... |
has patient 027-136480 been to the e.r. during this hospital visit? | 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 patient WHERE patient.uniquepid = '027-136480' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime IS NULL | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 027-136480 been to the e.r. during this hospital visit? ### Input: CREATE TABLE microlab (
microlabid number... |
What is the lowest Gold count if the Bronze is 4 and Silver is greater than 5? | CREATE TABLE table_63043 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | SELECT MIN("Gold") FROM table_63043 WHERE "Bronze" = '4' AND "Silver" > '5' | Below are sql tables 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 Gold count if the Bronze is 4 and Silver is greater than 5? ### Input: CREATE TABLE table_63043 (
"Ra... |
give me the number of elective hospital admission patients who are taking vitamin d prescription. | 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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Vitamin D" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of elective hospital admission patients who are taking vitamin d prescription. ### Input: CREATE TABLE di... |
give me the number of patients whose diagnoses short title is dmi neuro nt st uncntrld and drug type is main? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "DMI neuro nt st uncntrld" AND prescriptions.drug_type = "MAIN" | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose diagnoses short title is dmi neuro nt st uncntrld and drug type is main? ### Input: CRE... |
what is the average total cost of the hospital, which includes the narcotic overdose until 2 years ago? | CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeo... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'narcotic overdose')) AND DATETIME(cost.charg... | Below are sql tables 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 total cost of the hospital, which includes the narcotic overdose until 2 years ago? ### Input: CREATE TA... |
A bar chart about the name and age for all male people who don't have a wedding, and show by the Y in descending 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 Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY 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: A bar chart about the name and age for all male people who don't have a wedding, and show by the Y in descending please. ###... |
Which player went to college in Oklahoma? | CREATE TABLE table_16390 (
"Round" real,
"Choice" real,
"Player name" text,
"Position" text,
"Height" text,
"Weight" real,
"College" text
) | SELECT "Player name" FROM table_16390 WHERE "College" = 'Oklahoma' | Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which player went to college in Oklahoma? ### Input: CREATE TABLE table_16390 (
"Round" real,
"Choice" real,
"Pl... |
what is the number of draws for ali said gouled? | CREATE TABLE table_71001 (
"Name" text,
"Period" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Efficiency %" text
) | SELECT COUNT("Draws") FROM table_71001 WHERE "Name" = 'ali said gouled' | Below are sql tables 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 draws for ali said gouled? ### Input: CREATE TABLE table_71001 (
"Name" text,
"Period" text,
... |
How many students are from each city, and which cities have more than one cities Plot them as bar chart, order by the bars in descending. | CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHA... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_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: How many students are from each city, and which cities have more than one cities Plot them as bar chart, order by the bars i... |
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, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id by a bar chart, and I want to rank in desc by the names. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ... |
what is the three event that is frequent in the output until 2101? | 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 (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) <= '2101' GROUP BY outputevents.itemid) 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 event that is frequent in the output until 2101? ### Input: CREATE TABLE prescriptions (
row_id number... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.