instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
What was the result of the game played in front of 65,473?
CREATE TABLE table_33042 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Result" FROM table_33042 WHERE "Attendance" = '65,473'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the result of the game played in front of 65,473? ### Input: CREATE TABLE table_33042 ( "Week" real, "Date"...
patient 2498 had any d10w on 08/27/last year?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, h...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2498)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd10w' AND...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: patient 2498 had any d10w on 08/27/last year? ### Input: CREATE TABLE patients ( row_id number, subject_id number, ...
how many patients whose primary disease is ruq pain and admission year is less than 2146?
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 = "RUQ PAIN" AND demographic.admityear < "2146"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose primary disease is ruq pain and admission year is less than 2146? ### Input: CREATE TABLE demographi...
What is all the information about employees who have never had a job in the past?
CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE departments ...
SELECT * FROM employees WHERE NOT employee_id IN (SELECT employee_id FROM job_history)
Below are sql tables 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 all the information about employees who have never had a job in the past? ### Input: CREATE TABLE job_history ( ...
What is the total Crowd with a Home team of collingwood?
CREATE TABLE table_58076 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT SUM("Crowd") FROM table_58076 WHERE "Home team" = 'collingwood'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total Crowd with a Home team of collingwood? ### Input: CREATE TABLE table_58076 ( "Home team" text, "Ho...
count the number of patients whose discharge location is dead/expired?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED"
Below are sql tables 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 discharge location is dead/expired? ### Input: CREATE TABLE demographic ( subject_id ...
how many patients whose drug name is spironolactone?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Spironolactone"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose drug name is spironolactone? ### Input: CREATE TABLE procedures ( subject_id text, hadm_id t...
For those records from the products and each product's manufacturer, find name and the sum of price , and group by attribute name, and visualize them by a bar chart, I want to order by the total number of price in descending.
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 T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.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, find name and the sum of price , and group by attribute...
this year what were the top five most frequent lab tests given to patients within 2 months after they were diagnosed with acute copd exacerbation - with baseline hypercarbia?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute copd exacerbation - with baseline hypercarbia'...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: this year what were the top five most frequent lab tests given to patients within 2 months after they were diagnosed with ac...
Is THEORY 590 needed for THEORY 438 ?
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'THEORY' AND COURSE_0.number = 590 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'THEORY' AND COURSE_1.number = 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: Is THEORY 590 needed for THEORY 438 ? ### Input: CREATE TABLE course_offering ( offering_id int, course_id int, ...
what were the five pharmaceutical drugs most commonly prescribed during the same month to thrombocytopenia male patients aged 20s after having been diagnosed with thrombocytopenia until 3 years ago?
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'thrombocytopenia' AND DATETIME(diagnosis.diagnosis...
Below are sql tables 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 pharmaceutical drugs most commonly prescribed during the same month to thrombocytopenia male patients age...
Please show different denominations and the corresponding number of schools in descending order.
CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boarding text, year_entered_competition number, school_colors text ) CREATE TABLE player ( player_id number, player text, ...
SELECT denomination, COUNT(*) FROM school GROUP BY denomination 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: Please show different denominations and the corresponding number of schools in descending order. ### Input: CREATE TABLE sch...
How many accounts are there?
CREATE TABLE product_categories ( production_type_code text, product_type_description text, vat_rating number ) CREATE TABLE products ( product_id number, parent_product_id number, production_type_code text, unit_price number, product_name text, product_color text, product_size ...
SELECT COUNT(*) FROM accounts
Below are sql tables 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 accounts are there? ### Input: CREATE TABLE product_categories ( production_type_code text, product_type_de...
when did 14.55 people watch?
CREATE TABLE table_3584 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
SELECT "Original air date" FROM table_3584 WHERE "U.S. viewers (millions)" = '14.55'
Below are sql tables 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 14.55 people watch? ### Input: CREATE TABLE table_3584 ( "No. in series" real, "No. in season" real, "T...
how was patient 004-32341 admitted to the hospital since 2 years ago for the first time?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '004-32341' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how was patient 004-32341 admitted to the hospital since 2 years ago for the first time? ### Input: CREATE TABLE lab ( l...
What is the average of credit value of courses with more than one prerequisite for each department? Return a bar chart, and could you rank x axis in asc order?
CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), ...
SELECT dept_name, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY dept_name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average of credit value of courses with more than one prerequisite for each department? Return a bar chart, and ...
Bar graph to show mean product price from different product type code, and rank x axis in asc order.
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARC...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Bar graph to show mean product price from different product type code, and rank x axis in asc order. ### Input: CREATE TABLE...
Who wrote the episode having a US viewership of 3.74 million?
CREATE TABLE table_27905664_1 ( written_by VARCHAR, us_viewers__million_ VARCHAR )
SELECT written_by FROM table_27905664_1 WHERE us_viewers__million_ = "3.74"
Below are sql tables 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 wrote the episode having a US viewership of 3.74 million? ### Input: CREATE TABLE table_27905664_1 ( written_by VARC...
In which venue was North Melbourne the Away team?
CREATE TABLE table_11426 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Venue" FROM table_11426 WHERE "Away team" = 'north 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: In which venue was North Melbourne the Away team? ### Input: CREATE TABLE table_11426 ( "Home team" text, "Home team...
how many patients underwent closed bronchial biopsy during the same hospital encounter after having received closed bronchial biopsy,?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE cost ( row_id nu...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_...
Below are sql tables 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 underwent closed bronchial biopsy during the same hospital encounter after having received closed bronchia...
Find the number of elective hospital admission patients who have a famvir drug prescription.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Famvir"
Below are sql tables 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 elective hospital admission patients who have a famvir drug prescription. ### Input: CREATE TABLE demogra...
Return a histogram on what is average age of male for different job title?
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job
Below are sql tables 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 average age of male for different job title? ### Input: CREATE TABLE PersonFriend ( name v...
what was patient 010-39202 diagnosed with first time during the first hospital visit.
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-39202' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
Below are sql tables 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 patient 010-39202 diagnosed with first time during the first hospital visit. ### Input: CREATE TABLE microlab ( ...
what is the dicharge time and diagnosis icd9 code of the patient id 93033?
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 demographic.dischtime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "93033"
Below are sql tables 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 dicharge time and diagnosis icd9 code of the patient id 93033? ### Input: CREATE TABLE prescriptions ( subje...
show me the number of patients with abnormal lab test status who have been diagnosed with drug-induced delirium.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Drug-induced delirium" AND lab.flag = "abnormal"
Below are sql tables 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 number of patients with abnormal lab test status who have been diagnosed with drug-induced delirium. ### Input: ...
how many days elapsed since the last time patient 87232 received a pt lab test during this hospital encounter?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87232 AND admissions.disch...
Below are sql tables 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 elapsed since the last time patient 87232 received a pt lab test during this hospital encounter? ### Input: CR...
What is the date when the team is listed as New Orleans?
CREATE TABLE table_29940 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "Date" FROM table_29940 WHERE "Team" = 'New Orleans'
Below are sql tables 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 when the team is listed as New Orleans? ### Input: CREATE TABLE table_29940 ( "Game" real, "Date" t...
What classes should I enroll in in order to declare a major in SAC ?
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%SAC%' 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: What classes should I enroll in in order to declare a major in SAC ? ### Input: CREATE TABLE student_record ( student_id...
What is the relationship between ACC_Percent and All_Games_Percent , and group by attribute ACC_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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_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: What is the relationship between ACC_Percent and All_Games_Percent , and group by attribute ACC_Road? ### Input: CREATE TABL...
Return a bar chart to show how many documents for different budget type code, rank Y-axis from high to low order.
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Dat...
SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code ORDER BY COUNT(T1.Budget_Type_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: Return a bar chart to show how many documents for different budget type code, rank Y-axis from high to low order. ### Input:...
Show me the difficulty for all of the CS-LSA courses .
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_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: Show me the difficulty for all of the CS-LSA courses . ### Input: CREATE TABLE instructor ( instructor_id int, name ...
Show the number of the facility codes of apartments with more than 4 bedrooms, and display by the Y-axis from high to low.
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Bookings ( apt_bookin...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_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: Show the number of the facility codes of apartments with more than 4 bedrooms, and display by the Y-axis from high to low. #...
Show team_id from each team name, and display y axis in desc order.
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_Name, Team_ID FROM basketball_match ORDER BY Team_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: Show team_id from each team name, and display y axis in desc order. ### Input: CREATE TABLE university ( School_ID int, ...
what's party with district being pennsylvania 21
CREATE TABLE table_18253 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "Party" FROM table_18253 WHERE "District" = 'Pennsylvania 21'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what's party with district being pennsylvania 21 ### Input: CREATE TABLE table_18253 ( "District" text, "Incumbent" ...
What are the names of enzymes in descending order?
CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, me...
SELECT name FROM enzyme ORDER BY 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: What are the names of enzymes in descending order? ### Input: CREATE TABLE medicine ( id number, name text, trad...
is the value of the arterial bp mean of patient 22120 second measured on the first icu visit greater than first measured on the first icu visit?
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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents...
SELECT (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 = 22120) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: is the value of the arterial bp mean of patient 22120 second measured on the first icu visit greater than first measured on ...
how much does flight UA 281 from BOSTON to DENVER cost
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (((flight.airline_code = 'UA') AND flight.flight_number = 281) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' ...
Below are sql tables 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 does flight UA 281 from BOSTON to DENVER cost ### Input: CREATE TABLE airline ( airline_code varchar, airli...
how many urgent hospital admission patients had open reduction of femur fracture with internal fixation?
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Open reduc-int fix femur"
Below are sql tables 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 urgent hospital admission patients had open reduction of femur fracture with internal fixation? ### Input: CREATE T...
what is the number of patients whose admission type is urgent and procedure short title is open reduc-int fix femur?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Open reduc-int fix femur"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose admission type is urgent and procedure short title is open reduc-int fix femur? ### Inp...
what were the first outputs of patient 027-62948 until 1285 days ago?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE m...
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 = '027-62948')) AND intakeoutput.cellpath LIKE '%output%' AND 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 first outputs of patient 027-62948 until 1285 days ago? ### Input: CREATE TABLE treatment ( treatmentid nu...
when has patient 25814 been prescribed medication for the first time since 11/2102 via ir route?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 admissions ( ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814) AND prescriptions.route = 'ir' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-11' ORDER BY prescriptions.startdate LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when has patient 25814 been prescribed medication for the first time since 11/2102 via ir route? ### Input: CREATE TABLE d_i...
Who was the incumbent in the Arkansas 2 district election?
CREATE TABLE table_1341897_6 ( incumbent VARCHAR, district VARCHAR )
SELECT incumbent FROM table_1341897_6 WHERE district = "Arkansas 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 incumbent in the Arkansas 2 district election? ### Input: CREATE TABLE table_1341897_6 ( incumbent VARCHAR, ...
how many home games were played ?
CREATE TABLE table_203_47 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text )
SELECT COUNT("game") FROM table_203_47 WHERE "opponent" = '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: how many home games were played ? ### Input: CREATE TABLE table_203_47 ( id number, "game" number, "date" text, ...
For those employees who was hired before 2002-06-21, return a scatter chart about the correlation between employee_id and manager_id .
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT EMPLOYEE_ID, MANAGER_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, return a scatter chart about the correlation between employee_id and ma...
Stack bar chart of team_id vs ACC_Home based on all home, could you order by the X-axis in desc?
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, Team_ID FROM basketball_match GROUP BY ACC_Home, 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: Stack bar chart of team_id vs ACC_Home based on all home, could you order by the X-axis in desc? ### Input: CREATE TABLE uni...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the average of salary bin hire_date by time, and visualize them by a bar chart.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
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, find hire_date and the a...
How many faculty members do we have for each rank and gender? Plot them as bar chart.
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) 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 Faculty ( FacID INTEGER, Lname...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many faculty members do we have for each rank and gender? Plot them as bar chart. ### Input: CREATE TABLE Activity ( ...
What is the T score of the team with an E score of 6.625?
CREATE TABLE table_name_52 ( t_score VARCHAR, e_score VARCHAR )
SELECT t_score FROM table_name_52 WHERE e_score = 6.625
Below are sql tables 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 T score of the team with an E score of 6.625? ### Input: CREATE TABLE table_name_52 ( t_score VARCHAR, e...
What is the highest gold with 1 silver, and more than 1 altogether?
CREATE TABLE table_name_40 ( gold INTEGER, silver VARCHAR, total VARCHAR )
SELECT MAX(gold) FROM table_name_40 WHERE silver = 1 AND total > 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest gold with 1 silver, and more than 1 altogether? ### Input: CREATE TABLE table_name_40 ( gold INTEGER...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of manager_id bin hire_date by time in a bar chart, display y axis in desc order.
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distri...
among the patients 40s the previous year, what were the four most common diagnoses?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: among the patients 40s the previous year, what were the four most common diagnoses? ### Input: CREATE TABLE diagnosis ( ...
What date did Footscray play at home?
CREATE TABLE table_name_92 ( date VARCHAR, home_team VARCHAR )
SELECT date FROM table_name_92 WHERE home_team = "footscray"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What date did Footscray play at home? ### Input: CREATE TABLE table_name_92 ( date VARCHAR, home_team VARCHAR ) ### ...
how many patients of white-russian ethnicity are diagnosed with primary disease coronary artery disease or coronary artery bypass graft myomectomy/sda?
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.ethnicity = "WHITE - RUSSIAN" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA"
Below are sql tables 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 white-russian ethnicity are diagnosed with primary disease coronary artery disease or coronary artery b...
How many league cups associated with under 10 championships and a total of under 3?
CREATE TABLE table_name_36 ( league_cup INTEGER, championship VARCHAR, total VARCHAR )
SELECT SUM(league_cup) FROM table_name_36 WHERE championship < 10 AND total < 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 league cups associated with under 10 championships and a total of under 3? ### Input: CREATE TABLE table_name_36 ( ...
What is the Score when the winner was sanyo wild knights, and a Runner-up of suntory sungoliath?
CREATE TABLE table_76145 ( "Title" text, "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text, "Attendance" text )
SELECT "Score" FROM table_76145 WHERE "Winner" = 'sanyo wild knights' AND "Runner-up" = 'suntory sungoliath'
Below are sql tables 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 when the winner was sanyo wild knights, and a Runner-up of suntory sungoliath? ### Input: CREATE TABLE tab...
is there any results of the microbiology test of patient 031-23724?
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 COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724'))
Below are sql tables 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 any results of the microbiology test of patient 031-23724? ### Input: CREATE TABLE patient ( uniquepid text, ...
Plot how many country by grouped by country as a bar graph, rank from low to high by the bars please.
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int )
SELECT Country, COUNT(Country) FROM member GROUP BY Country ORDER 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: Plot how many country by grouped by country as a bar graph, rank from low to high by the bars please. ### Input: CREATE TABL...
Who wrote the episode with the production code of BN103?
CREATE TABLE table_24249 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text )
SELECT "Written by" FROM table_24249 WHERE "Production code" = 'BN103'
Below are sql tables 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 wrote the episode with the production code of BN103? ### Input: CREATE TABLE table_24249 ( "No. in series" real, ...
when was the first time patient 022-84707 had coumadin prescribed during the last hospital encounter?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-84707' AND NOT patient.hospitaldischargetime IS NULL ORDER...
Below are sql tables 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 patient 022-84707 had coumadin prescribed during the last hospital encounter? ### Input: CREATE TABL...
what were the four most frequently prescribed drugs for patients who had also been prescribed dexamethasone sod phosphate at the same time?
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'dexamethasone sod phosphate') AS t1 JOIN (SELECT admissions.subje...
Below are sql tables 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 frequently prescribed drugs for patients who had also been prescribed dexamethasone sod phosphate at...
what is primary disease and admission time of subject id 9258?
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 demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "9258"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is primary disease and admission time of subject id 9258? ### Input: CREATE TABLE prescriptions ( subject_id text, ...
kindly give me the type of aircraft used to fly from ATLANTA to DENVER
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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: kindly give me the type of aircraft used to fly from ATLANTA to DENVER ### Input: CREATE TABLE airport ( airport_code va...
Count the hometown by hometown, I want to sort by the X-axis in asc.
CREATE TABLE membership_register_branch ( Member_ID int, Branch_ID text, Register_Year text ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Ye...
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY Hometown
Below are sql tables 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 hometown by hometown, I want to sort by the X-axis in asc. ### Input: CREATE TABLE membership_register_branch ( ...
what is procedure long title of procedure icd9 code 4601?
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 procedures.long_title FROM procedures WHERE procedures.icd9_code = "4601"
Below are sql tables 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 procedure long title of procedure icd9 code 4601? ### Input: CREATE TABLE prescriptions ( subject_id text, h...
what 's the latest flight out of DENVER that arrives in PITTSBURGH next monday
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_cod...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 21 AND date_day.month_number = 2 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 's the latest flight out of DENVER that arrives in PITTSBURGH next monday ### Input: CREATE TABLE flight_leg ( flig...
what is the variation of patient 594's weight last measured on the first hospital visit compared to the second to last value measured on the first hospital visit?
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (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 = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND charteven...
Below are sql tables 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 variation of patient 594's weight last measured on the first hospital visit compared to the second to last value...
What's the tie number when the away team was Mansfield Town?
CREATE TABLE table_name_3 ( tie_no VARCHAR, away_team VARCHAR )
SELECT tie_no FROM table_name_3 WHERE away_team = "mansfield town"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the tie number when the away team was Mansfield Town? ### Input: CREATE TABLE table_name_3 ( tie_no VARCHAR, ...
Who has the high assists when April 26 is the date?
CREATE TABLE table_23285761_11 ( high_assists VARCHAR, date VARCHAR )
SELECT high_assists FROM table_23285761_11 WHERE date = "April 26"
Below are sql tables 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 has the high assists when April 26 is the date? ### Input: CREATE TABLE table_23285761_11 ( high_assists VARCHAR, ...
Before taking MENAS 490 , what classes must I complete ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text 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...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Before taking MENAS 490 , what classes must I complete ? ### Input: CREATE TABLE comment_instructor ( instructor_id int,...
List all the customers in increasing order of IDs. Show me a bar chart.
CREATE TABLE Services ( Service_ID INTEGER, Service_name VARCHAR(40) ) CREATE TABLE Claims ( Claim_ID INTEGER, FNOL_ID INTEGER, Effective_Date DATE ) CREATE TABLE Available_Policies ( Policy_ID INTEGER, policy_type_code CHAR(15), Customer_Phone VARCHAR(255) ) CREATE TABLE First_Notifi...
SELECT Customer_name, Customer_ID FROM Customers ORDER BY Customer_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: List all the customers in increasing order of IDs. Show me a bar chart. ### Input: CREATE TABLE Services ( Service_ID IN...
How many ties does Walsall have?
CREATE TABLE table_41720 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text, "Attendance" text )
SELECT "Tie no" FROM table_41720 WHERE "Away team" = 'walsall'
Below are sql tables 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 ties does Walsall have? ### Input: CREATE TABLE table_41720 ( "Tie no" text, "Home team" text, "Score" ...
how many current patients are of age 60 or above?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age >= 60
Below are sql tables 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 current patients are of age 60 or above? ### Input: CREATE TABLE diagnosis ( diagnosisid number, patientuni...
What were the Away team Kangaroos Crowd totals?
CREATE TABLE table_name_56 ( crowd INTEGER, away_team VARCHAR )
SELECT SUM(crowd) FROM table_name_56 WHERE away_team = "kangaroos"
Below are sql tables 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 Away team Kangaroos Crowd totals? ### Input: CREATE TABLE table_name_56 ( crowd INTEGER, away_team VAR...
provide the number of patients whose diagnoses icd9 code is 2875?
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 diagnoses.icd9_code = "2875"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose diagnoses icd9 code is 2875? ### Input: CREATE TABLE demographic ( subject_id text,...
Which away team has a score of 11.17 (83)?
CREATE TABLE table_56920 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team" FROM table_56920 WHERE "Away team score" = '11.17 (83)'
Below are sql tables 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 away team has a score of 11.17 (83)? ### Input: CREATE TABLE table_56920 ( "Home team" text, "Home team score"...
For those employees who did not have any job in the past, find hire_date and the average of department_id bin hire_date by weekday, and visualize them by a bar chart, rank by the total number in descending.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) 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 who did not have any job in the past, find hire_date and the average of department_id bin hire_date by w...
A scatter chart shows the correlation between Team_ID and ACC_Percent , and group by attribute 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 Team_ID, ACC_Percent 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 scatter chart shows the correlation between Team_ID and ACC_Percent , and group by attribute All_Home. ### Input: CREATE T...
What was the date for game 6?
CREATE TABLE table_14584 ( "Game" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text )
SELECT "Date" FROM table_14584 WHERE "Game" = '6'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the date for game 6? ### Input: CREATE TABLE table_14584 ( "Game" real, "Date" text, "Visitor" text, ...
Who did the Eagle's play on November 5, 1961?
CREATE TABLE table_name_77 ( opponent VARCHAR, date VARCHAR )
SELECT opponent FROM table_name_77 WHERE date = "november 5, 1961"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who did the Eagle's play on November 5, 1961? ### Input: CREATE TABLE table_name_77 ( opponent VARCHAR, date VARCHAR...
For ULCS , which MEDADM classes can be counted ?
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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, admit_term int, predicted_gradu...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%MEDADM%' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_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 ULCS , which MEDADM classes can be counted ? ### Input: CREATE TABLE course_prerequisite ( pre_course_id int, co...
What year is listed that has points greater than 0 with a chassis labeled AGS JH22?
CREATE TABLE table_name_26 ( year VARCHAR, points VARCHAR, chassis VARCHAR )
SELECT year FROM table_name_26 WHERE points > 0 AND chassis = "ags jh22"
Below are sql tables 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 year is listed that has points greater than 0 with a chassis labeled AGS JH22? ### Input: CREATE TABLE table_name_26 ( ...
how many patients stayed in hospital for more than 2 days and used the drug albumin 5% (12.5g/250 ml)?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug = "Albumin 5% (12.5g / 250mL)"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients stayed in hospital for more than 2 days and used the drug albumin 5% (12.5g/250 ml)? ### Input: CREATE TAB...
how many times is bronze 2 and gold more than 3?
CREATE TABLE table_43799 ( "Event" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT COUNT("Total") FROM table_43799 WHERE "Bronze" = '2' AND "Gold" > '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 times is bronze 2 and gold more than 3? ### Input: CREATE TABLE table_43799 ( "Event" text, "Gold" real, ...
Return a bar chart on how many gymnasts are from each hometown?, display by the x axis in descending.
CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real, Total_Points real ) CREATE TABLE people ( People_ID int, Name text, Age real, Height ...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY Hometown 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 on how many gymnasts are from each hometown?, display by the x axis in descending. ### Input: CREATE TABL...
how many greek orthodox religious background patients have lab test item id 51419?
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.religion = "GREEK ORTHODOX" AND lab.itemid = "51419"
Below are sql tables 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 greek orthodox religious background patients have lab test item id 51419? ### Input: CREATE TABLE prescriptions ( ...
who has the most goals ?
CREATE TABLE table_203_692 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
SELECT "name" FROM table_203_692 ORDER BY "goals" 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: who has the most goals ? ### Input: CREATE TABLE table_203_692 ( id number, "name" text, "pos." text, "caps"...
give me the number of patients whose admission type is emergency and lab test name is creatine kinase, mb isoenzyme?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Creatine Kinase, MB Isoenzyme"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission type is emergency and lab test name is creatine kinase, mb isoenzyme? ### Inp...
Is there a lab for 527 ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 527
Below are sql tables 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 lab for 527 ? ### Input: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score i...
find the number of patients who had procedure of creation of conduit between left ventricle and aorta.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Conduit left ventr-aorta"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of patients who had procedure of creation of conduit between left ventricle and aorta. ### Input: CREATE TAB...
For those dates with a max temperature greater than or equal to 80, I want to know the number of days on the day of the week interval using a bar chart, could you show from high to low by the Y?
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_i...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 ORDER BY COUNT(date) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those dates with a max temperature greater than or equal to 80, I want to know the number of days on the day of the week...
indicate the yearly average arterial bp [systolic] of patient 18677 until 44 months ago.
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
SELECT AVG(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 = 18677)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: indicate the yearly average arterial bp [systolic] of patient 18677 until 44 months ago. ### Input: CREATE TABLE chartevents...
What is the highest rank a team with 1 silver and less than 5 bronze medals has?
CREATE TABLE table_name_66 ( rank INTEGER, silver VARCHAR, bronze VARCHAR )
SELECT MAX(rank) FROM table_name_66 WHERE silver = 1 AND bronze < 5
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the highest rank a team with 1 silver and less than 5 bronze medals has? ### Input: CREATE TABLE table_name_66 ( ...
how many patients whose days of hospital stay is greater than 7 and drug type is additive?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "7" AND prescriptions.drug_type = "ADDITIVE"
Below are sql tables 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 days of hospital stay is greater than 7 and drug type is additive? ### Input: CREATE TABLE lab ( ...
Which To par has a Place in 8?
CREATE TABLE table_5794 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "To par" FROM table_5794 WHERE "Place" = '8'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which To par has a Place in 8? ### Input: CREATE TABLE table_5794 ( "Place" text, "Player" text, "Country" text,...
list flights from PITTSBURGH to LOS ANGELES which leave on thursday after 1700
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
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 = 24 AND date_day.month_number = 5 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: list flights from PITTSBURGH to LOS ANGELES which leave on thursday after 1700 ### Input: CREATE TABLE airport_service ( ...
What is the least number of Races for a Racer with less than 0 Points?
CREATE TABLE table_42967 ( "Year" real, "Drivers" text, "Races" real, "Wins" real, "Poles" real, "Fast laps" real, "Points" real, "D.C." text, "T.C." text )
SELECT MIN("Races") FROM table_42967 WHERE "Points" < '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 least number of Races for a Racer with less than 0 Points? ### Input: CREATE TABLE table_42967 ( "Year" real...
What is the lowest round for the player whose position is guard and had a pick number smaller than 144?
CREATE TABLE table_name_84 ( round INTEGER, position VARCHAR, pick VARCHAR )
SELECT MIN(round) FROM table_name_84 WHERE position = "guard" AND pick < 144
Below are sql tables 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 round for the player whose position is guard and had a pick number smaller than 144? ### Input: CREATE TA...
For those employees who did not have any job in the past, draw a scatter chart about the correlation between commission_pct and department_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 COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who did not have any job in the past, draw a scatter chart about the correlation between commission_pct ...
Show the number of male and female assistant professors.
CREATE TABLE Faculty ( sex VARCHAR, rank VARCHAR )
SELECT sex, COUNT(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex
Below are sql tables 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 male and female assistant professors. ### Input: CREATE TABLE Faculty ( sex VARCHAR, rank VARCHAR...
How many Gold medals for the country with a Rank of 1 and less than 2 Total medals?
CREATE TABLE table_name_57 ( gold VARCHAR, rank VARCHAR, total VARCHAR )
SELECT COUNT(gold) FROM table_name_57 WHERE rank = "1" AND total < 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: How many Gold medals for the country with a Rank of 1 and less than 2 Total medals? ### Input: CREATE TABLE table_name_57 ( ...