instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
what is admission location and procedure short title of subject id 2560?
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.admission_location, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is admission location and procedure short title of subject id 2560? ### Input: CREATE TABLE prescriptions ( subject...
What is the score of the game when they had a record of 22 19 4?
CREATE TABLE table_51475 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
SELECT "Score" FROM table_51475 WHERE "Record" = '22–19–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: What is the score of the game when they had a record of 22 19 4? ### Input: CREATE TABLE table_51475 ( "Date" text, ...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of salary bin hire_date by weekday, and show Y in ascending order please.
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the di...
Name the position for nhl team being los angeles kings
CREATE TABLE table_23122 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
SELECT "Position" FROM table_23122 WHERE "NHL team" = 'Los Angeles Kings'
Below are sql tables 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 position for nhl team being los angeles kings ### Input: CREATE TABLE table_23122 ( "Pick #" real, "Player"...
For each policy type, return its type code and its count in the record Visualize by bar chart, and order from high to low by the X please.
CREATE TABLE Claim_Headers ( Claim_Header_ID INTEGER, Claim_Status_Code CHAR(15), Claim_Type_Code CHAR(15), Policy_ID INTEGER, Date_of_Claim DATETIME, Date_of_Settlement DATETIME, Amount_Claimed DECIMAL(20,4), Amount_Piad DECIMAL(20,4) ) CREATE TABLE Claims_Processing ( Claim_Proces...
SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY Policy_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: For each policy type, return its type code and its count in the record Visualize by bar chart, and order from high to low by...
who is the the voice actor (japanese) with character name being goku
CREATE TABLE table_19134 ( "Character Name" text, "Voice Actor (Japanese)" text, "Voice Actor (English 1997 / Saban)" text, "Voice Actor (English 1998 / Pioneer)" text, "Voice Actor (English 2006 / FUNimation)" text )
SELECT "Voice Actor (Japanese)" FROM table_19134 WHERE "Character Name" = 'Goku'
Below are sql tables 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 is the the voice actor (japanese) with character name being goku ### Input: CREATE TABLE table_19134 ( "Character Na...
What opponent has l 27-7 as the result?
CREATE TABLE table_66422 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT "Opponent" FROM table_66422 WHERE "Result" = 'l 27-7'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What opponent has l 27-7 as the result? ### Input: CREATE TABLE table_66422 ( "Week" real, "Date" text, "Opponen...
What is the away team name that has a score of 7.10 (52)?
CREATE TABLE table_33772 ( "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_33772 WHERE "Away team score" = '7.10 (52)'
Below are sql tables 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 away team name that has a score of 7.10 (52)? ### Input: CREATE TABLE table_33772 ( "Home team" text, "H...
did patient 83038 received any diagnoses in 2105?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: did patient 83038 received any diagnoses in 2105? ### Input: CREATE TABLE admissions ( row_id number, subject_id num...
If the area is 34.73, what is the census ranking?
CREATE TABLE table_21369 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text )
SELECT "Census Ranking" FROM table_21369 WHERE "Area km 2" = '34.73'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: If the area is 34.73, what is the census ranking? ### Input: CREATE TABLE table_21369 ( "Official Name" text, "Statu...
Draw a bar chart for what are the different classes of races, and how many races correspond to each?, and rank y-axis in descending order.
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart for what are the different classes of races, and how many races correspond to each?, and rank y-axis in des...
list the top five most frequent drugs that patients were prescribed with within 2 months after they were prescribed cefepime this year.
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, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'cefepime' AND DATETIME(medication.drugstarttime, '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: list the top five most frequent drugs that patients were prescribed with within 2 months after they were prescribed cefepime...
how many patients who had procedure icd9 code 3722 died before discharge?
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.discharge_location = "DEAD/EXPIRED" AND procedures.icd9_code = "3722"
Below are sql tables 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 who had procedure icd9 code 3722 died before discharge? ### Input: CREATE TABLE lab ( subject_id text,...
Which player scored 71?
CREATE TABLE table_51033 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
SELECT "Player" FROM table_51033 WHERE "Score" = '71'
Below are sql tables 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 player scored 71? ### Input: CREATE TABLE table_51033 ( "Place" text, "Player" text, "Country" text, "...
What was the circuit had a race on September 20.
CREATE TABLE table_74919 ( "Race" text, "Class(es)" text, "Length/Duration" text, "Circuit" text, "Date" text )
SELECT "Circuit" FROM table_74919 WHERE "Date" = 'september 20'
Below are sql tables 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 circuit had a race on September 20. ### Input: CREATE TABLE table_74919 ( "Race" text, "Class(es)" text...
Show me a bar chart for how many movie reviews does each director get?, and order bars in ascending order.
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director ORDER BY director
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart for how many movie reviews does each director get?, and order bars in ascending order. ### Input: CREATE...
what was the name of the first specimen test that patient 70267 received in 12/this year?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid nu...
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', micro...
Below are sql tables 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 first specimen test that patient 70267 received in 12/this year? ### Input: CREATE TABLE d_labitems...
What time of the day do ORALSURG 750 lectures start next semester ?
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_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.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 course.department = 'ORALSURG' AND cours...
Below are sql tables 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 time of the day do ORALSURG 750 lectures start next semester ? ### Input: CREATE TABLE course_prerequisite ( pre_co...
How many books fall into each category?
CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id ...
SELECT category, COUNT(*) FROM book_club GROUP BY category
Below are sql tables 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 books fall into each category? ### Input: CREATE TABLE movie ( movie_id number, title text, year number...
Top Perl users from India.
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top Perl users from India. ### Input: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, ...
Show me mean rating by languages in a histogram, and list by the names from low to high please.
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(5...
SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages
Below are sql tables 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 mean rating by languages in a histogram, and list by the names from low to high please. ### Input: CREATE TABLE arti...
Return a bar chart about the distribution of Nationality and the sum of ID , and group by attribute Nationality, order in asc by the total number.
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY SUM(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: Return a bar chart about the distribution of Nationality and the sum of ID , and group by attribute Nationality, order in as...
What is the college/junior/club team (league) of the player who was pick number 130?
CREATE TABLE table_72511 ( "Round" real, "Pick #" text, "Player" text, "Position" text, "Nationality" text, "College/junior/club team (league)" text )
SELECT "College/junior/club team (league)" FROM table_72511 WHERE "Pick #" = '130'
Below are sql tables 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 college/junior/club team (league) of the player who was pick number 130? ### Input: CREATE TABLE table_72511 ( ...
Please visualize a bar chart, that the X-axis is the director and the Y-axis is thier corresponding lowest rating among all movies, sort in ascending by the x axis.
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
SELECT director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY director ORDER BY director
Below are sql tables 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 visualize a bar chart, that the X-axis is the director and the Y-axis is thier corresponding lowest rating among all ...
when patient 002-67875 received the first laboratory test in 02/2105?
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 lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-67875')) AND STRFTIME('%y-%m', lab.labresulttime) = '2105-02' ORDER BY lab.labr...
Below are sql tables 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 patient 002-67875 received the first laboratory test in 02/2105? ### Input: CREATE TABLE lab ( labid number, pa...
calculate the total number of female patients treated with drug code lora2i
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "LORA2I"
Below are sql tables 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 total number of female patients treated with drug code lora2i ### Input: CREATE TABLE lab ( subject_id tex...
Who was the opponent in the game that was attended by 42,000 people?
CREATE TABLE table_6707 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text )
SELECT "Opponent#" FROM table_6707 WHERE "Attendance" = '42,000'
Below are sql tables 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 opponent in the game that was attended by 42,000 people? ### Input: CREATE TABLE table_6707 ( "Date" text, ...
When 446004 is the production code who are the writers?
CREATE TABLE table_26551 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
SELECT "Written by" FROM table_26551 WHERE "Production code" = '446004'
Below are sql tables 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 446004 is the production code who are the writers? ### Input: CREATE TABLE table_26551 ( "No. in series" real, ...
What is Event, when Position is 6th, and when Year is after 2006?
CREATE TABLE table_49682 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
SELECT "Event" FROM table_49682 WHERE "Position" = '6th' AND "Year" > '2006'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Event, when Position is 6th, and when Year is after 2006? ### Input: CREATE TABLE table_49682 ( "Year" real, ...
Who was the opponent for the game played on September 19, 1994?
CREATE TABLE table_42911 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT "Opponent" FROM table_42911 WHERE "Date" = 'september 19, 1994'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the opponent for the game played on September 19, 1994? ### Input: CREATE TABLE table_42911 ( "Week" real, "...
What was the series in season 2009?
CREATE TABLE table_name_61 ( series VARCHAR, season VARCHAR )
SELECT series FROM table_name_61 WHERE season = 2009
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the series in season 2009? ### Input: CREATE TABLE table_name_61 ( series VARCHAR, season VARCHAR ) ### Res...
Which game at Arden Street Oval had the lowest attendance?
CREATE TABLE table_name_96 ( crowd INTEGER, venue VARCHAR )
SELECT MIN(crowd) FROM table_name_96 WHERE venue = "arden street 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: Which game at Arden Street Oval had the lowest attendance? ### Input: CREATE TABLE table_name_96 ( crowd INTEGER, ve...
provide the number of patients whose admission location is emergency room admit and admission year is less than 2155?
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.admityear < "2155"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: provide the number of patients whose admission location is emergency room admit and admission year is less than 2155? ### In...
creatinine clearance ( cl ) of < 45 ml / min
CREATE TABLE table_train_115 ( "id" int, "systolic_blood_pressure_sbp" int, "hepatic_disease" bool, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "uncontrolled_blood_pressure" bool, "NOUSE" float )
SELECT * FROM table_train_115 WHERE creatinine_clearance_cl < 45
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: creatinine clearance ( cl ) of < 45 ml / min ### Input: CREATE TABLE table_train_115 ( "id" int, "systolic_blood_pre...
What home is dated march 19?
CREATE TABLE table_47742 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
SELECT "Home" FROM table_47742 WHERE "Date" = 'march 19'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What home is dated march 19? ### Input: CREATE TABLE table_47742 ( "Date" text, "Visitor" text, "Score" text, ...
What are the names of countries that have both players with position forward and players with position defender?
CREATE TABLE country ( Country_name VARCHAR, Country_id VARCHAR ) CREATE TABLE match_season ( Country VARCHAR, Position VARCHAR )
SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
Below are sql tables 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 countries that have both players with position forward and players with position defender? ### Input: ...
What team played at Moorabbin Oval to a crowd of 19,144?
CREATE TABLE table_78087 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Home team" FROM table_78087 WHERE "Crowd" > '19,144' AND "Venue" = 'moorabbin oval'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team played at Moorabbin Oval to a crowd of 19,144? ### Input: CREATE TABLE table_78087 ( "Home team" text, "Ho...
Tell me the circuit for 20 august
CREATE TABLE table_31561 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
SELECT "Circuit" FROM table_31561 WHERE "Date" = '20 august'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Tell me the circuit for 20 august ### Input: CREATE TABLE table_31561 ( "Name" text, "Circuit" text, "Date" text...
What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9?
CREATE TABLE table_name_51 ( reservation VARCHAR )
SELECT SUM(1979) FROM table_name_51 WHERE reservation = "standing rock indian reservation" AND 1989 < 54.9
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than 54.9? ### Input: CREATE TABLE table_...
What position was taken out of Louisiana-Lafayette?
CREATE TABLE table_16575609_1 ( position VARCHAR, college VARCHAR )
SELECT position FROM table_16575609_1 WHERE college = "Louisiana-Lafayette"
Below are sql tables 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 position was taken out of Louisiana-Lafayette? ### Input: CREATE TABLE table_16575609_1 ( position VARCHAR, col...
What is the lowest crowd seen by the mcg Venue?
CREATE TABLE table_77827 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT MIN("Crowd") FROM table_77827 WHERE "Venue" = 'mcg'
Below are sql tables 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 crowd seen by the mcg Venue? ### Input: CREATE TABLE table_77827 ( "Home team" text, "Home team s...
Which section after 10:00 is in PERSIAN 499 ?
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'PERSIAN' AND course.number = 499 AND semester.semester = 'WN' 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: Which section after 10:00 is in PERSIAN 499 ? ### Input: CREATE TABLE course ( course_id int, name varchar, depa...
the value of hematocrit second measured on the first hospital visit in patient 43959 was greater than first measured on the first hospital visit?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_care...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43959 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
Below are sql tables 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 value of hematocrit second measured on the first hospital visit in patient 43959 was greater than first measured on the ...
What was the away teams score at Princes Park?
CREATE TABLE table_10764 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_10764 WHERE "Venue" = 'princes park'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the away teams score at Princes Park? ### Input: CREATE TABLE table_10764 ( "Home team" text, "Home team sc...
flights from NEWARK NEW JERSEY to MINNEAPOLIS
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops 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, flight, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: flights from NEWARK NEW JERSEY to MINNEAPOLIS ### Input: CREATE TABLE flight ( aircraft_code_sequence text, airline_...
i need a flight from ATLANTA to CHARLOTTE NORTH CAROLINA next monday
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartmen...
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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number = 21 AND date_day.month_number ...
Below are sql tables 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 ATLANTA to CHARLOTTE NORTH CAROLINA next monday ### Input: CREATE TABLE fare_basis ( fare_basis_cod...
specify the number of patients admitted to emergency who had icd9 code 5091
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "5091"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: specify the number of patients admitted to emergency who had icd9 code 5091 ### Input: CREATE TABLE lab ( subject_id tex...
which employer has the largest number of employees ?
CREATE TABLE table_203_737 ( id number, "#" number, "employer" text, "# of employees" number )
SELECT "employer" FROM table_203_737 ORDER BY "# of employees" 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: which employer has the largest number of employees ? ### Input: CREATE TABLE table_203_737 ( id number, "#" number, ...
What is 2006 has a 2007 of 3r?
CREATE TABLE table_name_48 ( Id VARCHAR )
SELECT 2006 FROM table_name_48 WHERE 2007 = "3r"
Below are sql tables 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 2006 has a 2007 of 3r? ### Input: CREATE TABLE table_name_48 ( Id VARCHAR ) ### Response: SELECT 2006 FROM table...
Give a me a bar graph to show the friends's name, and ages of all people who are older than the average age of a person, show by the X-axis in desc please.
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 T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY T1.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: Give a me a bar graph to show the friends's name, and ages of all people who are older than the average age of a person, sho...
What was the average crowd size for the game where the away team scored 10.11 (71)?
CREATE TABLE table_33528 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT AVG("Crowd") FROM table_33528 WHERE "Away team score" = '10.11 (71)'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the average crowd size for the game where the away team scored 10.11 (71)? ### Input: CREATE TABLE table_33528 ( ...
What is 2004, when 2005 is '2R', and when 2006 is '1R
CREATE TABLE table_44848 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text )
SELECT "2004" FROM table_44848 WHERE "2005" = '2r' AND "2006" = '1r'
Below are sql tables 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 2004, when 2005 is '2R', and when 2006 is '1R ### Input: CREATE TABLE table_44848 ( "Tournament" text, "2004...
what is the number of tournaments listed on the chart ?
CREATE TABLE table_204_328 ( id number, "no." number, "date" text, "tournament" text, "winning score" text, "margin of\nvictory" text, "runner(s)-up" text )
SELECT COUNT("tournament") FROM table_204_328
Below are sql tables 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 tournaments listed on the chart ? ### Input: CREATE TABLE table_204_328 ( id number, "no." num...
Who is the constructor with the grid of 8?
CREATE TABLE table_55691 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Constructor" FROM table_55691 WHERE "Grid" = '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: Who is the constructor with the grid of 8? ### Input: CREATE TABLE table_55691 ( "Driver" text, "Constructor" text, ...
how many female patients are lab tested under category blood gas?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" 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: how many female patients are lab tested under category blood gas? ### Input: CREATE TABLE procedures ( subject_id text, ...
count the number of times that since 961 days ago patient 015-56556 had taken total.
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(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
Below are sql tables 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 times that since 961 days ago patient 015-56556 had taken total. ### Input: CREATE TABLE patient ( u...
What is the name when the position is de and college is ohio state?
CREATE TABLE table_1198175_1 ( name VARCHAR, position VARCHAR, college VARCHAR )
SELECT name FROM table_1198175_1 WHERE position = "DE" AND college = "Ohio State"
Below are sql tables 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 when the position is de and college is ohio state? ### Input: CREATE TABLE table_1198175_1 ( name VARCH...
what is the lowest price fare from ATLANTA to SAN FRANCISCO on flight DL 82 and DL 139
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, d...
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 AS FLIGHT_0, flight AS FLIGHT_1, flight_fare, flight_leg WHERE ((FLIGHT_1.flight_number = 139 OR FLIGHT_1.flight_number = 82) AND CITY_1.city_code = AIRPORT_SERVICE_...
Below are sql tables 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 price fare from ATLANTA to SAN FRANCISCO on flight DL 82 and DL 139 ### Input: CREATE TABLE city ( ci...
Please compare the credit score of the customers who have some loans by a bar chart, and sort in asc by the y-axis.
CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, s...
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score
Below are sql tables 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 compare the credit score of the customers who have some loans by a bar chart, and sort in asc by the y-axis. ### Inpu...
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_name_58 ( driver VARCHAR, constructor VARCHAR, time_retired VARCHAR, grid VARCHAR, laps VARCHAR )
SELECT driver FROM table_name_58 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...
what is age and death status of subject name lue white?
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 demographic.age, demographic.expire_flag FROM demographic WHERE demographic.name = "Lue White"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is age and death status of subject name lue white? ### Input: CREATE TABLE lab ( subject_id text, hadm_id text,...
what is the date when scorers is parkinson?
CREATE TABLE table_13295 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Scorers" text )
SELECT "Date" FROM table_13295 WHERE "Scorers" = 'parkinson'
Below are sql tables 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 scorers is parkinson? ### Input: CREATE TABLE table_13295 ( "Date" text, "Opponent" text, ...
Microservices trend (# of questions per month).
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Microservices trend (# of questions per month). ### Input: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId ...
give me the number of patients whose lab test name is troponin i?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Troponin 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: give me the number of patients whose lab test name is troponin i? ### Input: CREATE TABLE lab ( subject_id text, had...
count the number of patients whose procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter of oddi and lab test category is hematology?
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" AND lab."CATEGORY" = "Hematology"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of patients whose procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter of ...
Find the organisation ids and details of the organisations which are involved i. Visualize by bar chart.
CREATE TABLE Research_Staff ( staff_id INTEGER, employer_organisation_id INTEGER, staff_details VARCHAR(255) ) CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details VARCHAR(255) ) CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details ...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details
Below are sql tables 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 organisation ids and details of the organisations which are involved i. Visualize by bar chart. ### Input: CREATE T...
please list the FRIDAY afternoon flights from SAN JOSE to DALLAS on AA
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_clas...
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, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND days.day_name = 'FRIDAY' AND flight.flight_days = days.days_code 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: please list the FRIDAY afternoon flights from SAN JOSE to DALLAS on AA ### Input: CREATE TABLE date_day ( month_number i...
Is there an REES 289 section not on Monday next semester ?
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 DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'REES' AND course.number = 289 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.y...
Below are sql tables 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 an REES 289 section not on Monday next semester ? ### Input: CREATE TABLE requirement ( requirement_id int, ...
when is the first time patient 002-13750 was prescribed a drug in 04/this year?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
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 = '002-13750')) AND DATETIME(medication.drugstarttime, 'start of ...
Below are sql tables 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 is the first time patient 002-13750 was prescribed a drug in 04/this year? ### Input: CREATE TABLE cost ( costid nu...
How many bank branches are there?
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABL...
SELECT COUNT(*) FROM bank
Below are sql tables 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 bank branches are there? ### Input: CREATE TABLE bank ( branch_id number, bname text, no_of_customers n...
Who is the Opponent of the match with a Record of 0-1?
CREATE TABLE table_14159 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Time" text, "Location" text )
SELECT "Opponent" FROM table_14159 WHERE "Record" = '0-1'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who is the Opponent of the match with a Record of 0-1? ### Input: CREATE TABLE table_14159 ( "Res." text, "Record" t...
Name the number for viewers being 1.87
CREATE TABLE table_22903 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
SELECT MAX("#") FROM table_22903 WHERE "U.S. viewers (million)" = '1.87'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the number for viewers being 1.87 ### Input: CREATE TABLE table_22903 ( "No." real, "#" real, "Title" text,...
how much was patient 19412's body weight last measured in this month?
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT 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 = 19412)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
Below are sql tables 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 was patient 19412's body weight last measured in this month? ### Input: CREATE TABLE admissions ( row_id number...
What is the in-state area with an outlet of South Platte River and Big Thompson river as the basin?
CREATE TABLE table_7722 ( "Basin" text, "Outlet" text, "Total Area" text, "In-State Area" text, "% In-State" text )
SELECT "In-State Area" FROM table_7722 WHERE "Outlet" = 'south platte river' AND "Basin" = 'big thompson river'
Below are sql tables 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 in-state area with an outlet of South Platte River and Big Thompson river as the basin? ### Input: CREATE TABLE ...
Which Winning score has a Date of aug 26, 1973?
CREATE TABLE table_name_42 ( winning_score VARCHAR, date VARCHAR )
SELECT winning_score FROM table_name_42 WHERE date = "aug 26, 1973"
Below are sql tables 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 Winning score has a Date of aug 26, 1973? ### Input: CREATE TABLE table_name_42 ( winning_score VARCHAR, date ...
What rank is Takat riki having less than 30 total?
CREATE TABLE table_58731 ( "Name" text, "Total" real, "First" text, "Last" text, "Highest rank" text )
SELECT "Highest rank" FROM table_58731 WHERE "Total" < '30' AND "Name" = 'takatōriki'
Below are sql tables 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 rank is Takat riki having less than 30 total? ### Input: CREATE TABLE table_58731 ( "Name" text, "Total" real, ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of job_id and the average of manager_id , and group by attribute job_id, and rank names in desc order please.
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
give me the number of patients whose admission year is less than 2170 and diagnoses short title is malig neo bladder nec?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2170" AND diagnoses.short_title = "Malig neo bladder NEC"
Below are sql tables 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 year is less than 2170 and diagnoses short title is malig neo bladder nec? ##...
Name the eps for net profit being 39.2
CREATE TABLE table_18304259_1 ( earnings_per_share__p_ VARCHAR, net_profit__£m_ VARCHAR )
SELECT earnings_per_share__p_ FROM table_18304259_1 WHERE net_profit__£m_ = "39.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: Name the eps for net profit being 39.2 ### Input: CREATE TABLE table_18304259_1 ( earnings_per_share__p_ VARCHAR, ne...
What place did the golfer who had a score of 69-68-69-70=276 finish in?
CREATE TABLE table_name_11 ( place VARCHAR, score VARCHAR )
SELECT place FROM table_name_11 WHERE score = 69 - 68 - 69 - 70 = 276
Below are sql tables 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 place did the golfer who had a score of 69-68-69-70=276 finish in? ### Input: CREATE TABLE table_name_11 ( place VA...
What's the number of touchdowns that Snow made that had 0 field goals, more than 5 points, and more than 0 extra points?
CREATE TABLE table_34978 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
SELECT MIN("Touchdowns") FROM table_34978 WHERE "Points" > '5' AND "Field goals" = '0' AND "Player" = 'snow' AND "Extra 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's the number of touchdowns that Snow made that had 0 field goals, more than 5 points, and more than 0 extra points? ###...
Visualize a bar chart for how many workshops did each author submit to? Return the author name and the number of workshops.
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text )
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_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: Visualize a bar chart for how many workshops did each author submit to? Return the author name and the number of workshops. ...
what is subject name and icu stay id of subject id 76446?
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 demographic.name, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "76446"
Below are sql tables 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 subject name and icu stay id of subject id 76446? ### Input: CREATE TABLE lab ( subject_id text, hadm_id tex...
This Spring are there any CLLING classes considered upper-level ?
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
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 = 'CLLING' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri...
Below are sql tables 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 Spring are there any CLLING classes considered upper-level ? ### Input: CREATE TABLE course ( course_id int, na...
Find All_Home and Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and I want to show total number from high to low order please.
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home 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: Find All_Home and Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and I want to show total num...
What boat was laid down on 25 april 1887?
CREATE TABLE table_75743 ( "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" real )
SELECT "Name" FROM table_75743 WHERE "Laid down" = '25 april 1887'
Below are sql tables 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 boat was laid down on 25 april 1887? ### Input: CREATE TABLE table_75743 ( "Name" text, "Builder" text, "La...
10 users with the top average answer score.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT OwnerUserId, AVG(Score) AS AvgScore, COUNT(*) AS AnswersPosted FROM Posts WHERE PostTypeId = 2 AND OwnerUserId > 0 GROUP BY OwnerUserId ORDER BY AVG(Score) DESC LIMIT 10
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: 10 users with the top average answer score. ### Input: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, ...
What are the wines that have prices lower than 50 and have appelations in Monterey county, and count them by a bar chart, list x axis from high to low order.
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name 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 wines that have prices lower than 50 and have appelations in Monterey county, and count them by a bar chart, li...
What' the series number of the episode with season number 13?
CREATE TABLE table_2226817_6 ( no_in_series INTEGER, no_in_season VARCHAR )
SELECT MIN(no_in_series) FROM table_2226817_6 WHERE no_in_season = 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: What' the series number of the episode with season number 13? ### Input: CREATE TABLE table_2226817_6 ( no_in_series INT...
is there any record of the microbiology test in their current hospital encounter for patient 031-3355?
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
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-3355' AND patient.hospitaldischargetime 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: is there any record of the microbiology test in their current hospital encounter for patient 031-3355? ### Input: CREATE TAB...
what do you have tomorrow after 500 o'clock from ATLANTA to SAN FRANCISCO
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_stop ( flight_id in...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 20 AND date_day.month_number = 1 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: what do you have tomorrow after 500 o'clock from ATLANTA to SAN FRANCISCO ### Input: CREATE TABLE time_zone ( time_zone_...
has patient 3229 in 12/2105 been tested for the po2?
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3229) AND STRFTIME('%y-%m', labevents.charttime) = '2105-12'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 3229 in 12/2105 been tested for the po2? ### Input: CREATE TABLE microbiologyevents ( row_id number, sub...
what is the cost of a round trip ticket FIRST class between OAK and ATL
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name t...
SELECT DISTINCT fare.fare_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, fare, fare_basis, flight, flight_fare WHERE (AIRPORT_0.airport_code = 'OAK' AND AIRPORT_1.airport_code = 'ATL' AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AN...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the cost of a round trip ticket FIRST class between OAK and ATL ### Input: CREATE TABLE flight_leg ( flight_id i...
Is a lab included in 579 ?
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 579
Below are sql tables 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 a lab included in 579 ? ### Input: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_qui...
give me the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and age is less than 89?
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.age < "89"
Below are sql tables 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 primary disease is coronary artery disease\coronary artery bypass graft /sda and age is...
What was Collingwood's score in their away game?
CREATE TABLE table_56862 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_56862 WHERE "Away 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 was Collingwood's score in their away game? ### Input: CREATE TABLE table_56862 ( "Home team" text, "Home team ...
The CS-LSA degree has what requirements ?
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, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as ...
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.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: The CS-LSA degree has what requirements ? ### Input: CREATE TABLE program_requirement ( program_id int, category var...
Which parts have more than 2 faults? Show the part name and id. Show a pie chart.
CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_contract_company_id INTEGER, contract_start_date DATETIME, contract_end_date DATETIME, other_contract_details VARCHAR(255) ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), ...
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which parts have more than 2 faults? Show the part name and id. Show a pie chart. ### Input: CREATE TABLE Maintenance_Contra...
what is the number of patients who stayed in careunit sicu until 4 years ago?
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number,...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'sicu' AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-4 year'))
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients who stayed in careunit sicu until 4 years ago? ### Input: CREATE TABLE patients ( row_id ...
What venue has more than 50,715 attending?
CREATE TABLE table_43552 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text )
SELECT "Venue" FROM table_43552 WHERE "Attendance" > '50,715'
Below are sql tables 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 venue has more than 50,715 attending? ### Input: CREATE TABLE table_43552 ( "Date" text, "Round" text, "Opp...