instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
the last time patient 21074 was prescribed syringe and amiodarone hcl at the same time in 05/2103?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'amiodarone hcl' AND admissions.subject_id = 21074 AND STRFTIME('%y-%m', prescriptions.startdate) = '2103-05') AS t1 JOIN (SELECT ad...
Below are sql tables 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 last time patient 21074 was prescribed syringe and amiodarone hcl at the same time in 05/2103? ### Input: CREATE TABLE l...
How many cards in different card type code? Plot a bar chart, rank by the x axis in desc.
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_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: How many cards in different card type code? Plot a bar chart, rank by the x axis in desc. ### Input: CREATE TABLE Customers_...
Draw a bar chart for how many captains with younger than 50 are in each rank?, and show Y-axis in descending order.
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank 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 how many captains with younger than 50 are in each rank?, and show Y-axis in descending order. ### Inpu...
Tell me the number of patients who died in or before 2174 and had drug code osel75.
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2174.0" AND prescriptions.formulary_drug_cd = "OSEL75"
Below are sql tables 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 number of patients who died in or before 2174 and had drug code osel75. ### Input: CREATE TABLE demographic ( ...
what is the country where the player is phil mickelson?
CREATE TABLE table_13282157_1 ( country VARCHAR, player VARCHAR )
SELECT country FROM table_13282157_1 WHERE player = "Phil Mickelson"
Below are sql tables 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 country where the player is phil mickelson? ### Input: CREATE TABLE table_13282157_1 ( country VARCHAR, ...
how many total wins has he had ?
CREATE TABLE table_203_359 ( id number, "outcome" text, "year" number, "championship" text, "surface" text, "opponent" text, "score" text )
SELECT COUNT(*) FROM table_203_359 WHERE "outcome" = 'winner'
Below are sql tables 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 total wins has he had ? ### Input: CREATE TABLE table_203_359 ( id number, "outcome" text, "year" numbe...
What was the original name for the song performed by Brad Kavanagh?
CREATE TABLE table_8772 ( "Song" text, "Original Name" text, "Country" text, "Language" text, "Singer(s)" text )
SELECT "Original Name" FROM table_8772 WHERE "Singer(s)" = 'brad kavanagh'
Below are sql tables 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 original name for the song performed by Brad Kavanagh? ### Input: CREATE TABLE table_8772 ( "Song" text, ...
Visualize a bar chart about the distribution of Date_of_Birth and Weight , and I want to sort from high to low by the X-axis.
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Date_of_Birth, Weight FROM people ORDER BY Date_of_Birth DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart about the distribution of Date_of_Birth and Weight , and I want to sort from high to low by the X-axis...
How did Johnnie Parsons finish when his qualifying time was 135.328?
CREATE TABLE table_67062 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
SELECT "Rank" FROM table_67062 WHERE "Qual" = '135.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: How did Johnnie Parsons finish when his qualifying time was 135.328? ### Input: CREATE TABLE table_67062 ( "Year" text, ...
how many patients the previous year have had a skin scrapings test?
CREATE TABLE d_icd_procedures ( 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 d_labitems ( row_id...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'skin scrapings' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients the previous year have had a skin scrapings test? ### Input: CREATE TABLE d_icd_procedures ( row_id nu...
Bar chart of how many date of enrolment from each date of enrolment, and could you rank by the y-axis in desc?
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) 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: Bar chart of how many date of enrolment from each date of enrolment, and could you rank by the y-axis in desc? ### Input: CR...
count the number of patients who were prescribed nitroglycerin within the same month following a portal contr phlebogram procedure in a year before.
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'portal cont...
Below are sql tables 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 who were prescribed nitroglycerin within the same month following a portal contr phlebogram pro...
What is the sum of Game, when Date is 'Wed. Nov. 14'?
CREATE TABLE table_48838 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
SELECT SUM("Game") FROM table_48838 WHERE "Date" = 'wed. nov. 14'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of Game, when Date is 'Wed. Nov. 14'? ### Input: CREATE TABLE table_48838 ( "Game" real, "Date" text...
What film did abdelatif hwidar direct that was in the short film 2007 prix uip category?
CREATE TABLE table_79891 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
SELECT "Film" FROM table_79891 WHERE "Category" = 'short film 2007 prix uip' AND "Director(s)" = 'abdelatif hwidar'
Below are sql tables 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 film did abdelatif hwidar direct that was in the short film 2007 prix uip category? ### Input: CREATE TABLE table_79891...
what 's restriction ap68
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CRE...
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/68'
Below are sql tables 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 restriction ap68 ### Input: CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar...
How many entrepreneurs correspond to each investor, and show from high to low by the bars please.
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many entrepreneurs correspond to each investor, and show from high to low by the bars please. ### Input: CREATE TABLE en...
what procedure was performed on patient 022-115938 for the last time until 2 years ago?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-115938')) AND DATETIME(treatment.treatmenttime) <= DATETIME(C...
Below are sql tables 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 procedure was performed on patient 022-115938 for the last time until 2 years ago? ### Input: CREATE TABLE medication (...
Does ES offer 9 -credit courses ?
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT DISTINCT name, number FROM course WHERE department = 'ES' AND credits = 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: Does ES offer 9 -credit courses ? ### Input: CREATE TABLE program ( program_id int, name varchar, college varcha...
Draw a bar chart to compare the stars of each movie by title, and show X-axis in descending order.
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY title 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 to compare the stars of each movie by title, and show X-axis in descending order. ### Input: CREATE TABLE M...
What was the score of the game with a H/A/N of H and a record of 12-24?
CREATE TABLE table_name_12 ( score VARCHAR, h_a_n VARCHAR, record VARCHAR )
SELECT score FROM table_name_12 WHERE h_a_n = "h" AND record = "12-24"
Below are sql tables 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 score of the game with a H/A/N of H and a record of 12-24? ### Input: CREATE TABLE table_name_12 ( score VA...
What is the average age for each gender of student? Return a bar chart, and display from low to high by the the average of age.
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREAT...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average age for each gender of student? Return a bar chart, and display from low to high by the the average of a...
Name the max top 5 for 5.0 avg finish
CREATE TABLE table_20991 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
SELECT MAX("Top 5") FROM table_20991 WHERE "Avg. Finish" = '5.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: Name the max top 5 for 5.0 avg finish ### Input: CREATE TABLE table_20991 ( "Year" real, "Starts" real, "Wins" r...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday, display Y-axis in desc order.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the a...
Provide the full names of employees earning more than the employee with id 163.
CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id number ) CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE countries ( country_id text, countr...
SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163)
Below are sql tables 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 full names of employees earning more than the employee with id 163. ### Input: CREATE TABLE departments ( de...
Top 1000 users from Colombia.
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%colombia%' ORDER BY Reputation DESC LIMIT 1000
Below are sql tables 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 1000 users from Colombia. ### Input: CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ...
How many enrolment students in each month? Return a bar chart binning date of enrolment by month interval, order in desc by the Y-axis.
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARC...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many enrolment students in each month? Return a bar chart binning date of enrolment by month interval, order in desc by ...
at the 2006 gran premio telmex , who scored the highest number of points ?
CREATE TABLE table_204_496 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
SELECT "driver" FROM table_204_496 ORDER BY "points" 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: at the 2006 gran premio telmex , who scored the highest number of points ? ### Input: CREATE TABLE table_204_496 ( id nu...
give me the number of patients under 81 years who were ordered to get urine creatinine lab test.
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "81" AND lab.label = "Creatinine, Urine"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients under 81 years who were ordered to get urine creatinine lab test. ### Input: CREATE TABLE pre...
Which match was played on April 2, 2006?
CREATE TABLE table_4676 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
SELECT "Competition" FROM table_4676 WHERE "Date" = 'april 2, 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: Which match was played on April 2, 2006? ### Input: CREATE TABLE table_4676 ( "Date" text, "Venue" text, "Score"...
What publishers produce product number SLUS-20265?
CREATE TABLE table_10875694_11 ( publisher VARCHAR, product_no VARCHAR )
SELECT publisher FROM table_10875694_11 WHERE product_no = "SLUS-20265"
Below are sql tables 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 publishers produce product number SLUS-20265? ### Input: CREATE TABLE table_10875694_11 ( publisher VARCHAR, pr...
Show me a bar chart for what are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?, and show by the y axis in descending.
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 Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY SUM(Enrollment) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me a bar chart for what are the different affiliations, and what is the total enrollment of schools founded after 1850 ...
list the fares of US flights from BOSTON to PHILADELPHIA
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE aircraft ( aircraft_code varchar,...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: list the fares of US flights from BOSTON to PHILADELPHIA ### Input: CREATE TABLE date_day ( month_number int, day_nu...
Most popular StackOverflow tags July2016.
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Na...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId 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: Most popular StackOverflow tags July2016. ### Input: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
What was the Runner-up with Ohio as the National Champion in Tucson, AZ?
CREATE TABLE table_34715 ( "Year" text, "National Champion" text, "Runner-Up" text, "Location" text, "Host" text )
SELECT "Runner-Up" FROM table_34715 WHERE "National Champion" = 'ohio' AND "Location" = 'tucson, az'
Below are sql tables 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 Runner-up with Ohio as the National Champion in Tucson, AZ? ### Input: CREATE TABLE table_34715 ( "Year" te...
Give me a bar chart for sum price of each name, and order y-axis in desc order.
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart for sum price of each name, and order y-axis in desc order. ### Input: CREATE TABLE Manufacturers ( ...
age >= 20 ;
CREATE TABLE table_train_19 ( "id" int, "white_blood_cell_count_wbc" int, "active_infection" bool, "heart_disease" bool, "temperature" float, "skin_lesion" bool, "heart_rate" int, "paco2" float, "immature_form" int, "respiratory_rate" int, "age" float, "NOUSE" float )
SELECT * FROM table_train_19 WHERE age >= 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: age >= 20 ; ### Input: CREATE TABLE table_train_19 ( "id" int, "white_blood_cell_count_wbc" int, "active_infecti...
Which venue has 2:04.22 notes?
CREATE TABLE table_12379 ( "Year" real, "Venue" text, "Position" text, "Event" text, "Notes" text )
SELECT "Venue" FROM table_12379 WHERE "Notes" = '2:04.22'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which venue has 2:04.22 notes? ### Input: CREATE TABLE table_12379 ( "Year" real, "Venue" text, "Position" text,...
what is the number of single patients diagnosed with malignant neoplasm of descending colon?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Malignant neoplasm of descending colon"
Below are sql tables 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 single patients diagnosed with malignant neoplasm of descending colon? ### Input: CREATE TABLE procedu...
get the number of male patients who were born before the year 2024.
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 WHERE demographic.gender = "M" AND demographic.dob_year < "2024"
Below are sql tables 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 the number of male patients who were born before the year 2024. ### Input: CREATE TABLE prescriptions ( subject_id t...
what is the number of patients whose days of hospital stay is greater than 30 and diagnoses short title is idio periph neurpthy nos?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "30" AND diagnoses.short_title = "Idio periph neurpthy NOS"
Below are sql tables 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 days of hospital stay is greater than 30 and diagnoses short title is idio periph neurp...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of employee_id bin hire_date by weekday in a bar chart, rank by the Y from low to high 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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNT...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of employee_id ...
how many patients have undergone venous catheterization procedure and are not classified elsewhere?
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Venous catheterization, not elsewhere classified"
Below are sql tables 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 have undergone venous catheterization procedure and are not classified elsewhere? ### Input: CREATE TABLE ...
WHAT IS THE SCORE WITH A WINNER AND OPPONENT BYRON BLACK?
CREATE TABLE table_60330 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
SELECT "Score" FROM table_60330 WHERE "Outcome" = 'winner' AND "Opponent" = 'byron black'
Below are sql tables 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 WITH A WINNER AND OPPONENT BYRON BLACK? ### Input: CREATE TABLE table_60330 ( "Outcome" text, "Dat...
what is the number of patients whose year of birth is less than 2053?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2053"
Below are sql tables 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 year of birth is less than 2053? ### Input: CREATE TABLE diagnoses ( subject_id tex...
What is the 2010 value in the Australian Open?
CREATE TABLE table_name_60 ( tournament VARCHAR )
SELECT 2010 FROM table_name_60 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: What is the 2010 value in the Australian Open? ### Input: CREATE TABLE table_name_60 ( tournament VARCHAR ) ### Response...
Show the number of courses each instructor taught in a stacked bar chart. The x-axis is the instructor's first name and group by course description.
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), ...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION, EMP_FNAME
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the number of courses each instructor taught in a stacked bar chart. The x-axis is the instructor's first name and grou...
show me ground transportation in DENVER
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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, r...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me ground transportation in DENVER ### Input: CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, ...
For upper level electives which are the courses ?
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, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For upper level electives which are the courses ? ### Input: CREATE TABLE comment_instructor ( instructor_id int, st...
what is maximum age of patients whose marital status is married and admission year is greater than or equal to 2182?
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2182"
Below are sql tables 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 marital status is married and admission year is greater than or equal to 2182? ### Inp...
What was the tie for the Crystal Palace team?
CREATE TABLE table_name_42 ( tie_no VARCHAR, home_team VARCHAR )
SELECT tie_no FROM table_name_42 WHERE home_team = "crystal palace"
Below are sql tables 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 tie for the Crystal Palace team? ### Input: CREATE TABLE table_name_42 ( tie_no VARCHAR, home_team VARC...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the hire_date bin hire_date by weekday by a bar chart, and display in desc by the y-axis.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the hire_dat...
give the number of patients who have stayed in the hospital for more than 7 days with a private insurance.
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay > "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: give the number of patients who have stayed in the hospital for more than 7 days with a private insurance. ### Input: CREATE...
For those dates that have the 5 highest cloud cover rates, please bin the date into weekdays interval and compute their total cloud cover, and show total number in descending order.
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those dates that have the 5 highest cloud cover rates, please bin the date into weekdays interval and compute their tota...
Return a histogram on what are the different card types, and how many cards are there of each?, could you rank from high to low by the names?
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20)...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a histogram on what are the different card types, and how many cards are there of each?, could you rank from high to ...
Visualize a bar chart for how many workshops did each author submit to? Return the author name and the number of workshops, sort workshop_id) in ascending order.
CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text )
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY COUNT(DISTINCT T1.Workshop_ID)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize a bar chart for how many workshops did each author submit to? Return the author name and the number of workshops, ...
Show different type codes of products and the number of products with each type code in a bar chart, I want to display bar from low to high order.
CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Agreements ( Document_...
SELECT Product_Type_Code, COUNT(*) FROM Products GROUP BY Product_Type_Code ORDER BY Product_Type_Code
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show different type codes of products and the number of products with each type code in a bar chart, I want to display bar f...
What was the average money for United States when Lanny Wadkins played?
CREATE TABLE table_name_94 ( money___ INTEGER, country VARCHAR, player VARCHAR )
SELECT AVG(money___) AS $__ FROM table_name_94 WHERE country = "united states" AND player = "lanny wadkins"
Below are sql tables 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 money for United States when Lanny Wadkins played? ### Input: CREATE TABLE table_name_94 ( money___...
What is average Overall, when Pick is 19?
CREATE TABLE table_44768 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
SELECT AVG("Overall") FROM table_44768 WHERE "Pick" = '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 is average Overall, when Pick is 19? ### Input: CREATE TABLE table_44768 ( "Round" real, "Pick" real, "Over...
what was the first output that patient 15107 has had on the first intensive care unit visit?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, ...
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 = 15107) AND NOT icustays.outtime IS NULL 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: what was the first output that patient 15107 has had on the first intensive care unit visit? ### Input: CREATE TABLE procedu...
For those employees who do not work in departments with managers that have ids between 100 and 200, a scatter chart shows the correlation between employee_id and salary .
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a scatter chart shows th...
Name the college for nate binder
CREATE TABLE table_27273 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
SELECT "College" FROM table_27273 WHERE "Player" = 'Nate Binder'
Below are sql tables 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 college for nate binder ### Input: CREATE TABLE table_27273 ( "Pick #" real, "CFL Team" text, "Player" ...
Who was the home team that played at Moorabbin Oval?
CREATE TABLE table_54669 ( "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_54669 WHERE "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: Who was the home team that played at Moorabbin Oval? ### Input: CREATE TABLE table_54669 ( "Home team" text, "Home t...
give me the number of patients whose age is less than 61 and diagnoses long title is pseudomonas infection in conditions classified elsewhere and of unspecified site?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "61" AND diagnoses.long_title = "Pseudomonas infection in conditions classified elsewhere and of unspecified site"
Below are sql tables 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 age is less than 61 and diagnoses long title is pseudomonas infection in conditions cla...
What is the total rating of channel for each channel owner Plot them as bar chart, and sort Y-axis in asc order.
CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percen...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY SUM(Rating_in_percent)
Below are sql tables 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 rating of channel for each channel owner Plot them as bar chart, and sort Y-axis in asc order. ### Input: ...
What team played on the road against the Buffalo Bills at home ?
CREATE TABLE table_80324 ( "Week" real, "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text )
SELECT "Visiting Team" FROM table_80324 WHERE "Host Team" = 'buffalo bills'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What team played on the road against the Buffalo Bills at home ? ### Input: CREATE TABLE table_80324 ( "Week" real, ...
For those records from the products and each product's manufacturer, give me the comparison about the amount of founder over the founder , and group by attribute founder by a bar chart.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about the amount of founder over...
I need to take an easy class to fulfill the MDE requirement , which one should it be ?
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
Below are sql tables 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 to take an easy class to fulfill the MDE requirement , which one should it be ? ### Input: CREATE TABLE area ( co...
A bar chart about the number of end dates for incidents with incident type code 'NOISE'?, sort date_incident_end from low to high order.
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 Addresses ( addr...
SELECT date_incident_end, COUNT(date_incident_end) FROM Behavior_Incident WHERE incident_type_code = "NOISE" GROUP BY date_incident_end ORDER BY date_incident_end
Below are sql tables 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 the number of end dates for incidents with incident type code 'NOISE'?, sort date_incident_end from low to...
Which entrant has fewer than 12 points, a Climax engine, and a Lotus 24 chassis?
CREATE TABLE table_name_63 ( entrant VARCHAR, chassis VARCHAR, pts VARCHAR, engine VARCHAR )
SELECT entrant FROM table_name_63 WHERE pts < 12 AND engine = "climax" AND chassis = "lotus 24"
Below are sql tables 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 entrant has fewer than 12 points, a Climax engine, and a Lotus 24 chassis? ### Input: CREATE TABLE table_name_63 ( ...
how many hours had passed since the last time patient 99883 was prescribed clotrimazole on the current hospital encounter?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'clotrimazole' ORDER BY prescriptions.startda...
Below are sql tables 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 had passed since the last time patient 99883 was prescribed clotrimazole on the current hospital encounter? #...
has patient 021-79544 received an therapeutic antibacterials - clindamycin procedure since 2105?
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-79544')) AND treatment.treatmentname = 'therapeutic antibacterials - cli...
Below are sql tables 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 021-79544 received an therapeutic antibacterials - clindamycin procedure since 2105? ### Input: CREATE TABLE mic...
what was the last urine catheter output time for patient 031-21970 on 09/26/this year?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, ...
SELECT 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 = '031-21970')) AND intakeoutput.cellpath LIKE '%output%...
Below are sql tables 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 last urine catheter output time for patient 031-21970 on 09/26/this year? ### Input: CREATE TABLE lab ( lab...
give me a flight from TAMPA to CHARLOTTE on sunday
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number = 27 AND date_day.month_number = 8 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: give me a flight from TAMPA to CHARLOTTE on sunday ### Input: CREATE TABLE flight_fare ( flight_id int, fare_id int ...
Name the Prof. who teach 385 other than Prof. Harun Echols .
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 instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 385 AND NOT instructor.name LIKE '%Harun Echols%' AND offering_instructor.instructor_id = instructor.instructor_id AND offer...
Below are sql tables 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 Prof. who teach 385 other than Prof. Harun Echols . ### Input: CREATE TABLE requirement ( requirement_id int, ...
how many patients tested for rbc pleural in lab?
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 lab.label = "RBC, Pleural"
Below are sql tables 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 tested for rbc pleural in lab? ### Input: CREATE TABLE diagnoses ( subject_id text, hadm_id text, ...
Find the total student enrollment for different affiliation type schools.
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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation
Below are sql tables 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 total student enrollment for different affiliation type schools. ### Input: CREATE TABLE basketball_match ( Tea...
What shows for round when the race was Int. Adac Preis Von Zweibr cken?
CREATE TABLE table_name_43 ( round VARCHAR, race VARCHAR )
SELECT round FROM table_name_43 WHERE race = "int. adac preis von zweibrücken"
Below are sql tables 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 shows for round when the race was Int. Adac Preis Von Zweibr cken? ### Input: CREATE TABLE table_name_43 ( round VA...
How many different locations does each school have Show bar chart, and I want to sort by the X-axis in asc please.
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 PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), ...
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY SCHOOL_CODE
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many different locations does each school have Show bar chart, and I want to sort by the X-axis in asc please. ### Input...
What was the average attendance on October 12?
CREATE TABLE table_14722 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
SELECT AVG("Attendance") FROM table_14722 WHERE "Date" = 'october 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: What was the average attendance on October 12? ### Input: CREATE TABLE table_14722 ( "Game" real, "Date" text, "...
What is the Week of the game against Green Bay Packers?
CREATE TABLE table_64794 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
SELECT AVG("Week") FROM table_64794 WHERE "Opponent" = 'green bay packers'
Below are sql tables 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 Week of the game against Green Bay Packers? ### Input: CREATE TABLE table_64794 ( "Week" real, "Date" te...
Top 100 user of stackoverflow from Pakistan.
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...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Pakistan%' LIMIT 100
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 100 user of stackoverflow from Pakistan. ### Input: CREATE TABLE Users ( Id number, Reputation number, Creat...
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 job_id and commission_pct .
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,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...
SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the di...
how many of the patients aged below 86 were treated with d5ns?
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "86" AND prescriptions.drug = "D5NS"
Below are sql tables 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 of the patients aged below 86 were treated with d5ns? ### Input: CREATE TABLE lab ( subject_id text, hadm_i...
how many hours has it been since the first intake of fat emulsion 20% for patient 022-187132 on the current icu visit?
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
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 has it been since the first intake of fat emulsion 20% for patient 022-187132 on the current icu visit? ### I...
For those employees who was hired before 2002-06-21, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id by a bar chart, and display X-axis in asc order.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those employees who was hired before 2002-06-21, give me the comparison about the amount of job_id over the job_id , and...
What is the highest Attendance, when Result is l 26-16, and when Week is less than 12?
CREATE TABLE table_name_36 ( attendance INTEGER, result VARCHAR, week VARCHAR )
SELECT MAX(attendance) FROM table_name_36 WHERE result = "l 26-16" AND week < 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: What is the highest Attendance, when Result is l 26-16, and when Week is less than 12? ### Input: CREATE TABLE table_name_36...
what is the minimum sao2 of patient 030-52327 since 688 days ago?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT MIN(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND NOT vitalperiodic.sao2 IS NULL AND DATET...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the minimum sao2 of patient 030-52327 since 688 days ago? ### Input: CREATE TABLE vitalperiodic ( vitalperiodici...
How many patients with emergency admission type were admitted before 2164?
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 WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2164"
Below are sql tables 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 with emergency admission type were admitted before 2164? ### Input: CREATE TABLE prescriptions ( subje...
how many days have it been since the last time that patient 73713 stayed on this hospital encounter in careunit sicu?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND admissions.dischtime IS NULL) AND transfers.careunit = 'sicu' ORDER BY transfers.intime 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: how many days have it been since the last time that patient 73713 stayed on this hospital encounter in careunit sicu? ### In...
patient 5561 has been tested in 11/last year for the hematocrit?
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(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5561) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_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: patient 5561 has been tested in 11/last year for the hematocrit? ### Input: CREATE TABLE labevents ( row_id number, ...
When did an away team score 14.19 (103)?
CREATE TABLE table_57037 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT "Date" FROM table_57037 WHERE "Away team score" = '14.19 (103)'
Below are sql tables 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 an away team score 14.19 (103)? ### Input: CREATE TABLE table_57037 ( "Home team" text, "Home team score" t...
provide the number of patients whose admission year is less than 2111 and lab test fluid is cerebrospinal fluid (csf)?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" 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: provide the number of patients whose admission year is less than 2111 and lab test fluid is cerebrospinal fluid (csf)? ### I...
what was patient 20165's weight the first time until 6 months ago?
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
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 = 20165)) 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: what was patient 20165's weight the first time until 6 months ago? ### Input: CREATE TABLE chartevents ( row_id number, ...
what is the minimum total cost of the hospital which include glucose - csf until 2102?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'glucose - csf')) AND STRFTIME('%y', cost.chargetime) <= '2102' GROUP...
Below are sql tables 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 minimum total cost of the hospital which include glucose - csf until 2102? ### Input: CREATE TABLE vitalperiodic...
What is the incumbent for ohio 12?
CREATE TABLE table_18595 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT "Incumbent" FROM table_18595 WHERE "District" = 'Ohio 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: What is the incumbent for ohio 12? ### Input: CREATE TABLE table_18595 ( "District" text, "Incumbent" text, "Par...
Who is the race caller when jim mckay and al michaels were s hosts in the year 1987?
CREATE TABLE table_22514845_4 ( race_caller VARCHAR, s_host VARCHAR, year VARCHAR )
SELECT race_caller FROM table_22514845_4 WHERE s_host = "Jim McKay and Al Michaels" AND year = 1987
Below are sql tables 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 race caller when jim mckay and al michaels were s hosts in the year 1987? ### Input: CREATE TABLE table_22514845_...
What game was held against a team with a 6-3 record against the Cowboys?
CREATE TABLE table_25311 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cowboys points" real, "Opponents" real, "Record" text )
SELECT "Game" FROM table_25311 WHERE "Record" = '6-3'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What game was held against a team with a 6-3 record against the Cowboys? ### Input: CREATE TABLE table_25311 ( "Game" re...
Which driver's grid was 24?
CREATE TABLE table_42559 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT "Driver" FROM table_42559 WHERE "Grid" = '24'
Below are sql tables 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 driver's grid was 24? ### Input: CREATE TABLE table_42559 ( "Driver" text, "Team" text, "Laps" real, "...
Top 25 related tags of single tag.
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
SELECT t1.TagName AS Tag, t2.TagName AS "Related Tag", COUNT(t2.TagName) AS "Count" FROM PostTags AS pt1 INNER JOIN Tags AS t1 ON pt1.TagId = t1.Id INNER JOIN PostTags AS pt2 ON pt1.PostId = pt2.PostId AND pt1.TagId != pt2.TagId INNER JOIN Tags AS t2 ON pt2.TagId = t2.Id INNER JOIN Posts AS A ON pt2.PostId = A.Id WHERE...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Top 25 related tags of single tag. ### Input: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, ...
what the name of the insurance of patient 12797 when they visited the hospital first time?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 12797 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime 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 the name of the insurance of patient 12797 when they visited the hospital first time? ### Input: CREATE TABLE diagnoses...