instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
What Constructor had 66 Laps?
CREATE TABLE table_52756 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Constructor" FROM table_52756 WHERE "Laps" = '66'
Below are sql tables 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 Constructor had 66 Laps? ### Input: CREATE TABLE table_52756 ( "Driver" text, "Constructor" text, "Laps" re...
count the number of patients whose diagnoses long title is venous (peripheral) insufficiency, unspecified and drug route is iv?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Venous (peripheral) insufficiency, unspecified" AND prescriptions.route = "IV"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses long title is venous (peripheral) insufficiency, unspecified and drug route is ...
what are the total times ` won ' was listed as the outcome ?
CREATE TABLE table_203_650 ( id number, "ceremony" text, "award" text, "category" text, "name" text, "outcome" text )
SELECT COUNT(*) FROM table_203_650 WHERE "outcome" = 'won'
Below are sql tables 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 total times ` won ' was listed as the outcome ? ### Input: CREATE TABLE table_203_650 ( id number, "cer...
Which classes are necessary for a declared major in LING ?
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%LING%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which classes are necessary for a declared major in LING ? ### Input: CREATE TABLE gsi ( course_offering_id int, stu...
Show the type of school and the number of buses for each type, and could you show by the x axis in ascending?
CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type...
SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type ORDER BY Type
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the type of school and the number of buses for each type, and could you show by the x axis in ascending? ### Input: CRE...
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and manufacturer , and group by attribute 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, T1.Manufacturer 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...
Show the number of cards in different card type code in a bar chart.
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Customers_Cards ( card_id INTEGER, ...
SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of cards in different card type code in a bar chart. ### Input: CREATE TABLE Customers ( customer_id INT...
What team was the away team when they played at lake oval?
CREATE TABLE table_52699 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_52699 WHERE "Venue" = 'lake oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team was the away team when they played at lake oval? ### Input: CREATE TABLE table_52699 ( "Home team" text, "...
Of the classes that fill the PreMajor requirement , which one is the easiest ?
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Of the classes that fill the PreMajor requirement , which one is the easiest ? ### Input: CREATE TABLE program ( program...
has patient 9474 been diagnosed with any since 1 year ago?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime ti...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9474) AND DATETIME(diagnoses_icd.charttime) >= 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: has patient 9474 been diagnosed with any since 1 year ago? ### Input: CREATE TABLE d_labitems ( row_id number, itemi...
Show me courses which involve parts of Marine Structures and Writing Poetry .
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Writing Poetry%' OR course.description LIKE '%Writing Poetry%' OR course.name LIKE '%Writing Poetry%') AND (area.area LIKE '%Marine Structures%' OR course.description LI...
Below are sql tables 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 courses which involve parts of Marine Structures and Writing Poetry . ### Input: CREATE TABLE course_tags_count ( ...
How many people attended the game where Fitzroy was the away team?
CREATE TABLE table_55220 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT COUNT("Crowd") FROM table_55220 WHERE "Away team" = 'fitzroy'
Below are sql tables 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 people attended the game where Fitzroy was the away team? ### Input: CREATE TABLE table_55220 ( "Home team" tex...
How many customers using email as the contact channel? Group by customer name and bin active date by weekday in a stacked bar chart, I want to show by the total number in asc.
CREATE TABLE Customer_Contact_Channels ( customer_id INTEGER, channel_code VARCHAR(15), active_from_date DATETIME, active_to_date DATETIME, contact_number VARCHAR(50) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_address_from DATETIME, address_typ...
SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' GROUP BY customer_name ORDER BY COUNT(active_from_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: How many customers using email as the contact channel? Group by customer name and bin active date by weekday in a stacked ba...
For those employees who was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart, and order in ascending by the the average of employee id.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_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 was hired before 2002-06-21, give me the comparison about the average of employee_id over the hire_d...
Which party is tobias a. plants the incumbent?
CREATE TABLE table_5537 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text )
SELECT "Party" FROM table_5537 WHERE "Incumbent" = 'tobias a. plants'
Below are sql tables 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 party is tobias a. plants the incumbent? ### Input: CREATE TABLE table_5537 ( "District" text, "Incumbent" tex...
Sfax has a total ordered number of?
CREATE TABLE table_name_54 ( ordered VARCHAR, name VARCHAR )
SELECT COUNT(ordered) FROM table_name_54 WHERE name = "sfax"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Sfax has a total ordered number of? ### Input: CREATE TABLE table_name_54 ( ordered VARCHAR, name VARCHAR ) ### Resp...
Which Average has a Band of f?
CREATE TABLE table_name_57 ( average VARCHAR, band VARCHAR )
SELECT average FROM table_name_57 WHERE band = "f"
Below are sql tables 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 Average has a Band of f? ### Input: CREATE TABLE table_name_57 ( average VARCHAR, band VARCHAR ) ### Response:...
What college did the player come from whose position is DL?
CREATE TABLE table_27351 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
SELECT "College" FROM table_27351 WHERE "Position" = 'DL'
Below are sql tables 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 college did the player come from whose position is DL? ### Input: CREATE TABLE table_27351 ( "Pick #" real, "CF...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the hire_date bin hire_date by weekday by a bar chart.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-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: For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the hire_dat...
What is the apartment number of the apartment with the most beds?
CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date t...
SELECT apt_number FROM apartments ORDER BY bedroom_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 apartment number of the apartment with the most beds? ### Input: CREATE TABLE guests ( guest_id number, ...
Show how many delegates in each county with a pie chart.
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_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 how many delegates in each county with a pie chart. ### Input: CREATE TABLE county ( County_Id int, County_name...
thanks and what 's the last flight back from WASHINGTON to BOSTON
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, 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 = 'BO...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: thanks and what 's the last flight back from WASHINGTON to BOSTON ### Input: CREATE TABLE airline ( airline_code varchar...
What is the most recent year that the Mineola Twins was nominated for outstanding actress in a play and a Drama Desk award?
CREATE TABLE table_name_54 ( year INTEGER, award VARCHAR, nominated_work VARCHAR, category VARCHAR )
SELECT MAX(year) FROM table_name_54 WHERE nominated_work = "the mineola twins" AND category = "outstanding actress in a play" AND award = "drama desk award"
Below are sql tables 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 that the Mineola Twins was nominated for outstanding actress in a play and a Drama Desk award? ...
What is the San Antonio's team score?
CREATE TABLE table_17288825_5 ( score VARCHAR, team VARCHAR )
SELECT score FROM table_17288825_5 WHERE team = "San Antonio"
Below are sql tables 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 San Antonio's team score? ### Input: CREATE TABLE table_17288825_5 ( score VARCHAR, team VARCHAR ) ### R...
How many competitions for each country?
CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE player ( Player_ID int, name text, Position text, Clu...
SELECT Country, COUNT(Country) FROM competition 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: How many competitions for each country? ### Input: CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, ...
What is the latest year that data is available for?
CREATE TABLE table_25414 ( "Year" real, "Majors" real, "ATP wins" real, "Total wins" real, "Earnings ($)" real, "Money list rank" real )
SELECT MAX("Year") FROM table_25414
Below are sql tables 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 latest year that data is available for? ### Input: CREATE TABLE table_25414 ( "Year" real, "Majors" real...
what was the first height of patient 3369 until 30 months ago?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3369)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ...
Below are sql tables 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 first height of patient 3369 until 30 months ago? ### Input: CREATE TABLE cost ( row_id number, subject...
A pie chart shows the proportion of All_Home and the sum of school id.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A pie chart shows the proportion of All_Home and the sum of school id. ### Input: CREATE TABLE university ( School_ID in...
how many patients of black/haitian ethnicity had their lab test item id 50904?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND lab.itemid = "50904"
Below are sql tables 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 of black/haitian ethnicity had their lab test item id 50904? ### Input: CREATE TABLE lab ( subject_id ...
what is the top four most frequent diagnoses for patients aged 20s in this year?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the top four most frequent diagnoses for patients aged 20s in this year? ### Input: CREATE TABLE admissions ( ro...
Playing against the Seattle Seahawks in a week after week 1 before 69,149 people what was the result of the game?
CREATE TABLE table_64351 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Result" FROM table_64351 WHERE "Week" > '1' AND "Attendance" = '69,149' AND "Opponent" = 'seattle seahawks'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Playing against the Seattle Seahawks in a week after week 1 before 69,149 people what was the result of the game? ### Input:...
what is the average hospital cost for a patient suffering from hernia nec until 2104?
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hernia nec')) AND STRFTIME('%y', cost.chargetime) <= '2104' GRO...
Below are sql tables 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 hospital cost for a patient suffering from hernia nec until 2104? ### Input: CREATE TABLE prescriptions ...
what is the number of patients whose age is less than 43 and lab test fluid is joint fluid?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Joint Fluid"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose age is less than 43 and lab test fluid is joint fluid? ### Input: CREATE TABLE prescrip...
Show me about the correlation between School_ID and ACC_Percent , and group by attribute All_Road in a scatter chart.
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 School_ID, ACC_Percent FROM basketball_match GROUP BY All_Road
Below are sql tables 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 about the correlation between School_ID and ACC_Percent , and group by attribute All_Road in a scatter chart. ### In...
Pie chart. how many counties correspond to each police force?
CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, Black real, Amerindian real, Asian real, Multiracial real, Hispanic real ) CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_offi...
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Pie chart. how many counties correspond to each police force? ### Input: CREATE TABLE city ( City_ID int, County_ID ...
How many workshops did each author submit to? Return the author name and the number of workshops Plot them as bar chart, and I want to show by the y axis from low to high.
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text )
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY COUNT(DISTINCT T1.Workshop_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: How many workshops did each author submit to? Return the author name and the number of workshops Plot them as bar chart, and...
Who answered the 20 questions on 10-07?
CREATE TABLE table_1566852_8 ( date VARCHAR )
SELECT 20 AS _questions FROM table_1566852_8 WHERE date = "10-07"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who answered the 20 questions on 10-07? ### Input: CREATE TABLE table_1566852_8 ( date VARCHAR ) ### Response: SELECT 20...
What is the finish of Australia?
CREATE TABLE table_49996 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
SELECT "Finish" FROM table_49996 WHERE "Country" = 'australia'
Below are sql tables 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 finish of Australia? ### Input: CREATE TABLE table_49996 ( "Player" text, "Country" text, "Year(s) w...
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 average of department_id over the hire_date bin hire_date by time by a bar chart, and list mean department id from high to low order.
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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(25...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_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 ...
Top 200 users from Netherlands.
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%netherlands%' OR UPPER(Location) LIKE '%NETHERL' ORDER BY Reputation DESC LIMIT 200
Below are sql tables 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 200 users from Netherlands. ### Input: CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskR...
what was the first drug being prescribed for patient 028-55503 during the last month?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55503')) AND DATETIME(medication.drugstarttime, 'start of 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: what was the first drug being prescribed for patient 028-55503 during the last month? ### Input: CREATE TABLE treatment ( ...
i would like to know flights on 6 15 from LONG BEACH to COLUMBUS after 1200 please
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description...
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 ((date_day.day_number = 15 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_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: i would like to know flights on 6 15 from LONG BEACH to COLUMBUS after 1200 please ### Input: CREATE TABLE airport ( air...
Which 2008-12 has a 2007 of A, and a Tournament of us open?
CREATE TABLE table_33985 ( "Tournament" text, "2006" text, "2007" text, "2008-12" text, "2013" text )
SELECT "2008-12" FROM table_33985 WHERE "2007" = 'a' AND "Tournament" = 'us open'
Below are sql tables 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 2008-12 has a 2007 of A, and a Tournament of us open? ### Input: CREATE TABLE table_33985 ( "Tournament" text, ...
Find the average age of students living in each dorm and the name of dorm.
CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm_amenity ( amenid number, amenity_...
SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_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 average age of students living in each dorm and the name of dorm. ### Input: CREATE TABLE dorm ( dormid number,...
What is the largest number in L?
CREATE TABLE table_29565601_2 ( l INTEGER )
SELECT MAX(l) FROM table_29565601_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 largest number in L? ### Input: CREATE TABLE table_29565601_2 ( l INTEGER ) ### Response: SELECT MAX(l) FROM...
How many ranks have a Bronze smaller than 8, and a Total smaller than 7, and a Gold smaller than 1?
CREATE TABLE table_name_1 ( rank VARCHAR, gold VARCHAR, bronze VARCHAR, total VARCHAR )
SELECT COUNT(rank) FROM table_name_1 WHERE bronze < 8 AND total < 7 AND gold < 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 ranks have a Bronze smaller than 8, and a Total smaller than 7, and a Gold smaller than 1? ### Input: CREATE TABLE ...
What was the record of the game that went 0-7?
CREATE TABLE table_15093 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Record" FROM table_15093 WHERE "Score" = '0-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 was the record of the game that went 0-7? ### Input: CREATE TABLE table_15093 ( "Date" text, "Opponent" text, ...
Which total number of Week has an Opponent of at new orleans saints, and an Attendance larger than 53,448?
CREATE TABLE table_name_17 ( week VARCHAR, opponent VARCHAR, attendance VARCHAR )
SELECT COUNT(week) FROM table_name_17 WHERE opponent = "at new orleans saints" AND attendance > 53 OFFSET 448
Below are sql tables 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 total number of Week has an Opponent of at new orleans saints, and an Attendance larger than 53,448? ### Input: CREATE...
What is the highest points value for 1962, in the 125cc class, and with 0 wins?
CREATE TABLE table_name_66 ( points INTEGER, wins VARCHAR, year VARCHAR, class VARCHAR )
SELECT MAX(points) FROM table_name_66 WHERE year = 1962 AND class = "125cc" AND wins < 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 highest points value for 1962, in the 125cc class, and with 0 wins? ### Input: CREATE TABLE table_name_66 ( ...
A bar chart for what are the number of the names of all races held between 2009 and 2011?, could you sort by the Y-axis in ascending?
CREATE TABLE lapTimes ( raceId INTEGER, driverId INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER ) CREATE TABLE circuits ( circuitId INTEGER, circuitRef TEXT, name TEXT, location TEXT, country TEXT, lat REAL, lng REAL, alt TEXT, url TE...
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY COUNT(name)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart for what are the number of the names of all races held between 2009 and 2011?, could you sort by the Y-axis in a...
Which game site has an Opponent of buffalo bills?
CREATE TABLE table_name_75 ( game_site VARCHAR, opponent VARCHAR )
SELECT game_site FROM table_name_75 WHERE opponent = "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: Which game site has an Opponent of buffalo bills? ### Input: CREATE TABLE table_name_75 ( game_site VARCHAR, opponen...
What was the Name of the person with a Qual 1 of 1:26.056?
CREATE TABLE table_name_59 ( name VARCHAR, qual_1 VARCHAR )
SELECT name FROM table_name_59 WHERE qual_1 = "1:26.056"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the Name of the person with a Qual 1 of 1:26.056? ### Input: CREATE TABLE table_name_59 ( name VARCHAR, qua...
Return a histogram on what is the average high temperature for each day of week?, I want to rank by the bar in desc.
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 weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperat...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on what is the average high temperature for each day of week?, I want to rank by the bar in desc. ### Inp...
What are the number of the dates of transactions with at least 100 share count or amount bigger than 100?
CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE T...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the number of the dates of transactions with at least 100 share count or amount bigger than 100? ### Input: CREATE ...
Show the number of courses each instructor taught in a bar chart, and order in asc by the how many emp fname please.
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CL...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of courses each instructor taught in a bar chart, and order in asc by the how many emp fname please. ### Inp...
provide the number of patients whose admission year is less than 2151 and item id is 51100?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2151" AND lab.itemid = "51100"
Below are sql tables 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 year is less than 2151 and item id is 51100? ### Input: CREATE TABLE procedur...
What was the earliest year?
CREATE TABLE table_28310 ( "Rank" real, "Player" text, "Year" real, "Opponent" text, "Passing yards" real, "Rushing yards" real, "Total offense" real )
SELECT MIN("Year") FROM table_28310
Below are sql tables 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 earliest year? ### Input: CREATE TABLE table_28310 ( "Rank" real, "Player" text, "Year" real, "...
How many medications are prescribed for each brand Visualize by bar chart, list Y in descending order.
CREATE TABLE Department ( DepartmentID INTEGER, Name VARCHAR(30), Head INTEGER ) CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER ) CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE TABLE...
SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand 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 medications are prescribed for each brand Visualize by bar chart, list Y in descending order. ### Input: CREATE TAB...
how many countries won more than 3 bronze metals ?
CREATE TABLE table_204_183 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT COUNT("nation") FROM table_204_183 WHERE "bronze" > 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: how many countries won more than 3 bronze metals ? ### Input: CREATE TABLE table_204_183 ( id number, "rank" number,...
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and price , and group by attribute headquarter, I want to rank Y in desc order.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price 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, visualize a bar chart about the distribution of name an...
How many people lived in the city which has 1.2530 km in the year 2000?
CREATE TABLE table_23511 ( "No." real, "Barangay" text, "Area (in km 2 )" text, "Rank" real, "Population (2000)" real, "Population (2007)" real, "Population (2010)" real, "Population Density (2010)" text )
SELECT MAX("Population (2000)") FROM table_23511 WHERE "Area (in km 2 )" = '1.2530'
Below are sql tables 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 people lived in the city which has 1.2530 km in the year 2000? ### Input: CREATE TABLE table_23511 ( "No." real...
what is the pick number minimum if the NFL team is the San Diego Chargers?
CREATE TABLE table_3234 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
SELECT MIN("Pick #") FROM table_3234 WHERE "NFL Team" = 'San Diego Chargers'
Below are sql tables 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 pick number minimum if the NFL team is the San Diego Chargers? ### Input: CREATE TABLE table_3234 ( "Pick #"...
What is the Apparent magnitude of a Declination (J2000) of 39 45 ?
CREATE TABLE table_58536 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real )
SELECT MIN("Apparent magnitude") FROM table_58536 WHERE "Declination ( J2000 )" = '°39′45″'
Below are sql tables 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 Apparent magnitude of a Declination (J2000) of 39 45 ? ### Input: CREATE TABLE table_58536 ( "NGC number" re...
Which position has a pick greater than 28?
CREATE TABLE table_name_31 ( position VARCHAR, pick INTEGER )
SELECT position FROM table_name_31 WHERE pick > 28
Below are sql tables 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 position has a pick greater than 28? ### Input: CREATE TABLE table_name_31 ( position VARCHAR, pick INTEGER ) ...
show me the direct flights from SAN FRANCISCO to BOSTON
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me the direct flights from SAN FRANCISCO to BOSTON ### Input: CREATE TABLE date_day ( month_number int, day_num...
What is the university where the soccer stadium is terrain #2 of complexe sportif claude-robillard?
CREATE TABLE table_29456 ( "University" text, "Varsity Name" text, "City" text, "Province" text, "Founded" real, "Soccer Stadium" text, "Stadium Capacity" real )
SELECT "University" FROM table_29456 WHERE "Soccer Stadium" = 'terrain #2 of Complexe sportif Claude-Robillard'
Below are sql tables 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 university where the soccer stadium is terrain #2 of complexe sportif claude-robillard? ### Input: CREATE TABLE ...
what were the five most frequent drugs that were prescribed during the same month to the female patients with age 50s after they have been diagnosed with adv eff anticoagulants, the last year?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five most frequent drugs that were prescribed during the same month to the female patients with age 50s after ...
count the number of patients born before 2156 who left against medical advice.
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 WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" 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 born before 2156 who left against medical advice. ### Input: CREATE TABLE procedures ( subj...
The Fall 2005 CMBIOL 995 classes are taught by how many professors ?
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 COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CMBIOL' AND course.number = 995 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off...
Below are sql tables 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 Fall 2005 CMBIOL 995 classes are taught by how many professors ? ### Input: CREATE TABLE program ( program_id int, ...
give me the number of patients whose ethnicity is black/cape verdean and diagnoses icd9 code is 7810?
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.icd9_code = "7810"
Below are sql tables 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 ethnicity is black/cape verdean and diagnoses icd9 code is 7810? ### Input: CREATE TABL...
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of revenue , and group by attribute name in a bar chart, order y axis from high to low order.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue 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, show me about the distribution of name and the average ...
What are the Poles for Season 2006
CREATE TABLE table_44589 ( "Season" real, "Series" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text )
SELECT "Poles" FROM table_44589 WHERE "Season" = '2006'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the Poles for Season 2006 ### Input: CREATE TABLE table_44589 ( "Season" real, "Series" text, "Races" t...
how many days have elapsed since the first time that patient 012-66291 had a procedure on the current hospital encounter?
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-66291'...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many days have elapsed since the first time that patient 012-66291 had a procedure on the current hospital encounter? ##...
What is the sum of week number(s) had an attendance of 61,985?
CREATE TABLE table_74651 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT COUNT("Week") FROM table_74651 WHERE "Attendance" = '61,985'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of week number(s) had an attendance of 61,985? ### Input: CREATE TABLE table_74651 ( "Week" real, "D...
Compare the smallest enrollment of schools in each state using a bar chart, and I want to display by the X-axis in asc.
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) )
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY cName
Below are sql tables 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 the smallest enrollment of schools in each state using a bar chart, and I want to display by the X-axis in asc. ### ...
For the Sociocultural Laboratory class , what is its course number ?
CREATE TABLE ta ( campus_job_id int, student_id int, location 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 varchar, state varchar, countr...
SELECT DISTINCT number FROM course WHERE (description LIKE '%Sociocultural Laboratory%' OR name LIKE '%Sociocultural Laboratory%') AND department = 'EECS'
Below are sql tables 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 the Sociocultural Laboratory class , what is its course number ? ### Input: CREATE TABLE ta ( campus_job_id int, ...
when was the first time in which patient 19412 had the maximum arterial bp [diastolic] today?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime ti...
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 = 19412)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time in which patient 19412 had the maximum arterial bp [diastolic] today? ### Input: CREATE TABLE d_labi...
count the number of patients whose admission year is less than 2157 and diagnoses short title is intermed coronary synd?
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.admityear < "2157" AND diagnoses.short_title = "Intermed coronary synd"
Below are sql tables 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 year is less than 2157 and diagnoses short title is intermed coronary synd? ###...
provide the number of patients whose age is less than 54 and lab test name is specific gravity?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "54" AND lab.label = "Specific Gravity"
Below are sql tables 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 age is less than 54 and lab test name is specific gravity? ### Input: CREATE TABLE pres...
What is the number of bronze medals when there are fewer than 0 silver medals?
CREATE TABLE table_78124 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT SUM("Bronze") FROM table_78124 WHERE "Silver" < '0'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of bronze medals when there are fewer than 0 silver medals? ### Input: CREATE TABLE table_78124 ( "Ra...
What is Nick Price's score?
CREATE TABLE table_14870 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Score" FROM table_14870 WHERE "Player" = 'nick price'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Nick Price's score? ### Input: CREATE TABLE table_14870 ( "Place" text, "Player" text, "Country" text, ...
For each zip code, return how many times max wind speed reached 25?
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_stat...
SELECT zip_code, COUNT(*) FROM weather WHERE max_wind_speed_mph >= 25 GROUP BY zip_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: For each zip code, return how many times max wind speed reached 25? ### Input: CREATE TABLE station ( id number, nam...
when was the last microbiological test of patient 031-3355 performed in 12/2105?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '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: when was the last microbiological test of patient 031-3355 performed in 12/2105? ### Input: CREATE TABLE lab ( labid num...
If the country of Origin is South Africa, who is the primary user?
CREATE TABLE table_26389588_1 ( primary_user VARCHAR, country_of_origin VARCHAR )
SELECT primary_user FROM table_26389588_1 WHERE country_of_origin = "South Africa"
Below are sql tables 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 country of Origin is South Africa, who is the primary user? ### Input: CREATE TABLE table_26389588_1 ( primary_us...
What kind of animal corresponds to the accession number xp_852505.1?
CREATE TABLE table_20071 ( "Genus/Species" text, "Common Name" text, "Accession Number" text, "Length" text, "Similarity" text, "Identity" text )
SELECT "Common Name" FROM table_20071 WHERE "Accession Number" = 'XP_852505.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 kind of animal corresponds to the accession number xp_852505.1? ### Input: CREATE TABLE table_20071 ( "Genus/Specie...
What lane had a heat after 12, a rank of 38 and a time larger than 22.67?
CREATE TABLE table_64755 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
SELECT AVG("Lane") FROM table_64755 WHERE "Heat" > '12' AND "Rank" = '38' AND "Time" > '22.67'
Below are sql tables 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 lane had a heat after 12, a rank of 38 and a time larger than 22.67? ### Input: CREATE TABLE table_64755 ( "Rank" r...
Return the low and high estimates for all film markets. Show scatter chart.
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Mar...
SELECT Low_Estimate, High_Estimate FROM film_market_estimation
Below are sql tables 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 low and high estimates for all film markets. Show scatter chart. ### Input: CREATE TABLE film_market_estimation (...
What is the mean number of laps when the grid is less than 19 and time/retired is +21.3 secs?
CREATE TABLE table_name_56 ( laps INTEGER, grid VARCHAR, time_retired VARCHAR )
SELECT AVG(laps) FROM table_name_56 WHERE grid < 19 AND time_retired = "+21.3 secs"
Below are sql tables 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 mean number of laps when the grid is less than 19 and time/retired is +21.3 secs? ### Input: CREATE TABLE table_...
Draw a scatter chart about the correlation between School_ID and ACC_Percent , and group by attribute All_Road.
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 School_ID, ACC_Percent FROM basketball_match GROUP BY All_Road
Below are sql tables 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 scatter chart about the correlation between School_ID and ACC_Percent , and group by attribute All_Road. ### Input: C...
What is the average grid for competitors who had more than 22 laps and time/retired of +17.276?
CREATE TABLE table_78507 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT AVG("Grid") FROM table_78507 WHERE "Time/Retired" = '+17.276' AND "Laps" > '22'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average grid for competitors who had more than 22 laps and time/retired of +17.276? ### Input: CREATE TABLE tabl...
What is the original date of the repeat air date of 26/01/1969?
CREATE TABLE table_13403120_1 ( originalairdate VARCHAR, repeatairdate_s_ VARCHAR )
SELECT originalairdate FROM table_13403120_1 WHERE repeatairdate_s_ = "26/01/1969"
Below are sql tables 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 original date of the repeat air date of 26/01/1969? ### Input: CREATE TABLE table_13403120_1 ( originalairda...
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, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTME...
SELECT HIRE_DATE, SUM(SALARY) 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 ...
are patient 1902's arterial bp [diastolic] normal on their first hospital encounter?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id...
SELECT COUNT(*) > 0 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 = 1902 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemid IN (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: are patient 1902's arterial bp [diastolic] normal on their first hospital encounter? ### Input: CREATE TABLE chartevents ( ...
how many patients were diagnosed with adv eff blood agent nec who did not return to the hospital in the same month in 2105?
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 transfers ( row_id number,...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adv eff bl...
Below are sql tables 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 were diagnosed with adv eff blood agent nec who did not return to the hospital in the same month in 2105? ...
User's comments ordered by score.
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( ...
SELECT Score, Text, PostId AS "post_link" FROM Comments WHERE UserId = '##UserId:int##' ORDER BY Score 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: User's comments ordered by score. ### Input: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeType...
Visualize a bar chart for what are the different classes of races, and how many races correspond to each?, list by the y-axis from high to low.
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
SELECT Class, COUNT(*) FROM race GROUP BY Class 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: Visualize a bar chart for what are the different classes of races, and how many races correspond to each?, list by the y-axi...
how many credits does the department offer?, and order from high to low by the X-axis.
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 CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_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 credits does the department offer?, and order from high to low by the X-axis. ### Input: CREATE TABLE EMPLOYEE ( ...
Find the number of products for each manufacturer, showing the name of each company Show bar chart, display by the bar in desc.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.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 products for each manufacturer, showing the name of each company Show bar chart, display by the bar in de...
How many wines are there for each grape, sort y axis from low to high order.
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape 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 wines are there for each grape, sort y axis from low to high order. ### Input: CREATE TABLE grapes ( ID INTEGER...
How many attendances have 9 as the week?
CREATE TABLE table_name_78 ( attendance VARCHAR, week VARCHAR )
SELECT COUNT(attendance) FROM table_name_78 WHERE 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: How many attendances have 9 as the week? ### Input: CREATE TABLE table_name_78 ( attendance VARCHAR, week VARCHAR ) ...