instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute name.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, 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: For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name an...
in 2105, what was the top five most frequently diagnosed diagnoses that patients were diagnosed with during the same hospital encounter after receiving coronar arteriogr-2 cath?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in 2105, what was the top five most frequently diagnosed diagnoses that patients were diagnosed with during the same hospita...
How many gold medals does each school who has a total of 1 medal have?
CREATE TABLE table_619 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
SELECT "Gold Medals" FROM table_619 WHERE "Total Medals" = '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 gold medals does each school who has a total of 1 medal have? ### Input: CREATE TABLE table_619 ( "Ensemble" te...
How many games did they play on january 11?
CREATE TABLE table_27882867_6 ( location_attendance VARCHAR, date VARCHAR )
SELECT COUNT(location_attendance) FROM table_27882867_6 WHERE date = "January 11"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games did they play on january 11? ### Input: CREATE TABLE table_27882867_6 ( location_attendance VARCHAR, ...
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute name, and display in asc by the X.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, 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: For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name an...
What is the attendance for a week smaller than 9 with a result of L 38-20?
CREATE TABLE table_name_67 ( attendance INTEGER, result VARCHAR, week VARCHAR )
SELECT MAX(attendance) FROM table_name_67 WHERE result = "l 38-20" AND week < 9
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the attendance for a week smaller than 9 with a result of L 38-20? ### Input: CREATE TABLE table_name_67 ( atten...
Find the number of scientists involved for each project name.
CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) )
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP 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: Find the number of scientists involved for each project name. ### Input: CREATE TABLE AssignedTo ( Scientist int, Pr...
How many games were against Furman?
CREATE TABLE table_20745444_1 ( game INTEGER, opponent VARCHAR )
SELECT MAX(game) FROM table_20745444_1 WHERE opponent = "Furman"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games were against Furman? ### Input: CREATE TABLE table_20745444_1 ( game INTEGER, opponent VARCHAR ) ### ...
all the flights from BALTIMORE to SAN FRANCISCO
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE...
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: all the flights from BALTIMORE to SAN FRANCISCO ### Input: CREATE TABLE state ( state_code text, state_name text, ...
Tell me the laps for 3 grids
CREATE TABLE table_78213 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Laps" FROM table_78213 WHERE "Grid" = '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: Tell me the laps for 3 grids ### Input: CREATE TABLE table_78213 ( "Driver" text, "Constructor" text, "Laps" rea...
Bin the settlement date for each settlement case into the day of week interval and count them for visualizing a bar chart.
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE,...
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bin the settlement date for each settlement case into the day of week interval and count them for visualizing a bar chart. #...
With the Romaji title of Hanayome Wa Yakudoshi!, what is the Japanese title?
CREATE TABLE table_name_34 ( japanese_title VARCHAR, romaji_title VARCHAR )
SELECT japanese_title FROM table_name_34 WHERE romaji_title = "hanayome wa yakudoshi!"
Below are sql tables 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 the Romaji title of Hanayome Wa Yakudoshi!, what is the Japanese title? ### Input: CREATE TABLE table_name_34 ( jap...
what is the longest track on the album ?
CREATE TABLE table_204_74 ( id number, "#" number, "title" text, "producers" text, "guest performers" text, "length" text )
SELECT "title" FROM table_204_74 ORDER BY "length" 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 is the longest track on the album ? ### Input: CREATE TABLE table_204_74 ( id number, "#" number, "title" t...
If the partial thromboplastin and bleeding time is prolonged, what is the prothrombin time?
CREATE TABLE table_1557752_1 ( prothrombin_time VARCHAR, partial_thromboplastin_time VARCHAR, bleeding_time VARCHAR )
SELECT prothrombin_time FROM table_1557752_1 WHERE partial_thromboplastin_time = "Prolonged" AND bleeding_time = "Prolonged"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the partial thromboplastin and bleeding time is prolonged, what is the prothrombin time? ### Input: CREATE TABLE table_15...
What is the result for 1989 that has a 1992 result of 0 / 1?
CREATE TABLE table_8776 ( "Tournament" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "Career SR" text )
SELECT "1989" FROM table_8776 WHERE "1992" = '0 / 1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the result for 1989 that has a 1992 result of 0 / 1? ### Input: CREATE TABLE table_8776 ( "Tournament" text, ...
Get the list of patients with a lab test category of chemistry who have diagnoses icd9 code 2764.
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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2764" AND lab."CATEGORY" = "Chemistry"
Below are sql tables 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 list of patients with a lab test category of chemistry who have diagnoses icd9 code 2764. ### Input: CREATE TABLE pr...
What was the home team's score in the match at Victoria Park?
CREATE TABLE table_name_6 ( home_team VARCHAR, venue VARCHAR )
SELECT home_team AS score FROM table_name_6 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 was the home team's score in the match at Victoria Park? ### Input: CREATE TABLE table_name_6 ( home_team VARCHAR, ...
how many countries sampled with year of publication being 2007 and ranking l.a. (2) being 7th
CREATE TABLE table_12000368_1 ( countries_sampled VARCHAR, year_of_publication VARCHAR, ranking_la__2_ VARCHAR )
SELECT COUNT(countries_sampled) FROM table_12000368_1 WHERE year_of_publication = "2007" AND ranking_la__2_ = "7th"
Below are sql tables 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 countries sampled with year of publication being 2007 and ranking l.a. (2) being 7th ### Input: CREATE TABLE table_...
Top users in Barcelona for iOS.
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
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 users in Barcelona for iOS. ### Input: CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Flag...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by weekday, and I want to show by the total number of manager id in descending.
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(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the di...
what was the age of patient 10811 on the current hospital visit?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 c...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 10811 AND admissions.dischtime IS NULL
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the age of patient 10811 on the current hospital visit? ### Input: CREATE TABLE patients ( row_id number, s...
Find the number of patients who were diagnosed with tobacco use disorder and survived
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Tobacco use disorder"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the number of patients who were diagnosed with tobacco use disorder and survived ### Input: CREATE TABLE demographic ( ...
What high-level PATH courses are given this Spring-Summer ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PATH' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring...
Below are sql tables 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 high-level PATH courses are given this Spring-Summer ? ### Input: CREATE TABLE jobs ( job_id int, job_title var...
What was the smallest crowd for the Richmond home team?
CREATE TABLE table_name_56 ( crowd INTEGER, home_team VARCHAR )
SELECT MIN(crowd) FROM table_name_56 WHERE home_team = "richmond"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the smallest crowd for the Richmond home team? ### Input: CREATE TABLE table_name_56 ( crowd INTEGER, home_...
provide the number of newborn admission patients who had thyroxine (t4) lab test.
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.admission_type = "NEWBORN" AND lab.label = "Thyroxine (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: provide the number of newborn admission patients who had thyroxine (t4) lab test. ### Input: CREATE TABLE demographic ( ...
provide the number of patients whose discharge location is snf and lab test name is blood?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "SNF" AND lab.label = "Blood"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose discharge location is snf and lab test name is blood? ### Input: CREATE TABLE lab ( ...
What is the leading scorer on february 1?
CREATE TABLE table_17346 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text )
SELECT "Leading scorer" FROM table_17346 WHERE "Date" = 'February 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 leading scorer on february 1? ### Input: CREATE TABLE table_17346 ( "#" real, "Date" text, "Visitor"...
what are the drugs that is added to patient 808 today compared to the ones yesterday?
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 prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE p...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the drugs that is added to patient 808 today compared to the ones yesterday? ### Input: CREATE TABLE admissions ( ...
count the number of patients that are admitted to the hospital since 1 year ago.
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labi...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-1 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 that are admitted to the hospital since 1 year ago. ### Input: CREATE TABLE diagnoses_icd ( ...
Find the number of students for the cities where have more than one student.
CREATE TABLE student ( city_code VARCHAR )
SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 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: Find the number of students for the cities where have more than one student. ### Input: CREATE TABLE student ( city_code...
Show names of technicians who are assigned to repair machines with value point more than 70, and count them by a bar chart, could you order in asc by the bars?
CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, ...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER 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: Show names of technicians who are assigned to repair machines with value point more than 70, and count them by a bar chart, ...
Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a bar chart, rank from low to high by the y axis.
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth)
Below are sql tables 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 dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a...
provide the number of patients whose admission type is emergency and procedure icd9 code is 9961?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "9961"
Below are sql tables 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 icd9 code is 9961? ### Input: CREATE TABLE pr...
Find the number of trains for each station, as well as the station network name Show the result with a bar graph, sort in descending by the X-axis please.
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text,...
SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id ORDER BY network_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 trains for each station, as well as the station network name Show the result with a bar graph, sort in de...
Compare all train names' total numbers.
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TA...
SELECT name, COUNT(name) FROM train 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: Compare all train names' total numbers. ### Input: CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE...
What are the names and account balances of customers with the letter a in their names.
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the names and account balances of customers with the letter a in their names. ### Input: CREATE TABLE bank ( br...
How many faculty members participate in each activity? Return the activity names and the number of faculty members. Show bar chart.
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 ( FacID INTEGER, actid INTEGER ) CREATE TABLE Participates_in ( stuid IN...
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid
Below are sql tables 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 faculty members participate in each activity? Return the activity names and the number of faculty members. Show bar...
What was the venue where goal #2 occured?
CREATE TABLE table_name_11 ( venue VARCHAR, goal__number VARCHAR )
SELECT venue FROM table_name_11 WHERE goal__number = 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 was the venue where goal #2 occured? ### Input: CREATE TABLE table_name_11 ( venue VARCHAR, goal__number VARCHA...
what is the last drug that is prescribed to patient 40435 via ih route during a month before?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.route = 'ih' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptio...
Below are sql tables 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 last drug that is prescribed to patient 40435 via ih route during a month before? ### Input: CREATE TABLE inpute...
How many episodes are directed by ricardo mendez matta?
CREATE TABLE table_29112 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text )
SELECT COUNT("Season #") FROM table_29112 WHERE "Director" = 'Ricardo Mendez Matta'
Below are sql tables 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 episodes are directed by ricardo mendez matta? ### Input: CREATE TABLE table_29112 ( "Series #" real, "Seas...
how many patients whose age is less than 68 and drug name is vancomycin?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.drug = "Vancomycin"
Below are sql tables 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 age is less than 68 and drug name is vancomycin? ### Input: CREATE TABLE lab ( subject_id text, ...
Who won the womens doubles when wu jianqui won the womens singles?
CREATE TABLE table_12027364_1 ( womens_doubles VARCHAR, womens_singles VARCHAR )
SELECT womens_doubles FROM table_12027364_1 WHERE womens_singles = "Wu Jianqui"
Below are sql tables 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 won the womens doubles when wu jianqui won the womens singles? ### Input: CREATE TABLE table_12027364_1 ( womens_dou...
what is age and discharge time of subject id 74032?
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 demographic.age, demographic.dischtime FROM demographic WHERE demographic.subject_id = "74032"
Below are sql tables 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 age and discharge time of subject id 74032? ### Input: CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the difference in chloride levels of patient 031-23605 second measured on the first hospital visit compared to the value first measured on the first hospital visit?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
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 = '031-23605' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the difference in chloride levels of patient 031-23605 second measured on the first hospital visit compared to the v...
How many transactions do we have?
CREATE TABLE Financial_transactions ( Id VARCHAR )
SELECT COUNT(*) FROM Financial_transactions
Below are sql tables 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 transactions do we have? ### Input: CREATE TABLE Financial_transactions ( Id VARCHAR ) ### Response: SELECT COU...
what is the competition when the result is 2-1?
CREATE TABLE table_name_58 ( competition VARCHAR, result VARCHAR )
SELECT competition FROM table_name_58 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 is the competition when the result is 2-1? ### Input: CREATE TABLE table_name_58 ( competition VARCHAR, result ...
Bar chart of total number of credits from each dept name
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_I...
SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart of total number of credits from each dept name ### Input: CREATE TABLE takes ( ID varchar(5), course_id va...
Tell me the country for julian schnabel
CREATE TABLE table_74512 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director" text )
SELECT "Country" FROM table_74512 WHERE "Director" = 'julian schnabel'
Below are sql tables 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 country for julian schnabel ### Input: CREATE TABLE table_74512 ( "Year" real, "English title" text, ...
Give me the comparison about Team_ID over the All_Neutral , and display in asc by the bars.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral
Below are sql tables 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 comparison about Team_ID over the All_Neutral , and display in asc by the bars. ### Input: CREATE TABLE basketba...
tell me the number of patients who had their admission location as transfer from hosp/extram.
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 = "TRANSFER FROM HOSP/EXTRAM"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: tell me the number of patients who had their admission location as transfer from hosp/extram. ### Input: CREATE TABLE demogr...
What is the team at Stadion Maksimir?
CREATE TABLE table_43830 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real )
SELECT "Team" FROM table_43830 WHERE "Stadium" = 'stadion maksimir'
Below are sql tables 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 team at Stadion Maksimir? ### Input: CREATE TABLE table_43830 ( "Team" text, "Manager" text, "Home c...
Draw a bar chart of operating system versus the total number
CREATE TABLE browser ( id int, name text, market_share real ) CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_year int ) CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connectio...
SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_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: Draw a bar chart of operating system versus the total number ### Input: CREATE TABLE browser ( id int, name text, ...
what is the league cup apps when the total goals is less than 2 and the total apps is 12?
CREATE TABLE table_65280 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Total Apps" text, "Total Goals" real )
SELECT "League Cup Apps" FROM table_65280 WHERE "Total Goals" < '2' AND "Total Apps" = '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: what is the league cup apps when the total goals is less than 2 and the total apps is 12? ### Input: CREATE TABLE table_6528...
How many paper does samia razaq have ?
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( ...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'samia razaq' 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: How many paper does samia razaq have ? ### Input: CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) ...
What was the location when the winning driver was Nathana l Berthon?
CREATE TABLE table_25572068_1 ( location VARCHAR, winning_driver VARCHAR )
SELECT location FROM table_25572068_1 WHERE winning_driver = "Nathanaël Berthon"
Below are sql tables 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 location when the winning driver was Nathana l Berthon? ### Input: CREATE TABLE table_25572068_1 ( location...
when was patient 18757 prescribed medication via ih route, for the last time until 02/2105?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18757) AND prescriptions.route = 'ih' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-02' ORDER BY prescriptions.startdate DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 18757 prescribed medication via ih route, for the last time until 02/2105? ### Input: CREATE TABLE inputeve...
What was the Surface in the match with a Score of 7 5, 6 7, 4 6?
CREATE TABLE table_name_40 ( surface VARCHAR, score VARCHAR )
SELECT surface FROM table_name_40 WHERE score = "7–5, 6–7, 4–6"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Surface in the match with a Score of 7 5, 6 7, 4 6? ### Input: CREATE TABLE table_name_40 ( surface VARCHAR...
what flights go from PHOENIX to SALT LAKE CITY
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHOENIX' 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: what flights go from PHOENIX to SALT LAKE CITY ### Input: CREATE TABLE city ( city_code varchar, city_name varchar, ...
Give me the comparison about the sum of School_ID over the ACC_Road , and group by attribute ACC_Road, and I want to rank from high to low by the Y.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_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: Give me the comparison about the sum of School_ID over the ACC_Road , and group by attribute ACC_Road, and I want to rank fr...
What are the available classes this Spring-Summer ?
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016
Below are sql tables 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 available classes this Spring-Summer ? ### Input: CREATE TABLE area ( course_id int, area varchar ) CR...
when was patient 12885 given a procedure for the first time in the last hospital encounter?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_i...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12885 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime 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 12885 given a procedure for the first time in the last hospital encounter? ### Input: CREATE TABLE d_labite...
retrieve the top five most common output events until 2100?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id n...
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) <= '2100' GROUP BY outputevents.itemid) 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: retrieve the top five most common output events until 2100? ### Input: CREATE TABLE cost ( row_id number, subject_id...
what is the cost of a ticket going from DENVER to BOSTON 7 25 1991
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_co...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, fare, fare_basis WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 25 AND date_day.month_number = 7 ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the cost of a ticket going from DENVER to BOSTON 7 25 1991 ### Input: CREATE TABLE month ( month_number int, ...
Give me a list of all the service names sorted alphabetically.
CREATE TABLE customers_policies ( customer_id number, policy_id number, date_opened time, date_closed time ) CREATE TABLE settlements ( settlement_id number, claim_id number, effective_date time, settlement_amount number ) CREATE TABLE customers ( customer_id number, customer_n...
SELECT service_name FROM services ORDER BY service_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a list of all the service names sorted alphabetically. ### Input: CREATE TABLE customers_policies ( customer_id ...
how many patients whose age is less than 45 and procedure long title is parenteral infusion of concentrated nutritional substances?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Parenteral infusion of concentrated nutritional substances"
Below are sql tables 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 age is less than 45 and procedure long title is parenteral infusion of concentrated nutritional subs...
count the numbers of patients who died after having been diagnosed with septic shock during the same month since 4 years ago.
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, ...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnos...
Below are sql tables 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 numbers of patients who died after having been diagnosed with septic shock during the same month since 4 years ago...
In what venue was the event held on 14 February 2009?
CREATE TABLE table_name_95 ( venue VARCHAR, date VARCHAR )
SELECT venue FROM table_name_95 WHERE date = "14 february 2009"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In what venue was the event held on 14 February 2009? ### Input: CREATE TABLE table_name_95 ( venue VARCHAR, date VA...
When the laps are 31 and the constructor was honda, what's the sum of all grid values?
CREATE TABLE table_name_58 ( grid INTEGER, constructor VARCHAR, laps VARCHAR )
SELECT SUM(grid) FROM table_name_58 WHERE constructor = "honda" AND laps = 31
Below are sql tables 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 the laps are 31 and the constructor was honda, what's the sum of all grid values? ### Input: CREATE TABLE table_name_58...
Draw a bar chart of transaction type versus the total number, and rank from low to high by the names.
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_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: Draw a bar chart of transaction type versus the total number, and rank from low to high by the names. ### Input: CREATE TABL...
What is the IHSAA class of Centerville, which plays IHSAA class AA football?
CREATE TABLE table_65574 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
SELECT "IHSAA Class" FROM table_65574 WHERE "IHSAA Football Class" = 'aa' AND "School" = 'centerville'
Below are sql tables 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 IHSAA class of Centerville, which plays IHSAA class AA football? ### Input: CREATE TABLE table_65574 ( "Scho...
What is the Time/Retired for laps higher than 52 on a grid larger than 21?
CREATE TABLE table_54112 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Time/Retired" FROM table_54112 WHERE "Laps" > '52' AND "Grid" > '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 Time/Retired for laps higher than 52 on a grid larger than 21? ### Input: CREATE TABLE table_54112 ( "Driver...
Which potential's period 5 is 4 and has an element of antimony?
CREATE TABLE table_name_81 ( potential VARCHAR, period VARCHAR, element VARCHAR )
SELECT potential FROM table_name_81 WHERE period = 5 AND element = "antimony"
Below are sql tables 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 potential's period 5 is 4 and has an element of antimony? ### Input: CREATE TABLE table_name_81 ( potential VARCHA...
serum creatinine at screening > 1.4 mg / dl ( 124 umol / l ) for female , or > 1.5 mg / dl ( 133 umol / l ) for male .
CREATE TABLE table_dev_38 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "ace_inhibitors" bool, "serum_creatinine" float, ...
SELECT * FROM table_dev_38 WHERE (gender = 'female' AND serum_creatinine > 1.4) OR (gender = 'male' AND serum_creatinine > 1.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: serum creatinine at screening > 1.4 mg / dl ( 124 umol / l ) for female , or > 1.5 mg / dl ( 133 umol / l ) for male . ### I...
What is minimum age for different job title, sort in descending by the X.
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is minimum age for different job title, sort in descending by the X. ### Input: CREATE TABLE PersonFriend ( name va...
whats patient 016-12011 last ward id in 2104?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-12011') AND STRFTIME('%y', patient.unitadmittime) = '2104' ORDER BY patient.unitadmittime 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: whats patient 016-12011 last ward id in 2104? ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, patientu...
What was the highest assists for game 3?
CREATE TABLE table_77457 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
SELECT "High assists" FROM table_77457 WHERE "Game" = '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 was the highest assists for game 3? ### Input: CREATE TABLE table_77457 ( "Game" real, "Date" text, "Team" ...
Name the college for calgary stampeders
CREATE TABLE table_20904 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
SELECT "College" FROM table_20904 WHERE "CFL Team" = 'Calgary Stampeders'
Below are sql tables 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 college for calgary stampeders ### Input: CREATE TABLE table_20904 ( "Pick #" real, "CFL Team" text, "P...
During footscray's home game, how much did the away team score?
CREATE TABLE table_name_74 ( away_team VARCHAR, home_team VARCHAR )
SELECT away_team AS score FROM table_name_74 WHERE home_team = "footscray"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: During footscray's home game, how much did the away team score? ### Input: CREATE TABLE table_name_74 ( away_team VARCHA...
what flights arrive in CHICAGO on sunday on CO
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE class_of_ser...
SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE (((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what flights arrive in CHICAGO on sunday on CO ### Input: CREATE TABLE flight_stop ( flight_id int, stop_number int,...
Count the number of programs broadcast for each time section of a day by a pie chart.
CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_...
SELECT Time_of_day, COUNT(*) FROM broadcast GROUP BY Time_of_day
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Count the number of programs broadcast for each time section of a day by a pie chart. ### Input: CREATE TABLE broadcast_shar...
Which course is easier : EECS 512 or EECS 434 ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 512 OR course.number = 434) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
Below are sql tables 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 course is easier : EECS 512 or EECS 434 ? ### Input: CREATE TABLE comment_instructor ( instructor_id int, stud...
What's the percentage of votes for other candidates in the county where Bush got 51.6% of the votes?
CREATE TABLE table_17956 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real )
SELECT "Others%" FROM table_17956 WHERE "Bush%" = '51.6%'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the percentage of votes for other candidates in the county where Bush got 51.6% of the votes? ### Input: CREATE TABLE...
What is the average number of losses for teams with 0 draws and 0 byes?
CREATE TABLE table_name_78 ( losses INTEGER, draws VARCHAR, byes VARCHAR )
SELECT AVG(losses) FROM table_name_78 WHERE draws = 0 AND byes < 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 average number of losses for teams with 0 draws and 0 byes? ### Input: CREATE TABLE table_name_78 ( losses I...
what number countries received gold medals ?
CREATE TABLE table_204_761 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT COUNT("nation") FROM table_204_761 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 number countries received gold medals ? ### Input: CREATE TABLE table_204_761 ( id number, "rank" number, "...
What is the most recent year founded that has a nickname of bruins?
CREATE TABLE table_name_7 ( founded INTEGER, nickname VARCHAR )
SELECT MAX(founded) FROM table_name_7 WHERE nickname = "bruins"
Below are sql tables 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 most recent year founded that has a nickname of bruins? ### Input: CREATE TABLE table_name_7 ( founded INTEG...
Who had the high rebounds when the record was 14 7?
CREATE TABLE table_27723228_8 ( high_rebounds VARCHAR, record VARCHAR )
SELECT high_rebounds FROM table_27723228_8 WHERE record = "14–7"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who had the high rebounds when the record was 14 7? ### Input: CREATE TABLE table_27723228_8 ( high_rebounds VARCHAR, ...
What is the to par of the player from the United States with a t6 place and a score of 70-73-68-73=284?
CREATE TABLE table_name_22 ( to_par VARCHAR, country VARCHAR, place VARCHAR, score VARCHAR )
SELECT to_par FROM table_name_22 WHERE country = "united states" AND place = "t6" AND score = 70 - 73 - 68 - 73 = 284
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the to par of the player from the United States with a t6 place and a score of 70-73-68-73=284? ### Input: CREATE TA...
what is primary disease and discharge time of subject id 2560?
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 demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is primary disease and discharge time of subject id 2560? ### Input: CREATE TABLE diagnoses ( subject_id text, ...
When the VFL played Victoria Park what was the home team score?
CREATE TABLE table_33599 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team score" FROM table_33599 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: When the VFL played Victoria Park what was the home team score? ### Input: CREATE TABLE table_33599 ( "Home team" text, ...
Give the number of patients whose primary disease is overdose and died in or before year 2168.
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.diagnosis = "OVERDOSE" AND demographic.dod_year <= "2168.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: Give the number of patients whose primary disease is overdose and died in or before year 2168. ### Input: CREATE TABLE demog...
Which customers have an insurance policy with the type code 'Deputy'? Give me the customer details.
CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE claims_processing_stages ( claim_stage_id number, next_c...
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy"
Below are sql tables 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 customers have an insurance policy with the type code 'Deputy'? Give me the customer details. ### Input: CREATE TABLE ...
Show me a bar chart for what are the total enrollments of universities of each affiliation type?, I want to list from low to high by the x axis please.
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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart for what are the total enrollments of universities of each affiliation type?, I want to list from low to...
WHAT IS THE TYPE WITH 124?
CREATE TABLE table_name_56 ( type VARCHAR, quantity VARCHAR )
SELECT type FROM table_name_56 WHERE quantity = "124"
Below are sql tables 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 TYPE WITH 124? ### Input: CREATE TABLE table_name_56 ( type VARCHAR, quantity VARCHAR ) ### Response: SE...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the amount of hire_date bin hire_date by time, and visualize them by a bar chart, and list y-axis in asc order.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLO...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(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 do not work in departments with managers that have ids between 100 and 200, find hire_date and the a...
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, and list total number of salary from low to high order.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For 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...
do you have an afternoon flight leaving in the afternoon going from BOSTON to SAN FRANCISCO with a stopover in DALLAS
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI...
Below are sql tables 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 an afternoon flight leaving in the afternoon going from BOSTON to SAN FRANCISCO with a stopover in DALLAS ### In...
what are the four most frequently given diagnoses for patients who have had exploratory laparotomy previously within 2 months until 2103?
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the four most frequently given diagnoses for patients who have had exploratory laparotomy previously within 2 month...
What is the name of the activity that has the most faculty members involved in?
CREATE TABLE Faculty_participates_in ( actID VARCHAR ) CREATE TABLE Activity ( activity_name VARCHAR, actID VARCHAR )
SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID 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 is the name of the activity that has the most faculty members involved in? ### Input: CREATE TABLE Faculty_participates...
give me the cheapest flight from CHARLOTTE to LONG BEACH
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the cheapest flight from CHARLOTTE to LONG BEACH ### Input: CREATE TABLE airport_service ( city_code varchar, ...
Return all the committees that have delegates from Democratic party, and count them by a bar chart, and sort in asc by the y-axis.
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
SELECT Committee, COUNT(Committee) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" GROUP BY Committee ORDER BY COUNT(Committee)
Below are sql tables 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 all the committees that have delegates from Democratic party, and count them by a bar chart, and sort in asc by the y...