instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Who was the writter for the episode identified by the production code 2t5954?
CREATE TABLE table_73966 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Patient Portrayer" text, "Original air date" text, "Production code" text )
SELECT "Written by" FROM table_73966 WHERE "Production code" = '2T5954'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the writter for the episode identified by the production code 2t5954? ### Input: CREATE TABLE table_73966 ( "No....
What was the crowd attendance when the home team was Melbourne?
CREATE TABLE table_name_73 ( crowd VARCHAR, home_team VARCHAR )
SELECT COUNT(crowd) FROM table_name_73 WHERE home_team = "melbourne"
Below are sql tables 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 crowd attendance when the home team was Melbourne? ### Input: CREATE TABLE table_name_73 ( crowd VARCHAR, ...
what is the number of patients whose admission year is less than 2162 and procedure long title is percutaneous [endoscopic] gastrojejunostomy?
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.admityear < "2162" AND procedures.long_title = "Percutaneous [endoscopic] gastrojejunostomy"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission year is less than 2162 and procedure long title is percutaneous [endoscopic] ...
count the number of patients whose diagnoses long title is unspecified hereditary and idiopathic peripheral neuropathy and lab test category is hematology?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Unspecified hereditary and idiopathic peripheral neuropathy" AND lab."CATEGORY" = "Hematology"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose diagnoses long title is unspecified hereditary and idiopathic peripheral neuropathy and l...
For 499 , next semester , will Prof. Frank Anderson be teaching the class ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 499 AND instructor.name LIKE '%Frank Anderson%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_...
Below are sql tables 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 499 , next semester , will Prof. Frank Anderson be teaching the class ? ### Input: CREATE TABLE jobs ( job_id int, ...
What is the Score 1 of Tie no 6?
CREATE TABLE table_name_46 ( score_1 VARCHAR, tie_no VARCHAR )
SELECT score_1 FROM table_name_46 WHERE tie_no = "6"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Score 1 of Tie no 6? ### Input: CREATE TABLE table_name_46 ( score_1 VARCHAR, tie_no VARCHAR ) ### Respo...
Do you have to take a lab with 523 ?
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE requirement ( requiremen...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 523
Below are sql tables 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 to take a lab with 523 ? ### Input: CREATE TABLE semester ( semester_id int, semester varchar, year ...
What is the date, average temperature and mean humidity for the days with the 3 largest maximum gust speeds?
CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE status ( station_id numb...
SELECT date, mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the date, average temperature and mean humidity for the days with the 3 largest maximum gust speeds? ### Input: CREA...
Visualize a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, sort by the Y-axis in asc.
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_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: Visualize a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, s...
Compare the number of items in the type of each thing using a bar chart, and sort by the names in descending.
CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, da...
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things GROUP BY Type_of_Thing_Code ORDER BY Type_of_Thing_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: Compare the number of items in the type of each thing using a bar chart, and sort by the names in descending. ### Input: CRE...
Which date has a Opponent of juan m naco, and a Score of 6 2, 4 6, 7 6 (7 3)?
CREATE TABLE table_55034 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text )
SELECT "Date" FROM table_55034 WHERE "Opponent" = 'juan mónaco' AND "Score" = '6–2, 4–6, 7–6 (7–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: Which date has a Opponent of juan m naco, and a Score of 6 2, 4 6, 7 6 (7 3)? ### Input: CREATE TABLE table_55034 ( "Out...
Name the date with outcome of winner and score of 4 6 6 2 7 6 (7 4)
CREATE TABLE table_name_25 ( date VARCHAR, outcome VARCHAR, score VARCHAR )
SELECT date FROM table_name_25 WHERE outcome = "winner" AND score = "4–6 6–2 7–6 (7–4)"
Below are sql tables 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 date with outcome of winner and score of 4 6 6 2 7 6 (7 4) ### Input: CREATE TABLE table_name_25 ( date VARCHAR...
how many patients whose admission type is newborn and days of hospital stay is greater than 10?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.days_stay > "10"
Below are sql tables 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 admission type is newborn and days of hospital stay is greater than 10? ### Input: CREATE TABLE diag...
Who was the head coach in season 2?
CREATE TABLE table_14015965_1 ( head_coach VARCHAR, previous_season VARCHAR )
SELECT head_coach FROM table_14015965_1 WHERE previous_season = "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: Who was the head coach in season 2? ### Input: CREATE TABLE table_14015965_1 ( head_coach VARCHAR, previous_season V...
has patient 61591 had any type of diagnosis in 2105?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61591) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105'
Below are sql tables 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 61591 had any type of diagnosis in 2105? ### Input: CREATE TABLE d_labitems ( row_id number, itemid numb...
I want to know the proportion of the total number for each customer status code.
CREATE TABLE Staff ( staff_id INTEGER, staff_address_id INTEGER, nickname VARCHAR(80), first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), date_of_birth DATETIME, date_joined_staff DATETIME, date_left_staff DATETIME ) CREATE TABLE Vehicles ( vehicle_id INTEGE...
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_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: I want to know the proportion of the total number for each customer status code. ### Input: CREATE TABLE Staff ( staff_i...
how many nations won no silver medals at all ?
CREATE TABLE table_203_165 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT COUNT("nation") FROM table_203_165 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: how many nations won no silver medals at all ? ### Input: CREATE TABLE table_203_165 ( id number, "rank" number, ...
list lowest cost flight from DALLAS to BALTIMORE that serves a meal
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_...
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.ai...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list lowest cost flight from DALLAS to BALTIMORE that serves a meal ### Input: CREATE TABLE time_interval ( period text,...
Find the names of the campus which has more faculties in 2002 than every campus in Orange county.
CREATE TABLE campuses ( campus VARCHAR, id VARCHAR, county VARCHAR ) CREATE TABLE faculty ( campus VARCHAR, year VARCHAR )
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
Below are sql tables 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 names of the campus which has more faculties in 2002 than every campus in Orange county. ### Input: CREATE TABLE ca...
List the name and the number of enrolled student for each course in a bar chart, and could you show in desc by the X-axis?
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY course_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: List the name and the number of enrolled student for each course in a bar chart, and could you show in desc by the X-axis? #...
is there a round trip flight from ATLANTA to DALLAS via DENVER
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
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, fare, flight, flight_fare, flight_stop WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'DE...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is there a round trip flight from ATLANTA to DALLAS via DENVER ### Input: CREATE TABLE time_zone ( time_zone_code text, ...
what was the average value for sao2 for patient 016-18150 on last month/03?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT AVG(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150')) AND NOT vitalperiodic.sao2 IS NULL AND DATET...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the average value for sao2 for patient 016-18150 on last month/03? ### Input: CREATE TABLE cost ( costid number...
what intake did patient 004-79017 have the last time on the current intensive care unit visit.
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017') AND patient.unitdischargetime IS NULL) AND intak...
Below are sql tables 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 intake did patient 004-79017 have the last time on the current intensive care unit visit. ### Input: CREATE TABLE diagn...
Which Name has a Number of electorates (2009) greater than 188,799?
CREATE TABLE table_name_56 ( name VARCHAR, number_of_electorates__2009_ INTEGER )
SELECT name FROM table_name_56 WHERE number_of_electorates__2009_ > 188 OFFSET 799
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Name has a Number of electorates (2009) greater than 188,799? ### Input: CREATE TABLE table_name_56 ( name VARCHAR...
Find the name and account balance of the customer whose name includes the letter a Visualize them using a bar chart, and order by the y-axis in ascending please.
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), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, s...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal
Below are sql tables 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 name and account balance of the customer whose name includes the letter a Visualize them using a bar chart, and ord...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 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: For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about t...
where is the best restaurant in the bay area for american food ?
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: where is the best restaurant in the bay area for american food ? ### Input: CREATE TABLE geographic ( city_name varchar,...
what the last height of patient 21074.
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( ...
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 = 21074)) 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 the last height of patient 21074. ### Input: CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
How many series had viewers totaling 23.93 million?
CREATE TABLE table_22209 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
SELECT COUNT("Series #") FROM table_22209 WHERE "U.S. viewers (millions)" = '23.93'
Below are sql tables 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 series had viewers totaling 23.93 million? ### Input: CREATE TABLE table_22209 ( "Series #" real, "Season #...
What is the lowest swimsuit for a contestant with an average of 9.125?
CREATE TABLE table_name_38 ( swimsuit INTEGER, average VARCHAR )
SELECT MIN(swimsuit) FROM table_name_38 WHERE average = 9.125
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest swimsuit for a contestant with an average of 9.125? ### Input: CREATE TABLE table_name_38 ( swimsuit ...
when was the first time on the current intensive care unit visit patient 12775 reached the minimum arterial bp mean?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime 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 admissions...
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 = 12775) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH...
Below are sql tables 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 on the current intensive care unit visit patient 12775 reached the minimum arterial bp mean? ### Inp...
Show all the activity names and the number of faculty involved in each activity Show bar chart, list bar in desc order.
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_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: Show all the activity names and the number of faculty involved in each activity Show bar chart, list bar in desc order. ### ...
Name the loss with record of 14-19
CREATE TABLE table_68892 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
SELECT "Loss" FROM table_68892 WHERE "Record" = '14-19'
Below are sql tables 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 loss with record of 14-19 ### Input: CREATE TABLE table_68892 ( "Date" text, "Opponent" text, "Score" t...
serum creatinine > 2 mg / dl
CREATE TABLE table_test_13 ( "id" int, "systolic_blood_pressure_sbp" int, "tachycardia" int, "diastolic_blood_pressure_dbp" int, "total_cholesterol" int, "high_density_lipoprotein_cholesterol_hdl_c" int, "serum_creatinine" float, "alcohol_abuse" bool, "drug_abuse" bool, "body_mas...
SELECT * FROM table_test_13 WHERE serum_creatinine > 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: serum creatinine > 2 mg / dl ### Input: CREATE TABLE table_test_13 ( "id" int, "systolic_blood_pressure_sbp" int, ...
how many patients are diagnosed with primary disease bowel obstruction and with admission year before 2162?
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 = "BOWEL OBSTRUCTION" AND demographic.admityear < "2162"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients are diagnosed with primary disease bowel obstruction and with admission year before 2162? ### Input: CREAT...
Draw a scatterplot of team id vs all_games_percent where team id is on the x-axis and points are colored by All_Games
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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Games
Below are sql tables 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 scatterplot of team id vs all_games_percent where team id is on the x-axis and points are colored by All_Games ### In...
which was the first chinese star map known to have been created ?
CREATE TABLE table_204_281 ( id number, "map or catalog" text, "creator" text, "time created" text, "contets" text, "links" text )
SELECT "map or catalog" FROM table_204_281 ORDER BY id LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which was the first chinese star map known to have been created ? ### Input: CREATE TABLE table_204_281 ( id number, ...
Which courses in Mentorship- Multidisciplinary Design satisfy the ULCS requirement ?
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 INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Mentorship- Multidisciplinary Design%' OR course.description LIKE '%Mentorship- Multidisciplinar...
Below are sql tables 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 courses in Mentorship- Multidisciplinary Design satisfy the ULCS requirement ? ### Input: CREATE TABLE course_tags_cou...
give me the list of patients with lab test item id 50824 who died in or before 2115.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2115.0" AND lab.itemid = "50824"
Below are sql tables 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 list of patients with lab test item id 50824 who died in or before 2115. ### Input: CREATE TABLE procedures ( ...
Return a bar chart about the number of companies for each industry, list from high to low by the bars please.
CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Graduation_College text ) CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sale...
SELECT Industry, COUNT(Industry) FROM company GROUP BY Industry ORDER BY Industry 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 bar chart about the number of companies for each industry, list from high to low by the bars please. ### Input: CRE...
WHAT IS THE TO PAR FOR ERNIE ELS?
CREATE TABLE table_45785 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
SELECT "To par" FROM table_45785 WHERE "Player" = 'ernie els'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: WHAT IS THE TO PAR FOR ERNIE ELS? ### Input: CREATE TABLE table_45785 ( "Place" text, "Player" text, "Country" t...
until 1 year ago, how many times was the hrt revas byps anas nec done?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_lab...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hrt revas byps anas nec') AND DATETIME(procedures_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: until 1 year ago, how many times was the hrt revas byps anas nec done? ### Input: CREATE TABLE labevents ( row_id number...
Sum the average prices of wines for different years, and bin year attribute into weekday interval for a bar chart, I want to list by the total number from high to low.
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT Year, SUM(AVG(Price)) FROM wine ORDER BY SUM(AVG(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: Sum the average prices of wines for different years, and bin year attribute into weekday interval for a bar chart, I want to...
how many patients were given the drug ferrous gluconate?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Ferrous Gluconate"
Below are sql tables 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 given the drug ferrous gluconate? ### Input: CREATE TABLE prescriptions ( subject_id text, ha...
What is the average number of points for a team that played 17 games and had more than 15 losses?
CREATE TABLE table_name_37 ( points INTEGER, games VARCHAR, losses VARCHAR )
SELECT AVG(points) FROM table_name_37 WHERE games = 17 AND losses > 15
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average number of points for a team that played 17 games and had more than 15 losses? ### Input: CREATE TABLE ta...
how many patients diagnosed with icd9 code 32723 had a self pay status?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.icd9_code = "32723"
Below are sql tables 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 diagnosed with icd9 code 32723 had a self pay status? ### Input: CREATE TABLE diagnoses ( subject_id t...
What is the bronze number for the nation with less than 0 gold?
CREATE TABLE table_name_53 ( bronze INTEGER, gold INTEGER )
SELECT MIN(bronze) FROM table_name_53 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 is the bronze number for the nation with less than 0 gold? ### Input: CREATE TABLE table_name_53 ( bronze INTEGER, ...
Draw a bar chart for how many different locations does each school have?, I want to list X-axis in ascending order.
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ...
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY SCHOOL_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: Draw a bar chart for how many different locations does each school have?, I want to list X-axis in ascending order. ### Inpu...
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, find job_id and the amount of job_id , and group by attribute job_id, and visualize them by a bar chart, and order in desc by the names.
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
What are the names of manufacturers with revenue greater than the average of all revenues?
CREATE TABLE products ( code number, name text, price number, manufacturer number ) CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number )
SELECT name FROM manufacturers WHERE revenue > (SELECT AVG(revenue) FROM manufacturers)
Below are sql tables 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 of manufacturers with revenue greater than the average of all revenues? ### Input: CREATE TABLE products ...
Find ACC_Regular_Season and ACC_Percent , and visualize them by a bar chart, display from low to high by the X-axis.
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_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find ACC_Regular_Season and ACC_Percent , and visualize them by a bar chart, display from low to high by the X-axis. ### Inp...
Which competition in Budapest, Hungary gave a result of 8th?
CREATE TABLE table_36822 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
SELECT "Competition" FROM table_36822 WHERE "Position" = '8th' AND "Venue" = 'budapest, hungary'
Below are sql tables 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 competition in Budapest, Hungary gave a result of 8th? ### Input: CREATE TABLE table_36822 ( "Year" real, "Com...
Who are all the Moto2 winners when the grand prix was Shell Advance Malaysian Grand Prix?
CREATE TABLE table_3641 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "MotoGP winner" text, "Moto2 winner" text, "125cc winner" text, "Report" text )
SELECT "Moto2 winner" FROM table_3641 WHERE "Grand Prix" = 'Shell Advance Malaysian Grand Prix'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who are all the Moto2 winners when the grand prix was Shell Advance Malaysian Grand Prix? ### Input: CREATE TABLE table_3641...
Draw a bar chart for how many students are affected by each allergy type?
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart for how many students are affected by each allergy type? ### Input: CREATE TABLE Allergy_Type ( Allergy...
A bar chart shows the distribution of date_address_to and the sum of monthly_rental bin date_address_to by weekday.
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of date_address_to and the sum of monthly_rental bin date_address_to by weekday. ### Inpu...
Which Surface has a score of 7-5, 5-7, 6-3?
CREATE TABLE table_name_16 ( surface VARCHAR, score VARCHAR )
SELECT surface FROM table_name_16 WHERE score = "7-5, 5-7, 6-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: Which Surface has a score of 7-5, 5-7, 6-3? ### Input: CREATE TABLE table_name_16 ( surface VARCHAR, score VARCHAR )...
Tell me the least Grid with points more than 11 and drivers being s bastien bourdais with laps less than 67
CREATE TABLE table_52643 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
SELECT MIN("Grid") FROM table_52643 WHERE "Points" > '11' AND "Driver" = 'sébastien bourdais' AND "Laps" < '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: Tell me the least Grid with points more than 11 and drivers being s bastien bourdais with laps less than 67 ### Input: CREAT...
What was the top crowd when the team scored 12.15 (87) at home?
CREATE TABLE table_56940 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT MAX("Crowd") FROM table_56940 WHERE "Home team score" = '12.15 (87)'
Below are sql tables 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 top crowd when the team scored 12.15 (87) at home? ### Input: CREATE TABLE table_56940 ( "Home team" text, ...
On 24/11/1979, what is the opposing teams?
CREATE TABLE table_name_26 ( opposing_teams VARCHAR, date VARCHAR )
SELECT opposing_teams FROM table_name_26 WHERE date = "24/11/1979"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: On 24/11/1979, what is the opposing teams? ### Input: CREATE TABLE table_name_26 ( opposing_teams VARCHAR, date VARC...
Bar chart x axis nominee y axis the total number, and display from low to high by the x axis.
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int )
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY Nominee
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar chart x axis nominee y axis the total number, and display from low to high by the x axis. ### Input: CREATE TABLE musica...
What is the try bonus for the team with 67 tries for?
CREATE TABLE table_59237 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
SELECT "Try bonus" FROM table_59237 WHERE "Tries for" = '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 is the try bonus for the team with 67 tries for? ### Input: CREATE TABLE table_59237 ( "Club" text, "Played" te...
What was the attendance for the game on October 30, 1994 for a week after week 2?
CREATE TABLE table_name_54 ( attendance VARCHAR, week VARCHAR, date VARCHAR )
SELECT COUNT(attendance) FROM table_name_54 WHERE week > 2 AND date = "october 30, 1994"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the attendance for the game on October 30, 1994 for a week after week 2? ### Input: CREATE TABLE table_name_54 ( ...
What is the undecided percentage of the poll where Goldberg had 6%?
CREATE TABLE table_name_51 ( undecided VARCHAR, goldberg VARCHAR )
SELECT undecided FROM table_name_51 WHERE goldberg = "6%"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the undecided percentage of the poll where Goldberg had 6%? ### Input: CREATE TABLE table_name_51 ( undecided VA...
what airlines fly between BOSTON and SAN FRANCISCO and stop in DENVER
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_descriptio...
SELECT DISTINCT airline.airline_code FROM airline, 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 FRANC...
Below are sql tables 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 airlines fly between BOSTON and SAN FRANCISCO and stop in DENVER ### Input: CREATE TABLE fare_basis ( fare_basis_co...
Show me a bar chart for how many stadiums does each country have?, and I want to display by the total number in asc please.
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT Country, COUNT(*) FROM stadium GROUP BY Country 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: Show me a bar chart for how many stadiums does each country have?, and I want to display by the total number in asc please. ...
What are the names and account balances of customers with the letter a in their names?
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABL...
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...
Which Opponent has a Result of 0-3?
CREATE TABLE table_name_98 ( opponent VARCHAR, result VARCHAR )
SELECT opponent FROM table_name_98 WHERE result = "0-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: Which Opponent has a Result of 0-3? ### Input: CREATE TABLE table_name_98 ( opponent VARCHAR, result VARCHAR ) ### R...
I want to know the proportion of sum school id for each all home.
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_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: I want to know the proportion of sum school id for each all home. ### Input: CREATE TABLE basketball_match ( Team_ID int...
what is minimum days of hospital stay of patients whose year of death is less than 2168?
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 MIN(demographic.days_stay) FROM demographic WHERE 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: what is minimum days of hospital stay of patients whose year of death is less than 2168? ### Input: CREATE TABLE prescriptio...
Of all the upper-level classes , which ones have 1 credits ?
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Of all the upper-level classes , which ones have 1 credits ? ### Input: CREATE TABLE jobs ( job_id int, job_title va...
how much do the magnesium, urine actually cost?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium, urine'))
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much do the magnesium, urine actually cost? ### Input: CREATE TABLE diagnoses_icd ( row_id number, subject_id nu...
Just show the employee's last name and their manager's id using a bar chart, and I want to list by the y axis in descending.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Just show the employee's last name and their manager's id using a bar chart, and I want to list by the y axis in descending....
What is the average enrollment number?
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text )
SELECT AVG(enr) FROM college
Below are sql tables 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 enrollment number? ### Input: CREATE TABLE college ( cname text, state text, enr number ) C...
When the result was l 13-7 ot, who was the opponent?
CREATE TABLE table_11906 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
SELECT "Opponent" FROM table_11906 WHERE "Result" = 'l 13-7 ot'
Below are sql tables 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 result was l 13-7 ot, who was the opponent? ### Input: CREATE TABLE table_11906 ( "Week" text, "Date" text,...
How big was the crowd when the home team scored 5.14 (44)?
CREATE TABLE table_55635 ( "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_55635 WHERE "Home team score" = '5.14 (44)'
Below are sql tables 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 big was the crowd when the home team scored 5.14 (44)? ### Input: CREATE TABLE table_55635 ( "Home team" text, "...
Show me about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home in a bar chart, and rank x-axis in descending order.
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_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home in a bar chart, and rank...
i would like a US flight from TORONTO to SAN DIEGO with a stopover in DENVER please
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_cod...
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 DIEGO' AND CITY_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: i would like a US flight from TORONTO to SAN DIEGO with a stopover in DENVER please ### Input: CREATE TABLE airport_service ...
Find all the songs produced by artists with first name 'Marianne'.
CREATE TABLE Songs ( Title VARCHAR, SongId VARCHAR ) CREATE TABLE Performance ( bandmate VARCHAR, SongId VARCHAR ) CREATE TABLE Band ( id VARCHAR, firstname VARCHAR )
SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne"
Below are sql tables 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 all the songs produced by artists with first name 'Marianne'. ### Input: CREATE TABLE Songs ( Title VARCHAR, So...
Find the first names of the faculty members who are playing Canoeing or Kayaking.
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE stude...
SELECT DISTINCT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Find the first names of the faculty members who are playing Canoeing or Kayaking. ### Input: CREATE TABLE faculty_participat...
What did Melbourne score as the home team?
CREATE TABLE table_53627 ( "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_53627 WHERE "Home team" = 'melbourne'
Below are sql tables 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 did Melbourne score as the home team? ### Input: CREATE TABLE table_53627 ( "Home team" text, "Home team score"...
Show the names of journalists and the number of events they reported Visualize by bar chart, and list in asc by the Y-axis.
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name 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: Show the names of journalists and the number of events they reported Visualize by bar chart, and list in asc by the Y-axis. ...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of salary bin hire_date by weekday in a bar chart, could you show in desc by the total number?
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(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of sal...
Who was the home team when millwall was the away team?
CREATE TABLE table_name_11 ( home_team VARCHAR, away_team VARCHAR )
SELECT home_team FROM table_name_11 WHERE away_team = "millwall"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the home team when millwall was the away team? ### Input: CREATE TABLE table_name_11 ( home_team VARCHAR, aw...
return me the number of papers written by ' H. V. Jagadish ' and ' Divesh Srivastava ' .
CREATE TABLE domain_conference ( cid int, did int ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int ) CREATE TABLE cite ( cited int,...
SELECT COUNT(DISTINCT (publication.title)) FROM author AS AUTHOR_0, author AS AUTHOR_1, publication, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.name = 'H. V. Jagadish' AND AUTHOR_1.name = 'Divesh Srivastava' AND WRITES_0.aid = AUTHOR_0.aid AND WRITES_0.pid = publication.pid AND WRITES_1.aid = AUTHOR_1.aid AN...
Below are sql tables 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 me the number of papers written by ' H. V. Jagadish ' and ' Divesh Srivastava ' . ### Input: CREATE TABLE domain_conf...
Name the Date and an Opponent which has a f Position and Career Games of 123 games?
CREATE TABLE table_name_4 ( date_and_opponent VARCHAR, position VARCHAR, career_games VARCHAR )
SELECT date_and_opponent FROM table_name_4 WHERE position = "f" AND career_games = "123 games"
Below are sql tables 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 Date and an Opponent which has a f Position and Career Games of 123 games? ### Input: CREATE TABLE table_name_4 ( ...
Draw a bar chart about the distribution of meter_300 and ID , and order y axis in descending order.
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
SELECT meter_300, ID FROM swimmer ORDER BY 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: Draw a bar chart about the distribution of meter_300 and ID , and order y axis in descending order. ### Input: CREATE TABLE ...
find the number of patients diagnosed with blood in stool had the drug route as replace.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Blood in stool" AND prescriptions.route = "REPLACE"
Below are sql tables 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 diagnosed with blood in stool had the drug route as replace. ### Input: CREATE TABLE procedures ...
When did Bonecrusher win the championship at Bayam n, Puerto Rico?
CREATE TABLE table_name_5 ( date_won VARCHAR, location VARCHAR, champion_s_ VARCHAR )
SELECT date_won FROM table_name_5 WHERE location = "bayamón, puerto rico" AND champion_s_ = "bonecrusher"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did Bonecrusher win the championship at Bayam n, Puerto Rico? ### Input: CREATE TABLE table_name_5 ( date_won VARCH...
What team has 4 points and a Chassis of march 82/83c?
CREATE TABLE table_name_71 ( team VARCHAR, points VARCHAR, chassis VARCHAR )
SELECT team FROM table_name_71 WHERE points = 4 AND chassis = "march 82/83c"
Below are sql tables 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 has 4 points and a Chassis of march 82/83c? ### Input: CREATE TABLE table_name_71 ( team VARCHAR, points V...
How many male patients had a lab test for haptoglobin?
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.gender = "M" AND lab.label = "Haptoglobin"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many male patients had a lab test for haptoglobin? ### Input: CREATE TABLE demographic ( subject_id text, hadm_i...
how many patients whose death status is 0 and procedure icd9 code is 8872?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "8872"
Below are sql tables 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 death status is 0 and procedure icd9 code is 8872? ### Input: CREATE TABLE lab ( subject_id text...
Name the number of year for 6 3, 6 2 hard surface
CREATE TABLE table_73489 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
SELECT COUNT("Year") FROM table_73489 WHERE "Score in the final" = '6–3, 6–2' AND "Surface" = 'Hard'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number of year for 6 3, 6 2 hard surface ### Input: CREATE TABLE table_73489 ( "Outcome" text, "Year" real,...
A bar chart shows the distribution of All_Road and ACC_Percent , and order X from high to low order.
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_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart shows the distribution of All_Road and ACC_Percent , and order X from high to low order. ### Input: CREATE TABLE...
What Class to 1928 has the Quantity smaller than 440 and Seats of 29/29?
CREATE TABLE table_name_16 ( class_to_1928 VARCHAR, quantity VARCHAR, seats VARCHAR )
SELECT class_to_1928 FROM table_name_16 WHERE quantity < 440 AND seats = "29/29"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Class to 1928 has the Quantity smaller than 440 and Seats of 29/29? ### Input: CREATE TABLE table_name_16 ( class_t...
What are the parties listed for Pennsylvania 8?
CREATE TABLE table_28929 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
SELECT "Party" FROM table_28929 WHERE "District" = 'Pennsylvania 8'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the parties listed for Pennsylvania 8? ### Input: CREATE TABLE table_28929 ( "District" text, "Incumbent" t...
How many courses have two prerequisites? Show me a bar chart grouping by title.
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4...
SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many courses have two prerequisites? Show me a bar chart grouping by title. ### Input: CREATE TABLE student ( ID var...
until 2102, what are the top five most commonly ordered lab tests for patients in the same month after being diagnosed with spinal stenosis nos?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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.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: until 2102, what are the top five most commonly ordered lab tests for patients in the same month after being diagnosed with ...
since 2 years ago, what are the top three most frequent microbiology tests ordered for patients within the same month after receiving the endosc remove bile stone?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( ro...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: since 2 years ago, what are the top three most frequent microbiology tests ordered for patients within the same month after ...
What home team scored 9.7 (61)?
CREATE TABLE table_4734 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_4734 WHERE "Home team score" = '9.7 (61)'
Below are sql tables 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 home team scored 9.7 (61)? ### Input: CREATE TABLE table_4734 ( "Home team" text, "Home team score" text, "...
what were the four most common drugs prescribed to patients aged 20s during the same hospital visit after they had been diagnosed with fx lumbar vertebra-close this year?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code te...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the four most common drugs prescribed to patients aged 20s during the same hospital visit after they had been diag...