instruction
stringlengths
11
303
input
stringlengths
38
5.51k
output
stringlengths
25
1.92k
text
stringlengths
321
6.52k
did patient 13536 receive any surgical procedures in this year?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_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_i...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13536) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 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: did patient 13536 receive any surgical procedures in this year? ### Input: CREATE TABLE d_labitems ( row_id number, ...
what the last height of patient 011-31779 on their first hospital encounter.
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31779' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionheight IS NULL ORDER BY p...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what the last height of patient 011-31779 on their first hospital encounter. ### Input: CREATE TABLE medication ( medica...
Count the number of services by services, display by the total number in desc.
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CR...
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY COUNT(services) 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: Count the number of services by services, display by the total number in desc. ### Input: CREATE TABLE weekly_weather ( ...
Who was the home team when the Tie no was 7?
CREATE TABLE table_name_60 ( home_team VARCHAR, tie_no VARCHAR )
SELECT home_team FROM table_name_60 WHERE tie_no = "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: Who was the home team when the Tie no was 7? ### Input: CREATE TABLE table_name_60 ( home_team VARCHAR, tie_no VARCH...
Core requires what classes ?
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' 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: Core requires what classes ? ### Input: CREATE TABLE program_requirement ( program_id int, category varchar, min...
what was the last time patient 5866 was prescribed senna and syringe (0.9% sodium chloride) until 19 months ago, at the same time?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, ...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'senna' AND admissions.subject_id = 5866 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-19 month')) AS t1 JOIN ...
Below are sql tables 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 time patient 5866 was prescribed senna and syringe (0.9% sodium chloride) until 19 months ago, at the same...
What was the away team score for the game with a crowd of 5391?
CREATE TABLE table_20771 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
SELECT "Away team score" FROM table_20771 WHERE "Crowd" = '5391'
Below are sql tables 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 team score for the game with a crowd of 5391? ### Input: CREATE TABLE table_20771 ( "Home team" text, ...
What T10 Place Player has a Score of 74-73-68=215?
CREATE TABLE table_47801 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT "Player" FROM table_47801 WHERE "Place" = 't10' AND "Score" = '74-73-68=215'
Below are sql tables 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 T10 Place Player has a Score of 74-73-68=215? ### Input: CREATE TABLE table_47801 ( "Place" text, "Player" text...
What was the away team score in the game at Arden Street Oval?
CREATE TABLE table_32550 ( "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_32550 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: What was the away team score in the game at Arden Street Oval? ### Input: CREATE TABLE table_32550 ( "Home team" text, ...
Who did they play against in game 7?
CREATE TABLE table_20745754_1 ( opponent VARCHAR, _number VARCHAR )
SELECT opponent FROM table_20745754_1 WHERE _number = "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: Who did they play against in game 7? ### Input: CREATE TABLE table_20745754_1 ( opponent VARCHAR, _number VARCHAR ) ...
provide the number of patients whose lab test name is specific gravity?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Specific Gravity"
Below are sql tables 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 lab test name is specific gravity? ### Input: CREATE TABLE demographic ( subject_id...
what are the top five most commonly prescribed medicines during this year?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top five most commonly prescribed medicines during this year? ### Input: CREATE TABLE icustays ( row_id num...
Name the city of license with frequency of 90.1 fm
CREATE TABLE table_71970 ( "Call sign" text, "Frequency" text, "City of license" text, "Facility ID" real, "ERP / Power W" real, "Height m ( ft )" text, "Class" text )
SELECT "City of license" FROM table_71970 WHERE "Frequency" = '90.1 fm'
Below are sql tables 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 city of license with frequency of 90.1 fm ### Input: CREATE TABLE table_71970 ( "Call sign" text, "Frequenc...
Visualize the relationship between Team_ID and All_Games_Percent , and group by attribute ACC_Home.
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the relationship between Team_ID and All_Games_Percent , and group by attribute ACC_Home. ### Input: CREATE TABLE ...
How many patients with an iv bolus route of drug administration were admitted before 2170?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.route = "IV BOLUS"
Below are sql tables 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 an iv bolus route of drug administration were admitted before 2170? ### Input: CREATE TABLE diagnoses...
Top 50 users from Bangladesh.
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, Rejection...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bangladesh%' ORDER BY Reputation DESC LIMIT 150
Below are sql tables 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 50 users from Bangladesh. ### Input: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, Us...
What team was the opponent when there was a score of 5 4 (11)?
CREATE TABLE table_71033 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
SELECT "Opponent" FROM table_71033 WHERE "Score" = '5–4 (11)'
Below are sql tables 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 was the opponent when there was a score of 5 4 (11)? ### Input: CREATE TABLE table_71033 ( "Date" text, "O...
Who was the opponent in week 12?
CREATE TABLE table_67450 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT "Opponent" FROM table_67450 WHERE "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: Who was the opponent in week 12? ### Input: CREATE TABLE table_67450 ( "Week" real, "Date" text, "Opponent" text...
what are the three most commonly ordered procedures for patients who have previously been diagnosed with mitral valve disorder, which occurred within the same month last year?
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id numbe...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
Below are sql tables 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 three most commonly ordered procedures for patients who have previously been diagnosed with mitral valve disord...
An easy ACC class is what I need .
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_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department LIKE '%ACC%' AND program_course.course_id = course.course_id AND program_course.workload < 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: An easy ACC class is what I need . ### Input: CREATE TABLE student ( student_id int, lastname varchar, firstname...
In 1994 what tournament held a ATP masters series
CREATE TABLE table_name_38 ( tournament VARCHAR )
SELECT 1994 FROM table_name_38 WHERE tournament = "atp masters series"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: In 1994 what tournament held a ATP masters series ### Input: CREATE TABLE table_name_38 ( tournament VARCHAR ) ### Respo...
What number of patients that died had ruq pain?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "RUQ PAIN"
Below are sql tables 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 number of patients that died had ruq pain? ### Input: CREATE TABLE demographic ( subject_id text, hadm_id text,...
When the result was l 13-7 ot, who was the opponent?
CREATE TABLE table_name_27 ( opponent VARCHAR, result VARCHAR )
SELECT opponent FROM table_name_27 WHERE result = "l 13-7 ot"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the result was l 13-7 ot, who was the opponent? ### Input: CREATE TABLE table_name_27 ( opponent VARCHAR, resul...
Top 10 users by average answer score.
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
SELECT OwnerUserId AS "user_link", AVG(Score), COUNT(*) AS NumAnswers 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: Top 10 users by average answer score. ### Input: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descriptio...
Show me about the distribution of Sex and the average of Weight , and group by attribute Sex in a bar chart, and list y axis from high to low order.
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 Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show me about the distribution of Sex and the average of Weight , and group by attribute Sex in a bar chart, and list y axis...
Count the number of asian patients who died in or before 2158.
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dod_year <= "2158.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: Count the number of asian patients who died in or before 2158. ### Input: CREATE TABLE prescriptions ( subject_id text, ...
Show the number of brand from each brand, order total number in ascending order.
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand)
Below are sql tables 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 brand from each brand, order total number in ascending order. ### Input: CREATE TABLE mountain ( id i...
How many games were held on March 12?
CREATE TABLE table_27715173_10 ( game VARCHAR, date VARCHAR )
SELECT COUNT(game) FROM table_27715173_10 WHERE date = "March 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: How many games were held on March 12? ### Input: CREATE TABLE table_27715173_10 ( game VARCHAR, date VARCHAR ) ### R...
what is the three most frequent medication that was prescribed in the same month to the patients aged 40s after they had been diagnosed with bone fracture(s) - ribs, since 5 years ago?
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bone fracture(s) - ribs' AND DATETIME(diagnosis.di...
Below are sql tables 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 three most frequent medication that was prescribed in the same month to the patients aged 40s after they had bee...
What is the number of booking start dates of the apartments with more than 2 bedrooms for each weekday? Draw a bar chart, and order by the Y from low to high please.
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address ...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date)
Below are sql tables 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 booking start dates of the apartments with more than 2 bedrooms for each weekday? Draw a bar chart, an...
Top SO users from Taiwan.
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS Link, DisplayName, Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%taiwan%' OR UPPER(Location) LIKE '%Taiwan%' OR Location LIKE '% %') ORDER BY Reputation DESC LIMIT 50
Below are sql tables 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 SO users from Taiwan. ### Input: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId...
what was the name of the last lab test that patient 25050 had since 105 months ago?
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25050) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-105 month') ORDER BY labevents.charttime D...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the name of the last lab test that patient 25050 had since 105 months ago? ### Input: CREATE TABLE labevents ( ...
how many patients who have been prescribed base drug type had other cell lab test in the lab?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Other Cell"
Below are sql tables 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 have been prescribed base drug type had other cell lab test in the lab? ### Input: CREATE TABLE lab ( ...
Give me a bar chart to show how many days with a max temperature greater than or equal to 80 for each year, and sort total number from high to low 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 status ( station_i...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 ORDER BY COUNT(date) DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Give me a bar chart to show how many days with a max temperature greater than or equal to 80 for each year, and sort total n...
Show the most common position of players in match seasons.
CREATE TABLE match_season ( POSITION VARCHAR )
SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY COUNT(*) DESC LIMIT 1
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the most common position of players in match seasons. ### Input: CREATE TABLE match_season ( POSITION VARCHAR ) ###...
What time was game 7?
CREATE TABLE table_name_25 ( time VARCHAR, game VARCHAR )
SELECT time FROM table_name_25 WHERE game = 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 time was game 7? ### Input: CREATE TABLE table_name_25 ( time VARCHAR, game VARCHAR ) ### Response: SELECT time...
Which Gold Coast has Melbourne yes, and Auckland yes?
CREATE TABLE table_name_8 ( gold_coast VARCHAR, melbourne VARCHAR, auckland VARCHAR )
SELECT gold_coast FROM table_name_8 WHERE melbourne = "yes" AND auckland = "yes"
Below are sql tables 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 Gold Coast has Melbourne yes, and Auckland yes? ### Input: CREATE TABLE table_name_8 ( gold_coast VARCHAR, mel...
Pie chart. what are the different transaction types, and how many transactions of each have taken place?
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 transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Pie chart. what are the different transaction types, and how many transactions of each have taken place? ### Input: CREATE T...
For all employees who have the letters D or S in their first name, a line chart shows the change of salary over hire_date, and could you sort HIRE_DATE from high to low order?
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 HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For all employees who have the letters D or S in their first name, a line chart shows the change of salary over hire_date, a...
what flights are there between WASHINGTON and SAN FRANCISCO leaving washington after 1800 on wednesday
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
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 = 23 AND date_day.month_number = 4 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 flights are there between WASHINGTON and SAN FRANCISCO leaving washington after 1800 on wednesday ### Input: CREATE TAB...
count the number of patients whose insurance is private and admission location is clinic referral/premature.
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
Below are sql tables 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 insurance is private and admission location is clinic referral/premature. ### Input: CREA...
count the number of times patient 95909 during this year had received thoracoscopic pleural bx.
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'thoracoscopic pleural bx') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95909) AND DATETIME(proced...
Below are sql tables 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 patient 95909 during this year had received thoracoscopic pleural bx. ### Input: CREATE TABLE tran...
has patient 011-31236 actually been admitted since 2100?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '011-31236' AND STRFTIME('%y', patient.hospitaladmittime) >= '2100'
Below are sql tables 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 011-31236 actually been admitted since 2100? ### Input: CREATE TABLE intakeoutput ( intakeoutputid number, ...
For each classroom, show the classroom number and find how many students are using it.
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
SELECT classroom, COUNT(*) FROM list GROUP BY classroom
Below are sql tables 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 classroom, show the classroom number and find how many students are using it. ### Input: CREATE TABLE teachers ( ...
Find the details of the shops that can be reached by walk.
CREATE TABLE features ( feature_id number, feature_details text ) CREATE TABLE theme_parks ( theme_park_id number, theme_park_details text ) CREATE TABLE street_markets ( market_id number, market_details text ) CREATE TABLE ref_hotel_star_ratings ( star_rating_code text, star_rating_d...
SELECT T1.shop_details FROM shops AS T1 JOIN tourist_attractions AS T2 ON T1.shop_id = T2.tourist_attraction_id WHERE T2.how_to_get_there = "walk"
Below are sql tables 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 details of the shops that can be reached by walk. ### Input: CREATE TABLE features ( feature_id number, fea...
What was St Kilda's away team score?
CREATE TABLE table_4756 ( "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_4756 WHERE "Away team" = 'st kilda'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was St Kilda's away team score? ### Input: CREATE TABLE table_4756 ( "Home team" text, "Home team score" text, ...
Show the number of accounts opened in each year for all accounts and group by other account details in a group line chart.
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80...
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_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: Show the number of accounts opened in each year for all accounts and group by other account details in a group line chart. #...
what is the number of patients whose primary disease is newborn and year of death is less than or equal to 2122?
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 WHERE demographic.diagnosis = "NEWBORN" AND demographic.dod_year <= "2122.0"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose primary disease is newborn and year of death is less than or equal to 2122? ### Input: ...
What is the name of the home team that played an away team who scored 13.11 (89)?
CREATE TABLE table_54553 ( "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_54553 WHERE "Away team score" = '13.11 (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: What is the name of the home team that played an away team who scored 13.11 (89)? ### Input: CREATE TABLE table_54553 ( ...
For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute headquarter by a bar chart, I want to order by the X-axis in asc please.
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For those records from the products and each product's manufacturer, give me the comparison about code over the name , and g...
Get me the list of patients who died on or before 2126 that had drug code ggac5l.
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 <= "2126.0" AND prescriptions.formulary_drug_cd = "GGAC5L"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Get me the list of patients who died on or before 2126 that had drug code ggac5l. ### Input: CREATE TABLE demographic ( ...
tell me patient 56009's hospital admission time until 2100?
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 56009 AND STRFTIME('%y', admissions.admittime) <= '2100'
Below are sql tables 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 patient 56009's hospital admission time until 2100? ### Input: CREATE TABLE outputevents ( row_id number, su...
when was the first time on this month/27 that patient 31854 had his or her arterial bp [systolic] measured?
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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when was the first time on this month/27 that patient 31854 had his or her arterial bp [systolic] measured? ### Input: CREAT...
provide the daily maximum amount of po intake that patient 23436 has received on the first icu visit.
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23436) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_...
Below are sql tables 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 daily maximum amount of po intake that patient 23436 has received on the first icu visit. ### Input: CREATE TABL...
Who was at Home when the Score was 13-19?
CREATE TABLE table_name_83 ( home VARCHAR, score VARCHAR )
SELECT home FROM table_name_83 WHERE score = "13-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: Who was at Home when the Score was 13-19? ### Input: CREATE TABLE table_name_83 ( home VARCHAR, score VARCHAR ) ### ...
What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor, and could you display Y in asc order?
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text )
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*)
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor, and could y...
how many patients had been in the careunit sicu during the previous year?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
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, '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 had been in the careunit sicu during the previous year? ### Input: CREATE TABLE icustays ( row_id numb...
What is the low grid total for a retired due to steering in under 15 laps?
CREATE TABLE table_52760 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
SELECT MIN("Grid") FROM table_52760 WHERE "Time/Retired" = 'steering' AND "Laps" < '15'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the low grid total for a retired due to steering in under 15 laps? ### Input: CREATE TABLE table_52760 ( "Driver...
provide the number of patients whose year of birth is less than 2080 and drug code is posa200l?
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.dob_year < "2080" AND prescriptions.formulary_drug_cd = "POSA200L"
Below are sql tables 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 year of birth is less than 2080 and drug code is posa200l? ### Input: CREATE TABLE demo...
tell me the difference between the total amount of input and output from patient 027-203413 today?
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND intakeoutput.cellpath ...
Below are sql tables 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 difference between the total amount of input and output from patient 027-203413 today? ### Input: CREATE TABLE m...
Visualize the name and their component amounts with a bar chart for all furnitures that have more than 10 components, could you order by the bar in ascending?
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furnit...
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 ORDER BY 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: Visualize the name and their component amounts with a bar chart for all furnitures that have more than 10 components, could ...
Show the number of professors who is in office DRE 102 hired in each weekday with a bar chart, and I want to list from low to high by the Y.
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' ORDER BY COUNT(EMP_HIREDATE)
Below are sql tables 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 professors who is in office DRE 102 hired in each weekday with a bar chart, and I want to list from low t...
Which Game is the highest that has a January of 28?
CREATE TABLE table_35993 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
SELECT MAX("Game") FROM table_35993 WHERE "January" = '28'
Below are sql tables 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 is the highest that has a January of 28? ### Input: CREATE TABLE table_35993 ( "Game" real, "January" rea...
how many patients with brain mass, intracranial hemorrhage had a blood test by 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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Blood"
Below are sql tables 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 brain mass, intracranial hemorrhage had a blood test by lab? ### Input: CREATE TABLE diagnoses ( ...
Which Silver has a Rank of 6, and a Bronze smaller than 3?
CREATE TABLE table_name_3 ( silver INTEGER, rank VARCHAR, bronze VARCHAR )
SELECT MIN(silver) FROM table_name_3 WHERE rank = 6 AND bronze < 3
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Silver has a Rank of 6, and a Bronze smaller than 3? ### Input: CREATE TABLE table_name_3 ( silver INTEGER, ra...
What is the total number of Goals For, when Losses is greater than 16?
CREATE TABLE table_name_99 ( goals_for VARCHAR, losses INTEGER )
SELECT COUNT(goals_for) FROM table_name_99 WHERE losses > 16
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total number of Goals For, when Losses is greater than 16? ### Input: CREATE TABLE table_name_99 ( goals_for...
For the game where the opponent is listed as @ Indiana Pacers, what was the end record?
CREATE TABLE table_46558 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
SELECT "Record" FROM table_46558 WHERE "Opponent" = '@ indiana pacers'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For the game where the opponent is listed as @ Indiana Pacers, what was the end record? ### Input: CREATE TABLE table_46558 ...
Which upper level classes use projects rather than exams for evaluation ?
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which upper level classes use projects rather than exams for evaluation ? ### Input: CREATE TABLE program_requirement ( ...
how many of the patients on government insurance had aortocor bypas-2 cor art?
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Aortocor bypas-2 cor art"
Below are sql tables 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 on government insurance had aortocor bypas-2 cor art? ### Input: CREATE TABLE procedures ( subj...
What are the hometowns of gymnasts and the corresponding number of gymnasts. Show a pie chart.
CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real, Total_Points real ) CREATE TABLE people ( People_ID int, Name text, Age real, Height ...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
Below are sql tables 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 hometowns of gymnasts and the corresponding number of gymnasts. Show a pie chart. ### Input: CREATE TABLE gymna...
known estimated glomerular filtration rate ( egfr ) < 30 ml / min / 1.73 m^2 using the modification of diet in renal disease ( mdrd ) formula at visit 1 ( core study visit 10 )
CREATE TABLE table_test_4 ( "id" int, "ejection_fraction_ef" int, "systolic_blood_pressure_sbp" int, "active_infection" bool, "heart_disease" bool, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, "diastolic_blood_pressure_dbp" int, ...
SELECT * FROM table_test_4 WHERE estimated_glomerular_filtration_rate_egfr < 30
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: known estimated glomerular filtration rate ( egfr ) < 30 ml / min / 1.73 m^2 using the modification of diet in renal disease...
What sport did Miroslav Jambor Richard Csejtey participate in?
CREATE TABLE table_66510 ( "Medal" text, "Name" text, "Sport" text, "Event" text, "Date" text )
SELECT "Sport" FROM table_66510 WHERE "Name" = 'miroslav jambor richard csejtey'
Below are sql tables 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 sport did Miroslav Jambor Richard Csejtey participate in? ### Input: CREATE TABLE table_66510 ( "Medal" text, "...
What is the lowest total that has a rank less than 8, a silver greater than 6, and 20 as the bronze?
CREATE TABLE table_63026 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
SELECT MIN("Total") FROM table_63026 WHERE "Rank" < '8' AND "Silver" > '6' AND "Bronze" = '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 is the lowest total that has a rank less than 8, a silver greater than 6, and 20 as the bronze? ### Input: CREATE TABLE...
tell me the minimum total hospital cost that involves methylprednisolone until 2 years ago?
CREATE TABLE d_icd_procedures ( 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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'methylprednisolone') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY cost.hadm_id) AS t1
Below are sql tables 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 minimum total hospital cost that involves methylprednisolone until 2 years ago? ### Input: CREATE TABLE d_icd_pr...
what are the top four most frequent prescriptions that patient were prescribed with within 2 months after being prescribed with valacyclovir in 2105?
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'valacyclovir' AND STRFTIME('%y', prescriptions.startdate) = '2105...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the top four most frequent prescriptions that patient were prescribed with within 2 months after being prescribed w...
Which week had 39,056 people in attendance?
CREATE TABLE table_55181 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
SELECT "Week" FROM table_55181 WHERE "Attendance" = '39,056'
Below are sql tables 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 week had 39,056 people in attendance? ### Input: CREATE TABLE table_55181 ( "Week" text, "Date" text, "Opp...
calculate patient 15107's total intake of lipids 20% on 11/23/2104.
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15107)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
Below are sql tables 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 patient 15107's total intake of lipids 20% on 11/23/2104. ### Input: CREATE TABLE diagnoses_icd ( row_id numbe...
What is the event with a result of 3-2?
CREATE TABLE table_name_40 ( competition VARCHAR, result VARCHAR )
SELECT competition FROM table_name_40 WHERE result = "3-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: What is the event with a result of 3-2? ### Input: CREATE TABLE table_name_40 ( competition VARCHAR, result VARCHAR ...
what is the date when the home team is st kilda?
CREATE TABLE table_52261 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
SELECT "Date" FROM table_52261 WHERE "Home team" = 'st kilda'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the date when the home team is st kilda? ### Input: CREATE TABLE table_52261 ( "Home team" text, "Home team ...
When was the earliest season of Juncadella's career?
CREATE TABLE table_3290 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
SELECT MIN("Season") FROM table_3290
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When was the earliest season of Juncadella's career? ### Input: CREATE TABLE table_3290 ( "Season" real, "Series" te...
how much do patients pay to get a diagnosis of atrophic vaginitis?
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrophic vaginitis'))
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how much do patients pay to get a diagnosis of atrophic vaginitis? ### Input: CREATE TABLE diagnoses_icd ( row_id number...
How many were first elected in the Arkansas 4 district?
CREATE TABLE table_72409 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT COUNT("First elected") FROM table_72409 WHERE "District" = 'Arkansas 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: How many were first elected in the Arkansas 4 district? ### Input: CREATE TABLE table_72409 ( "District" text, "Incu...
Count the number of patients admitted before the year 2177 whose lab test abnormal status is delta.
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2177" AND lab.flag = "delta"
Below are sql tables 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 admitted before the year 2177 whose lab test abnormal status is delta. ### Input: CREATE TABLE ...
Which Notes have a Time larger than 23.34, and a Rank of 8?
CREATE TABLE table_65118 ( "Rank" real, "Lane" real, "Athlete" text, "Time ( sec )" real, "Notes" text )
SELECT "Notes" FROM table_65118 WHERE "Time ( sec )" > '23.34' AND "Rank" = '8'
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Notes have a Time larger than 23.34, and a Rank of 8? ### Input: CREATE TABLE table_65118 ( "Rank" real, "Lane...
could i have the flights from NEWARK to ORLANDO please
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 airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_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 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 = 'ORLANDO...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: could i have the flights from NEWARK to ORLANDO please ### Input: CREATE TABLE fare_basis ( fare_basis_code text, bo...
what were the differences in hct values of patient 010-37499 measured at 2105-01-18 17:23:00 compared to the value measured at 2105-01-17 21:51:00?
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 diagnosis ( diagn...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-37499')) AND lab.labname = 'hct' AND lab.labresulttime = '2105-01-18 17:23:...
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the differences in hct values of patient 010-37499 measured at 2105-01-18 17:23:00 compared to the value measured ...
What are the smallest goals with a Goal Ratio of 0.14, and a Debut in Europe smaller than 1995?
CREATE TABLE table_71715 ( "Rank" real, "Player" text, "Games" real, "Goals" real, "Goal Ratio" real, "Debut in Europe" real )
SELECT MIN("Goals") FROM table_71715 WHERE "Goal Ratio" = '0.14' AND "Debut in Europe" < '1995'
Below are sql tables 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 smallest goals with a Goal Ratio of 0.14, and a Debut in Europe smaller than 1995? ### Input: CREATE TABLE tabl...
Which upper-level classes in BUDDHST are being offered this Summer .
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
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 = 'BUDDHST' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sum...
Below are sql tables 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 upper-level classes in BUDDHST are being offered this Summer . ### Input: CREATE TABLE program_course ( program_id...
Visualize the relationship between Height and Weight , and group by attribute Sex.
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 Height, Weight FROM people GROUP BY Sex
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Visualize the relationship between Height and Weight , and group by attribute Sex. ### Input: CREATE TABLE candidate ( C...
how many patients whose diagnoses long title is paroxysmal ventricular tachycardia and drug type is main?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Paroxysmal ventricular tachycardia" AND prescriptions.drug_type = "MAIN"
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients whose diagnoses long title is paroxysmal ventricular tachycardia and drug type is main? ### Input: CREATE ...
What team was 2 when Tatung was team 1 at National Pei Men Senior High School?
CREATE TABLE table_63588 ( "Date" text, "Team 1" text, "Result" text, "Team 2" text, "Ground" text )
SELECT "Team 2" FROM table_63588 WHERE "Team 1" = 'tatung' AND "Ground" = 'national pei men senior high school'
Below are sql tables 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 was 2 when Tatung was team 1 at National Pei Men Senior High School? ### Input: CREATE TABLE table_63588 ( "Da...
What is the total points when the horse is Chippison?
CREATE TABLE table_name_96 ( points VARCHAR, horse VARCHAR )
SELECT COUNT(points) FROM table_name_96 WHERE horse = "chippison"
Below are sql tables 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 points when the horse is Chippison? ### Input: CREATE TABLE table_name_96 ( points VARCHAR, horse ...
what is average age of patients whose gender is f and discharge location is short term hospital?
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 AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "SHORT TERM HOSPITAL"
Below are sql tables 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 age of patients whose gender is f and discharge location is short term hospital? ### Input: CREATE TABLE dia...
Name the most draws when wins is 3
CREATE TABLE table_1126 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
SELECT MAX("Draws") FROM table_1126 WHERE "Wins" = '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: Name the most draws when wins is 3 ### Input: CREATE TABLE table_1126 ( "Position" real, "Team" text, "Played" r...
how many songs were a single only release ?
CREATE TABLE table_203_426 ( id number, "year" number, "title" text, "peak chart positions\naus" number, "peak chart positions\nnz" number, "peak chart positions\nuk" number, "album" text )
SELECT COUNT("title") FROM table_203_426 WHERE "album" = 'single-only release'
Below are sql tables 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 songs were a single only release ? ### Input: CREATE TABLE table_203_426 ( id number, "year" number, "t...
Display a pie chart for how old is the average person for each job?
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
SELECT job, AVG(age) FROM Person GROUP BY job
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Display a pie chart for how old is the average person for each job? ### Input: CREATE TABLE PersonFriend ( name varchar(...
what flights are available on sunday to PITTSBURGH from SAN FRANCISCO
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 27 AND date_day.month_number = 8 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 flights are available on sunday to PITTSBURGH from SAN FRANCISCO ### Input: CREATE TABLE flight_leg ( flight_id int...
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, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not ...
The pooulation of is?
CREATE TABLE table_73828 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" text, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
SELECT "Population (2011)" FROM table_73828 WHERE "Cyrillic Name Other Names" = 'Јарковац'
Below are sql tables 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 pooulation of is? ### Input: CREATE TABLE table_73828 ( "Settlement" text, "Cyrillic Name Other Names" text, ...
Name the least age for cibao central and santo domingo
CREATE TABLE table_21346767_3 ( age INTEGER, geographical_regions VARCHAR, hometown VARCHAR )
SELECT MIN(age) FROM table_21346767_3 WHERE geographical_regions = "Cibao Central" AND hometown = "Santo Domingo"
Below are sql tables 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 least age for cibao central and santo domingo ### Input: CREATE TABLE table_21346767_3 ( age INTEGER, geogr...