instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
Number Of Posts Created on a Certain Date.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance...
SELECT COUNT(*) FROM Posts WHERE Posts.CreationDate = '10-13-2014'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Number Of Posts Created on a Certain Date. ### Input: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, ...
Who had the highest points on January 2?
CREATE TABLE table_73502 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
SELECT "High points" FROM table_73502 WHERE "Date" = 'January 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 had the highest points on January 2? ### Input: CREATE TABLE table_73502 ( "Game" real, "Date" text, "Team" ...
in a game against st kilda, what was the away team's score?
CREATE TABLE table_52363 ( "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_52363 WHERE "Home team" = 'st kilda'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in a game against st kilda, what was the away team's score? ### Input: CREATE TABLE table_52363 ( "Home team" text, ...
what is the number of patients whose diagnoses long title is atrial flutter?
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 WHERE diagnoses.long_title = "Atrial flutter"
Below are sql tables 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 diagnoses long title is atrial flutter? ### Input: CREATE TABLE prescriptions ( sub...
Who was the home team when grimsby town was the away team?
CREATE TABLE table_name_91 ( home_team VARCHAR, away_team VARCHAR )
SELECT home_team FROM table_name_91 WHERE away_team = "grimsby 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: Who was the home team when grimsby town was the away team? ### Input: CREATE TABLE table_name_91 ( home_team VARCHAR, ...
what is the total number of clubs listed ?
CREATE TABLE table_204_198 ( id number, "club" text, "nickname" text, "no. of premierships" number, "premiership years" text, "moved to" text )
SELECT COUNT("club") FROM table_204_198
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the total number of clubs listed ? ### Input: CREATE TABLE table_204_198 ( id number, "club" text, "nick...
Visualize a pie chart with what are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int )
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a pie chart with what are the countries of perpetrators? Show each country and the corresponding number of perpetr...
Return a bar chart about the distribution of date_address_from and the sum of monthly_rental , and group by attribute other_details and bin date_address_from by time.
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Incident_Type ( ...
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details 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: Return a bar chart about the distribution of date_address_from and the sum of monthly_rental , and group by attribute other_...
how many patients whose admission location is emergency room admit and year of birth is less than 1850?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dob_year < "1850"
Below are sql tables 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 location is emergency room admit and year of birth is less than 1850? ### Input: CREATE TA...
How many sets were in the 2011 Australian Open Tournament?
CREATE TABLE table_14542 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2011" text, "2012" text, "2013" text )
SELECT "2011" FROM table_14542 WHERE "Tournament" = 'australian open'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many sets were in the 2011 Australian Open Tournament? ### Input: CREATE TABLE table_14542 ( "Tournament" text, ...
Total number of resolved questions.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate ...
SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND AnswerCount > 0 AND NOT AcceptedAnswerId IS NULL
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Total number of resolved questions. ### Input: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId num...
What are the comments when the vendor and type is alcatel-lucent routers?
CREATE TABLE table_1206114_2 ( comments VARCHAR, vendor_and_type VARCHAR )
SELECT comments FROM table_1206114_2 WHERE vendor_and_type = "Alcatel-Lucent routers"
Below are sql tables 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 comments when the vendor and type is alcatel-lucent routers? ### Input: CREATE TABLE table_1206114_2 ( comm...
Where is the location of the coimbatore medical college?
CREATE TABLE table_57116 ( "College Name" text, "Location" text, "District" text, "Affiliation" text, "Estd" text )
SELECT "Location" FROM table_57116 WHERE "College Name" = 'coimbatore medical 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: Where is the location of the coimbatore medical college? ### Input: CREATE TABLE table_57116 ( "College Name" text, ...
the cheapest flights from ATLANTA to PHILADELPHIA that arrive after 12pm on a TUESDAY
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
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, days, fare, flight, flight_fare WHERE ((((((flight.arrival_time < flight.departure_time) AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code) OR (days.day_na...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: the cheapest flights from ATLANTA to PHILADELPHIA that arrive after 12pm on a TUESDAY ### Input: CREATE TABLE class_of_servi...
how many patients born before the year 2052 had guillain barre as the primary disease?
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 = "GUILLAIN BARRE SYNDROME" AND demographic.dob_year < "2052"
Below are sql tables 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 born before the year 2052 had guillain barre as the primary disease? ### Input: CREATE TABLE demographic (...
How many tries for were there while having 479 points against?
CREATE TABLE table_70630 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
SELECT "Tries for" FROM table_70630 WHERE "Points against" = '479'
Below are sql tables 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 tries for were there while having 479 points against? ### Input: CREATE TABLE table_70630 ( "Club" text, "P...
Top gis algerian on stackexchange.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPriv...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Age, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?200##' AND (UPPER(Location) LIKE UPPER('%Algeria%') OR UPPER(Location) LIKE UPPER('%Algerie%') OR ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top gis algerian on stackexchange. ### Input: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId numb...
how many patients received insert infusion pump after entral infus nutrit sub until 2103 in the same hospital visit?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
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 received insert infusion pump after entral infus nutrit sub until 2103 in the same hospital visit? ### Inp...
Show me the average of weight by sex in a histogram
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, AVG(Weight) FROM people 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 me the average of weight by sex in a histogram ### Input: CREATE TABLE people ( People_ID int, Sex text, Na...
who was the winning team the most number of times ?
CREATE TABLE table_204_137 ( id number, "race" number, "race name" text, "pole position" text, "fastest lap" text, "winning driver" text, "winning team" text, "yokohama winner" text, "jay-ten winner" text, "report" text )
SELECT "winning team" FROM table_204_137 GROUP BY "winning team" ORDER BY COUNT(*) DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who was the winning team the most number of times ? ### Input: CREATE TABLE table_204_137 ( id number, "race" number...
A bar chart about what are the names of climbers and the corresponding heights of the mountains that they climb?, rank from low to high by the X-axis.
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what are the names of climbers and the corresponding heights of the mountains that they climb?, rank from ...
give me the flights from BOSTON to SAN FRANCISCO leaving early today
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
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 (((flight.departure_time BETWEEN 1000 AND 0) AND date_day.day_number = 13 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_nam...
Below are sql tables 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 flights from BOSTON to SAN FRANCISCO leaving early today ### Input: CREATE TABLE fare ( fare_id int, fro...
whats patient 004-13127 maximum respiration in the previous day?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127')) AND NOT vitalperiodic.respiration IS ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: whats patient 004-13127 maximum respiration in the previous day? ### Input: CREATE TABLE cost ( costid number, uniqu...
how many patients are admitted under emergency room admit and diagnosed with icd9 code 78559?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "78559"
Below are sql tables 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 admitted under emergency room admit and diagnosed with icd9 code 78559? ### Input: CREATE TABLE prescr...
how many patients are below 24 years of age and with procedure icd9 code 9920?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "24" AND procedures.icd9_code = "9920"
Below are sql tables 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 below 24 years of age and with procedure icd9 code 9920? ### Input: CREATE TABLE lab ( subject_id ...
Who was the Home captain that played at the venue Oval?
CREATE TABLE table_42816 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
SELECT "Home captain" FROM table_42816 WHERE "Venue" = 'oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the Home captain that played at the venue Oval? ### Input: CREATE TABLE table_42816 ( "Date" text, "Home cap...
For all employees who have the letters D or S in their first name, visualize a line chart about the change of department_id over hire_date .
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 locations ( LOCATION_ID decimal(4,0),...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, visualize a line chart about the change of department_id ...
How many byes were there recorded with 0 draws?
CREATE TABLE table_name_27 ( byes INTEGER, draws INTEGER )
SELECT SUM(byes) FROM table_name_27 WHERE draws < 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 byes were there recorded with 0 draws? ### Input: CREATE TABLE table_name_27 ( byes INTEGER, draws INTEGER ...
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by time.
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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, JO...
SELECT HIRE_DATE, SUM(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, a bar chart shows the distribution of hire_date and the sum of dep...
which patients have drug code bactss?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BACTSS"
Below are sql tables 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 patients have drug code bactss? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_co...
what was the name of the drug being prescribed to patient 52647 during the same hospital encounter after having been diagnosed with hematoma complic proc since 08/2102?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
SELECT t2.drug 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 admissions.subject_id = 52647 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the drug being prescribed to patient 52647 during the same hospital encounter after having been diagnos...
Are there any Other classes in the Winter ?
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any Other classes in the Winter ? ### Input: CREATE TABLE program ( program_id int, name varchar, coll...
Which Constructor has a Grid of 17?
CREATE TABLE table_34662 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Constructor" FROM table_34662 WHERE "Grid" = '17'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Constructor has a Grid of 17? ### Input: CREATE TABLE table_34662 ( "Driver" text, "Constructor" text, "La...
what is the number of patients whose diagnoses short title is therapeutic drug monitor and lab test category is blood gas?
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.short_title = "Therapeutic drug monitor" AND lab."CATEGORY" = "Blood Gas"
Below are sql tables 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 diagnoses short title is therapeutic drug monitor and lab test category is blood gas? #...
What was the purse when the trainer was Aidan O'Brien?
CREATE TABLE table_6130 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text, "Purse" text )
SELECT "Purse" FROM table_6130 WHERE "Trainer" = 'aidan o''brien'
Below are sql tables 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 purse when the trainer was Aidan O'Brien? ### Input: CREATE TABLE table_6130 ( "Year" real, "Winner" te...
what are patient 14502's changes in arterial bp mean last measured on the last intensive care unit visit compared to the second to last value measured on the last intensive care unit visit?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_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 = 14502) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
Below are sql tables 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 patient 14502's changes in arterial bp mean last measured on the last intensive care unit visit compared to the sec...
Top User Of a Perticular Tag in India.
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", TagName, COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top User Of a Perticular Tag in India. ### Input: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Post...
Show the number of customer address history for each city in a bar chart, and could you order from low to high by the Y?
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, ...
SELECT T3.city, COUNT(T3.city) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY T3.city ORDER BY COUNT(T3.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: Show the number of customer address history for each city in a bar chart, and could you order from low to high by the Y? ###...
what is the drug name used by the patient stephanie suchan?
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 prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Stephanie Suchan"
Below are sql tables 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 drug name used by the patient stephanie suchan? ### Input: CREATE TABLE lab ( subject_id text, hadm_id t...
What is the name of the driver with a grid less than 14, laps smaller than 53 and a Time/Retired of collision, and a Constructor of ferrari?
CREATE TABLE table_78434 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Driver" FROM table_78434 WHERE "Grid" < '14' AND "Laps" < '53' AND "Time/Retired" = 'collision' AND "Constructor" = 'ferrari'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the name of the driver with a grid less than 14, laps smaller than 53 and a Time/Retired of collision, and a Constru...
give me the number of patients who had free calcium lab test and were hospitalized for more than 4 days.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab.label = "Free Calcium"
Below are sql tables 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 who had free calcium lab test and were hospitalized for more than 4 days. ### Input: CREATE T...
Which district is associated with the incumbent Carl Vinson?
CREATE TABLE table_18564 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "Candidates" FROM table_18564 WHERE "Incumbent" = 'Carl Vinson'
Below are sql tables 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 district is associated with the incumbent Carl Vinson? ### Input: CREATE TABLE table_18564 ( "District" text, ...
flight will start from BOSTON
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TAB...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND flight.from_airport = airport_service.airport_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: flight will start from BOSTON ### Input: CREATE TABLE ground_service ( city_code text, airport_code text, transp...
how many patients whose admission type is urgent and drug route is po/ng?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "PO/NG"
Below are sql tables 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 urgent and drug route is po/ng? ### Input: CREATE TABLE prescriptions ( subjec...
what is the yearly average amount of mcv patient 028-39354 has until 05/2104?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-39354')) AND lab.labname = 'mcv' AND STRFTIME('%y-%m', lab.labresulttime) <= '...
Below are sql tables 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 yearly average amount of mcv patient 028-39354 has until 05/2104? ### Input: CREATE TABLE allergy ( allergyi...
how many days is it since patient 2957's first hemoglobin lab test during this hospital visit?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime t...
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 = 'hemoglobin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2957 AND admission...
Below are sql tables 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 is it since patient 2957's first hemoglobin lab test during this hospital visit? ### Input: CREATE TABLE d_lab...
when was patient 65309 for the last time prescribed a medication via the tp route in 10/last year?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( r...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65309) AND prescriptions.route = 'tp' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m',...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was patient 65309 for the last time prescribed a medication via the tp route in 10/last year? ### Input: CREATE TABLE c...
Points of 26, and a Rank smaller than 27 had what sum of wins?
CREATE TABLE table_name_82 ( wins INTEGER, points VARCHAR, rank VARCHAR )
SELECT SUM(wins) FROM table_name_82 WHERE points = 26 AND rank < 27
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Points of 26, and a Rank smaller than 27 had what sum of wins? ### Input: CREATE TABLE table_name_82 ( wins INTEGER, ...
What was the name of the epiode written by Gary M. Goodrich?
CREATE TABLE table_26554 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
SELECT "Title" FROM table_26554 WHERE "Written by" = 'Gary M. Goodrich'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the name of the epiode written by Gary M. Goodrich? ### Input: CREATE TABLE table_26554 ( "No. in series" real,...
give me the number of emergency hospital admission patients who are taking drug via iv route.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "IV"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of emergency hospital admission patients who are taking drug via iv route. ### Input: CREATE TABLE prescr...
what is the seating capacity on the aircraft M80
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, ...
SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80'
Below are sql tables 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 seating capacity on the aircraft M80 ### Input: CREATE TABLE code_description ( code varchar, descriptio...
what was the organism that was discovered in the last other microbiology test of patient 031-3355 this month?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( med...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'other' AND DATETIME(microlab.cult...
Below are sql tables 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 organism that was discovered in the last other microbiology test of patient 031-3355 this month? ### Input: CRE...
In the tournament with more than 6 top-25's and less than 13 cuts made, how many wins were there?
CREATE TABLE table_name_28 ( wins VARCHAR, top_25 VARCHAR, cuts_made VARCHAR )
SELECT COUNT(wins) FROM table_name_28 WHERE top_25 > 6 AND cuts_made < 13
Below are sql tables 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 the tournament with more than 6 top-25's and less than 13 cuts made, how many wins were there? ### Input: CREATE TABLE ta...
What are the countries of mountains with height bigger than 5000, and count them by a bar chart, display by the y-axis in descending.
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) 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 countries of mountains with height bigger than 5000, and count them by a bar chart, display by the y-axis in de...
what is the number of patients whose ethnicity is asian and age is less than 67?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "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 number of patients whose ethnicity is asian and age is less than 67? ### Input: CREATE TABLE procedures ( su...
What player's original team are the Oakland Raiders?
CREATE TABLE table_name_96 ( player VARCHAR, original_nfl_team VARCHAR )
SELECT player FROM table_name_96 WHERE original_nfl_team = "oakland raiders"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player's original team are the Oakland Raiders? ### Input: CREATE TABLE table_name_96 ( player VARCHAR, origina...
Which Date has a Competition of pl group b, and Opponents of police, and a Venue of selayang municipal council stadium?
CREATE TABLE table_75465 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Competition" text )
SELECT "Date" FROM table_75465 WHERE "Competition" = 'pl group b' AND "Opponents" = 'police' AND "Venue" = 'selayang municipal council stadium'
Below are sql tables 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 Competition of pl group b, and Opponents of police, and a Venue of selayang municipal council stadium? ### ...
Class 767 , is Prof. Valerie Laken teaching it next Winter ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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 varc...
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 = 767 AND instructor.name LIKE '%Valerie Laken%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_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: Class 767 , is Prof. Valerie Laken teaching it next Winter ? ### Input: CREATE TABLE requirement ( requirement_id int, ...
Display a bar chart for how many credits does the department offer?, and I want to rank by the total number from high to low.
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) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), ...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT) 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: Display a bar chart for how many credits does the department offer?, and I want to rank by the total number from high to low...
had patient 12454 been diagnosed with any disease on their last hospital visit?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12454 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: had patient 12454 been diagnosed with any disease on their last hospital visit? ### Input: CREATE TABLE labevents ( row_...
Are there any 400 / 500 -level IOE courses with a small workload ?
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) 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, t...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'IOE' AND program_course.workload = (SELECT MIN(PROGRA...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Are there any 400 / 500 -level IOE courses with a small workload ? ### Input: CREATE TABLE offering_instructor ( offerin...
how many hours have elapsed since the last time patient 005-87465 had an intake of norepinephrine on the current icu visit?
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
Below are sql tables 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 hours have elapsed since the last time patient 005-87465 had an intake of norepinephrine on the current icu visit? ...
What si the total sample size at rasmussen reports when the margin of error was bigger than 4.5?
CREATE TABLE table_name_59 ( sample_size VARCHAR, poll_source VARCHAR, margin_of_error VARCHAR )
SELECT COUNT(sample_size) FROM table_name_59 WHERE poll_source = "rasmussen reports" AND margin_of_error > 4.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 si the total sample size at rasmussen reports when the margin of error was bigger than 4.5? ### Input: CREATE TABLE tab...
For the Summer term , what upper-level MICRBIOL classes are offered ?
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MICRBIOL' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Su...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the Summer term , what upper-level MICRBIOL classes are offered ? ### Input: CREATE TABLE comment_instructor ( instr...
What is the amount of apperances of the person who had 36 goals?
CREATE TABLE table_55725 ( "Nationality" text, "Position" text, "Boro career" text, "Captaincy" text, "Appearances" real, "Goals" real )
SELECT "Appearances" FROM table_55725 WHERE "Goals" = '36'
Below are sql tables 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 amount of apperances of the person who had 36 goals? ### Input: CREATE TABLE table_55725 ( "Nationality" tex...
get me the age of patient with patient id 3343.
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT demographic.age FROM demographic WHERE demographic.subject_id = "3343"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: get me the age of patient with patient id 3343. ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, ...
What was the Attendance on December 21, 1986 before Week 16?
CREATE TABLE table_48583 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT SUM("Attendance") FROM table_48583 WHERE "Date" = 'december 21, 1986' AND "Week" < '16'
Below are sql tables 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 on December 21, 1986 before Week 16? ### Input: CREATE TABLE table_48583 ( "Week" real, "Dat...
How many millions of U.S. viewers watched the show with a production code of 3T5769?
CREATE TABLE table_11694832_1 ( us_viewers__millions_ VARCHAR, production_code VARCHAR )
SELECT us_viewers__millions_ FROM table_11694832_1 WHERE production_code = "3T5769"
Below are sql tables 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 millions of U.S. viewers watched the show with a production code of 3T5769? ### Input: CREATE TABLE table_11694832_...
In week 9 who were the opponent?
CREATE TABLE table_14608759_1 ( opponent VARCHAR, week VARCHAR )
SELECT opponent FROM table_14608759_1 WHERE week = 9
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In week 9 who were the opponent? ### Input: CREATE TABLE table_14608759_1 ( opponent VARCHAR, week VARCHAR ) ### Res...
how many patients whose drug code is lido2/5j and lab test fluid is cerebrospinal fluid (csf)?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LIDO2/5J" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
Below are sql tables 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 code is lido2/5j and lab test fluid is cerebrospinal fluid (csf)? ### Input: CREATE TABLE demog...
how much chest tube did patient 013-28507 produce today?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid num...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND intakeoutput.celllabel = 'chest...
Below are sql tables 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 chest tube did patient 013-28507 produce today? ### Input: CREATE TABLE microlab ( microlabid number, patie...
Name the title for 446913
CREATE TABLE table_2409041_4 ( title VARCHAR, production_code VARCHAR )
SELECT title FROM table_2409041_4 WHERE production_code = 446913
Below are sql tables 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 title for 446913 ### Input: CREATE TABLE table_2409041_4 ( title VARCHAR, production_code VARCHAR ) ### Res...
Show all the buildings along with the number of faculty members the buildings have Plot them as bar chart, show in descending by the total number.
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( Fac...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building 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: Show all the buildings along with the number of faculty members the buildings have Plot them as bar chart, show in descendin...
Compare the total salary by each hire date (bin it into month interval) of employees using a bar chart, I want to show 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 HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(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: Compare the total salary by each hire date (bin it into month interval) of employees using a bar chart, I want to show by th...
A bar chart about what are the title and maximum price of each film?, and could you display by the Title in asc?
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: A bar chart about what are the title and maximum price of each film?, and could you display by the Title in asc? ### Input: ...
what is the year when then organisation is star awards, the result is won and the nominated work title is n/a?
CREATE TABLE table_name_98 ( year VARCHAR, nominated_work_title VARCHAR, organisation VARCHAR, result VARCHAR )
SELECT year FROM table_name_98 WHERE organisation = "star awards" AND result = "won" AND nominated_work_title = "n/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 is the year when then organisation is star awards, the result is won and the nominated work title is n/a? ### Input: CR...
what was the first year in which the result was 1st place ?
CREATE TABLE table_203_300 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "extra" text )
SELECT MIN("year") FROM table_203_300 WHERE "result" = 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 was the first year in which the result was 1st place ? ### Input: CREATE TABLE table_203_300 ( id number, "year...
What is the least common faculty rank?
CREATE TABLE department ( dno number, division text, dname text, room text, building text, dphone number ) CREATE TABLE minor_in ( stuid number, dno number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, adv...
SELECT rank FROM faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the least common faculty rank? ### Input: CREATE TABLE department ( dno number, division text, dname tex...
count the number of patients with procedure icd9 code 3615 who died on or before 2158.
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2158.0" AND procedures.icd9_code = "3615"
Below are sql tables 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 with procedure icd9 code 3615 who died on or before 2158. ### Input: CREATE TABLE lab ( sub...
How many figures are given for the New Democratic for the polling range May 11 31, 2010?
CREATE TABLE table_27099 ( "Polling Firm" text, "Date of Polling" text, "Link" text, "Progressive Conservative" real, "Liberal" real, "New Democratic" real )
SELECT COUNT("New Democratic") FROM table_27099 WHERE "Date of Polling" = 'May 11–31, 2010'
Below are sql tables 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 figures are given for the New Democratic for the polling range May 11 31, 2010? ### Input: CREATE TABLE table_27099...
For those employees who did not have any job in the past, visualize the relationship between salary and manager_id .
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEP...
SELECT SALARY, MANAGER_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, visualize the relationship between salary and manager_id . ### Inp...
since 2105 what are the four most common specimen test given to patients in the same month after being diagnosed with candidias urogenital nec?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses...
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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
Below are sql tables 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 2105 what are the four most common specimen test given to patients in the same month after being diagnosed with candid...
Who was the home team for the game played on November 2, 2007?
CREATE TABLE table_10524 ( "Date" text, "Visitor" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
SELECT "Home" FROM table_10524 WHERE "Date" = 'november 2, 2007'
Below are sql tables 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 for the game played on November 2, 2007? ### Input: CREATE TABLE table_10524 ( "Date" text, "V...
calculate the number of medications that patient 52898 has been prescribed in 2105.
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND STRFTIME('%y', prescriptions.startdate) = '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: calculate the number of medications that patient 52898 has been prescribed in 2105. ### Input: CREATE TABLE inputevents_cv (...
WHAT IS THE TO PAR FOR NUMBER 1?
CREATE TABLE table_name_18 ( to_par VARCHAR, place VARCHAR )
SELECT to_par FROM table_name_18 WHERE place = "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 TO PAR FOR NUMBER 1? ### Input: CREATE TABLE table_name_18 ( to_par VARCHAR, place VARCHAR ) ### Respons...
Tell me what theory courses are available , for Spring or Summer 2006 .
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, pr...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%theor...
Below are sql tables 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 what theory courses are available , for Spring or Summer 2006 . ### Input: CREATE TABLE requirement ( requiremen...
what is the to par when the player is hale irwin?
CREATE TABLE table_49337 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
SELECT "To par" FROM table_49337 WHERE "Player" = 'hale irwin'
Below are sql tables 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 when the player is hale irwin? ### Input: CREATE TABLE table_49337 ( "Place" text, "Player" text,...
what is maximum age of patients whose death status is 0 and age is greater than or equal to 64?
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 MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "64"
Below are sql tables 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 maximum age of patients whose death status is 0 and age is greater than or equal to 64? ### Input: CREATE TABLE pres...
i need a flight from NEW YORK to SAN FRANCISCO
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN F...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: i need a flight from NEW YORK to SAN FRANCISCO ### Input: CREATE TABLE flight_leg ( flight_id int, leg_number int, ...
Who was the girl on week 5 that came after week 3's Mikaela James?
CREATE TABLE table_61245 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
SELECT "Week 5" FROM table_61245 WHERE "Week 3" = 'mikaela james'
Below are sql tables 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 girl on week 5 that came after week 3's Mikaela James? ### Input: CREATE TABLE table_61245 ( "Week 1" text, ...
Whate place has 18 points with lost less than 8?
CREATE TABLE table_13093 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
SELECT COUNT("Place") FROM table_13093 WHERE "Points" = '18' AND "Lost" < '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: Whate place has 18 points with lost less than 8? ### Input: CREATE TABLE table_13093 ( "Place" real, "Team" text, ...
what are the names of projects that require more than 300 hours, and how many scientists are assigned to each?, and show total number in desc order.
CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) )
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the names of projects that require more than 300 hours, and how many scientists are assigned to each?, and show tot...
For each policy type, return its type code and its count in the record Visualize by bar chart, could you rank bar in ascending order?
CREATE TABLE Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATETIME, End_Date DATETIME ) CREATE TABLE Claims_Documents ( Claim_ID INTEGER, Document_Type_Code CHAR(15), Created_by_Staff_ID INTEGER, Created_Date INTEGER ) CREATE TABLE Claim_...
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY Policy_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: For each policy type, return its type code and its count in the record Visualize by bar chart, could you rank bar in ascendi...
What course would be the most difficult of the courses I 've taken ?
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CR...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) ...
Below are sql tables 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 course would be the most difficult of the courses I 've taken ? ### Input: CREATE TABLE ta ( campus_job_id int, ...
provide the number of patients whose primary disease is aortic valve insuffiency\aortic valve replacement /sda and year of birth is less than 2076?
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.dob_year < "2076"
Below are sql tables 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 primary disease is aortic valve insuffiency\aortic valve replacement /sda and year of b...
what is the output that patient 52456 first had on last month/06?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52456)) AND DATETIME(outputevents.charttim...
Below are sql tables 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 output that patient 52456 first had on last month/06? ### Input: CREATE TABLE d_icd_diagnoses ( row_id numbe...
show me flights from NEW YORK to MIAMI
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI...
Below are sql tables 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 flights from NEW YORK to MIAMI ### Input: CREATE TABLE code_description ( code varchar, description text ) ...
Show the total number of platforms of locations in each location in a bar chart, and could you show in descending by the y-axis please?
CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE t...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) 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 total number of platforms of locations in each location in a bar chart, and could you show in descending by the y-a...
Show the average of population from each status, rank from low to high by the X.
CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, Hosts text ) CREATE TABLE city ( City_ID int, Official_Name text, Status text, Area_km_2 real, Population real, Census_Ranking text ) CREATE TABLE farm ( Farm_ID int, Year in...
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY Status
Below are sql tables 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 average of population from each status, rank from low to high by the X. ### Input: CREATE TABLE farm_competition ( ...
When did the staff member with first name as Janessa and last name as Sawayn leave the company?
CREATE TABLE Staff ( date_left_staff VARCHAR, first_name VARCHAR, last_name VARCHAR )
SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
Below are sql tables 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 the staff member with first name as Janessa and last name as Sawayn leave the company? ### Input: CREATE TABLE Staf...